Last active
August 29, 2015 14:16
-
-
Save johno/338a39c14f75a0da4301 to your computer and use it in GitHub Desktop.
Proposed immutable.css functionality/API.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.u-i-will-be-opened-twice { | |
color: yellow; | |
} | |
.u-actually-immutable-selector { | |
content: 'I am not being reopened'; | |
} | |
.awesome { | |
font-variant: small-caps; /* Raises linting error (opened vendor.css selector) */ | |
} | |
.u-i-will-be-opened-twice { | |
background-color: red; /* Raises linting error (re-opened a util selector) */ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
immutableCss.lint('vendor.css', 'app.css', { immutablePrefixes: ['.u-'] }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.awesome { | |
color: green; | |
} |
I was thinking that immutablePrefixes
would be in addition to ensuring style altering isn't occurring between files. I will update this gist to make it a bit more clear.
Okay, so now .awesome
doesn't have a .u-
prefix but would still raise an error. I'm thinking that there are particular prefixes, in addition to ensuring vendor CSS (bootstrap/basscss/etc), that we want to make sure aren't reopened.
Scaffolded out a project and added you as a collaborator, @jxnblk. If you want to move it under your name on Github let me know, I'm happy to transfer it over to you.
Okay, I think this makes more sense now...
You're too fast, i'll move convo over to your repo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So if I understand correctly,
immutablePrefixes
would just scope the selectors that it's checking against with a prefix?To me, altering any style from another file is bad practice. Also thinking about how this would work with Bootstrap.