Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CSS4 space-separated syntax for rgba() function (Less.js 3.8.1) #98

Open
kingscott opened this issue Jun 26, 2023 · 1 comment

Comments

@kingscott
Copy link

Hi there, we're currently using less/php v3.1.0 and are seeing errors when trying to import standard CSS files into our pipeline that use the newer syntax for rgba such as:

.test {
  color: rgba(0 0 0 0 / 89%);
}

Is there a plan to support this in a future version, as I see it's supported in Less.js? Thanks!

@Krinkle Krinkle added Type: Enhancement New feature or request Type: Upstream labels Sep 9, 2023
@Krinkle
Copy link
Member

Krinkle commented Sep 9, 2023

Based on testing at https://ecomfe.github.io/est/fiddle/#version=2.5.3&autoprefix=false&est=false&autorun=false, it seems produces a syntax erorr in Less.js until 3.8.0, with it becoming supported in Less.js 3.8.1.

Less.php is currently compatible with Less.js 2.5.3.

Is there a plan to support this in a future version

Yes, given that it is supported in upstream, we aim to support this in a future version.

It may take a while before we're fully caught up with 3.8.1. But, we'd happy land this any time, as a small patch on its own. It seems sufficiently standalone and not break 2.5.3 compliance.

https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb#browser_compatibility

  • Alpha parameter
  • Space-separated rgb() parameters

The main distinguishing aspect of this syntax is that it uses space-separation instead of comma-separation for values, and denotes the fourth value after a slash instead of a space or comma. That part part is likely something we'd just pass through as-is rather than parse into tokens. That's what upstream ended up doing as well:

@Krinkle Krinkle changed the title rgba color function compatibility Support CSS4 space-separated syntax for rgba() function Sep 9, 2023
@Krinkle Krinkle changed the title Support CSS4 space-separated syntax for rgba() function Support CSS4 space-separated syntax for rgba() function (Less.js 3.8.1) Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants