8000 Support constants in calc() · Issue #3258 · sass/sass · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support constants in calc() #3258

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

Closed
10 tasks done
nex3 opened this issue Feb 8, 2022 · 4 comments · Fixed by #3519
Closed
10 tasks done

Support constants in calc() #3258

nex3 opened this issue Feb 8, 2022 · 4 comments · Fixed by #3519
Assignees
Labels
CSS compatibility Support the CSS spec enhancement New feature or request

Comments

@nex3
Copy link
Contributor
nex3 commented Feb 8, 2022

Values and Units 4 defines pi, e, infinity, -infinity, and NaN constants for use in calc() expressions. We should support these as they land in browsers. The current status (as of 8 February 2022) is:

For the degenerate constants (infinity, -infinity, and NaN) we should not only support parsing them in calc() expressions but also serializing Sass numbers with those values to calc() expressions.

@nex3 nex3 added enhancement New feature or request CSS compatibility Support the CSS spec labels Feb 8, 2022
@luiscla27
Copy link
luiscla27 commented Sep 23, 2022

I think this enhancement is a kind of dup of #2954

(I was looking for general purpose constants but found yours and the suggested dup instead)

@nex3
Copy link
Contributor Author
nex3 commented Sep 23, 2022

They're different—#2954 would add support for math.$infinity, math.$negative-infinity, and math.$nan (math.$pi and math.$e already exist). This would add support for calc(infinity), calc(-infinity), calc(NaN), calc(pi), and calc(e).

@nex3
Copy link
Contributor Author
nex3 commented Mar 2, 2023

According to https://developer.mozilla.org/en-US/docs/Web/CSS/calc-constant#browser_compatibility, all of these constants are now supported by Firefox (although interestingly it seems none are supported in Chrome).

@nex3
Copy link
Contributor Author
nex3 commented Mar 2, 2023

The proposal has landed. Since it's relatively unlikely to be controversial, I'll give it two weeks for public comment before declaring it implementable.

nex3 added a commit to sass/sass-spec that referenced this issue Mar 23, 2023
nex3 added a commit to sass/dart-sass that referenced this issue Mar 23, 2023
nex3 added a commit to sass/sass-site that referenced this issue Mar 23, 2023
nex3 added a commit to sass/sass-site that referenced this issue Mar 23, 2023
nex3 added a commit to sass/dart-sass that referenced this issue Mar 23, 2023
nex3 added a commit to sass/sass-spec that referenced this issue Mar 23, 2023
nex3 added a commit that referenced this issue Mar 23, 2023
asaf400 pushed a commit to asaf400/ass-site that referenced this issue Apr 18, 2024
asaf400 pushed a commit to asaf400/ass-site that referenced this issue Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS compatibility Support the CSS spec enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0