[question] `scss/no-duplicate-dollar-variables`
See original GitHub issueExample:
.btn {
$new-color: $color;
@if (lightness($background) < 75%) {
$new-color: $background;
}
color: $new-color;
}
Looks like rule don’t look on context, just search same name and all. It is expected behaviour?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
[question] `scss/no-duplicate-dollar-variables` · Issue #244 - GitHub
The rule is quite simple and does not handle any special cases, at least yet. In your example it might be easier to...
Read more >Disable 'no-duplicate-dollar-variables' for ... - Stack Overflow
Is it possible to tell stylelint to skip the 'no-duplicate-dollar-variables' rule when a variable is initialized with default as in the case ...
Read more >Duplicate dollar signs ($) when using autocomplete.
Using VSCode v1.48.2. If I type the preceding $ for a php variable, then use autocomplete a second $ is added to the...
Read more >Sass vs. Less | CSS-Tricks
Variable Handling. Less uses @, Sass uses $. The dollar sign has no inherent meaning in CSS, while the @ sign does.
Read more >How to write reusable CSS with SASS - LogRocket Blog
Custom CSS (even with CSS variables) is still very redundant. ... run into the problem of importing a style sheet inside another style...
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
Oh yeah there’s of course always the option of adding secondary
ignore
option to the rule to ignore variables inside@if
.@evilebottnawi I have now implemented ignore options for the rule. Please have a look at the PR and let me know if it solves the issue that you had: https://github.com/kristerkari/stylelint-scss/pull/256