Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Add a lint rule for suspicious variable interpolation #35

Open
gopherkhan opened this issue Jan 11, 2019 · 1 comment
Open

Add a lint rule for suspicious variable interpolation #35

gopherkhan opened this issue Jan 11, 2019 · 1 comment

Comments

@gopherkhan
Copy link

Add a lint rule for CSS variables defined using un-interpolated Sass variables. Recent versions of Sass require that you to use interpolation when including Sass variables to maintain maximal CSS compatibility.

$n: 255;
--color: $n, $n, $n; // LINT
$n: 255;
--color: #{$n}, #{$n}, #{$n}; // OK

See this blog post for more details: http://sass.logdown.com/posts/809572

@gopherkhan gopherkhan changed the title Title: Add a lint rule for suspicious variable interpolation Add a lint rule for suspicious variable interpolation Jan 11, 2019
@nex3
Copy link

nex3 commented Jan 12, 2019

This could theoretically be meaningful CSS, since some JavaScript framework could parse the variable names out from the custom properties at runtime, but I think it's worth adding this lint anyway since I'm pretty sure no real JavaScript libraries do so.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants