no-global-function-names does not allow using CSS math functions
See original GitHub issueThis code causes the error Expected math.min instead of min scss/no-global-function-names
.foo {
width: min(300px, 30%);
}
Same with the max() function Expected math.max instead of max scss/no-global-function-names
.foo {
width: max(300px, 30%);
}
.stylelintrc.js
module.exports = {
'plugins': [
'stylelint-scss',
],
'rules': {
'scss/no-global-function-names': true,
},
};
"stylelint": "13.7.0",
"stylelint-scss": "3.18.0"
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9
Top Results From Across the Web
CSS math functions min(), max() and clamp() - CanIUse
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >Practical Uses of CSS Math Functions: calc, clamp, min, max
Review the four best supported CSS math functions, and see how they can be used in both practical and unexpected ways, such as...
Read more >CSS Math Functions - W3Schools
The CSS math functions allow mathematical expressions to be used as property values. Here, we will explain the calc() , max() and min()...
Read more >stylelint-scss | Yarn - Package Manager
A collection of SCSS specific linting rules for Stylelint (in a form of a ... Moreover, it introduces some specific rules that can...
Read more >CSS Functional Notation - CSS: Cascading Style Sheets | MDN
In some functional notations multiple arguments are separated by commas, ... The math functions allow CSS numeric values to be written as ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Please reopen this issue:
Using “stylelint-scss”: “4.0.1”, this bug is now fixed in most places where I was seeing it, but I’m still seeing a few of these errors. Eg:
For
I don’t know why these aren’t ignored, while all my other uses of min/max that were previously causing this lint error are now working fine.
Here’s an example that is still failing with stylelint-scss 4.0.1:
All 3 of the
min()
functions are failingscss/no-global-function-names
.@Donov4n As a workaround you could add comments before and after your code to disable the rule for a single block of code, e.g.
More info: https://stylelint.io/user-guide/ignore-code/