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

Allow using the CSS min and max calculations and the CSS filter functions #566

Merged
merged 4 commits into from
Dec 2, 2021

Conversation

stof
Copy link
Contributor

@stof stof commented Nov 24, 2021

The Sass functions should indeed be migrated to the sass:math module. But min() and max() can also be the CSS functions (and with first-class calc in Sass, it will parse it as a calculation if possible).

Closes #560
Closes #562
Closes #486

Copy link
Collaborator

@kristerkari kristerkari left a comment

Choose a reason for hiding this comment

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

Makes sense, we could just not lint those for now. 👍

@kristerkari
Copy link
Collaborator

kristerkari commented Dec 1, 2021

@stof could you please also add unit tests for this change?

stof added 2 commits December 1, 2021 12:28
The Sass functions should indeed be migrated to the sass:math module. But min() and max() can also be the CSS functions (and with first-class calc in Sass, it will parse it as a calculation if possible).
The Sass function shadows a CSS function. The global name should still
be allowed when using the CSS function.
A more complete change might be to allow only global usages that pass a
number as the only argument, but this is more complex to implement
(especially when the argument comes from a Sass variable that might be a
number or no).
@stof
Copy link
Contributor Author

stof commented Dec 1, 2021

@kristerkari done. and I also solved the case of filter that was added in a comment in the issue, as well as other shadowed CSS filter functions

@stof stof changed the title Allow using the CSS min and max calculations Allow using the CSS min and max calculations and the invert filter function Dec 1, 2021
@stof stof changed the title Allow using the CSS min and max calculations and the invert filter function Allow using the CSS min and max calculations and the CSS filter functions Dec 1, 2021
@kristerkari
Copy link
Collaborator

@stof looks like some unit tests are failing

@stof
Copy link
Contributor Author

stof commented Dec 1, 2021

@kristerkari fixed

@kristerkari kristerkari merged commit 491938d into stylelint-scss:master Dec 2, 2021
@kristerkari
Copy link
Collaborator

Thanks for the contribution @stof �!

@stof stof deleted the patch-1 branch December 2, 2021 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants