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

Add tests for CSS round() with one argument #2037

Merged
merged 1 commit into from
Nov 15, 2024
Merged

Add tests for CSS round() with one argument #2037

merged 1 commit into from
Nov 15, 2024

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Nov 13, 2024

This also updates tests expect global function warnings when
calculations are falling back on global Sass functions.

See sass/sass#3803
Closes #2036

[skip dart-sass]

This also updates tests expect global function warnings when
calculations are falling back on global Sass functions.

See sass/sass#3803
Closes #2036

,
1 | a {b: abs(1 + 1px)}
| ^^^^^^^
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Shouldn't these point to the function name instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the deprecation warning specifically refers to mixing unitless and unit numbers, I think it makes sense to point to the specific location where that mixing occurs.

'
input.scss 1:13 root stylesheet

DEPRECATION WARNING: In future versions of Sass, round() will be interpreted as a CSS round() calculation. This requires an explicit modulus when rounding numbers with units. If you want to use the Sass function, call math.round() instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a double warning expected here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More or less. It's both the case that round(1 + 1px) will throw an error and that round(2px) (which it resolves to) will throw an error.

Copy link
Contributor

@pamelalozano16 pamelalozano16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@nex3 nex3 merged commit 7a0312f into main Nov 15, 2024
12 checks passed
@nex3 nex3 deleted the one-arg-round branch November 15, 2024 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tests for round() with no modulus
2 participants