-
Notifications
You must be signed in to change notification settings - Fork 16
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
Feat/add comment exclusions #20
base: master
Are you sure you want to change the base?
Feat/add comment exclusions #20
Conversation
stab at #17 |
const commentStart = 'no important-start'; | ||
const commentEnd = 'no important-end'; | ||
|
||
if(node.text === commentStart) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have to worry about comparing whitespace here? Perhaps we need to node.text.trim()
?
const commentStart = 'no important-start'; | ||
const commentEnd = 'no important-end'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have to
const commentStart = 'no important-start'; | |
const commentEnd = 'no important-end'; | |
const enableComment = 'postcss-increase-specificity enable'; | |
const disableComment = 'postcss-increase-specificity disable'; |
// Avoid adding additional selectors (stackableRoot) to descendant rules of @keyframe {} | ||
// i.e. `from`, `to`, or `{number}%` | ||
var isInsideKeyframes = rule.parent.type === 'atrule' && rule.parent.name === 'keyframes'; | ||
let isExcluded = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let isExcluded = false; | |
let isDisabled = false; |
@@ -52,6 +52,10 @@ describe('postcss-increase-specificity', function() { | |||
return testPlugin('./test/fixtures/classes.css', './test/fixtures/classes.expected.css'); | |||
}); | |||
|
|||
it('should handle exclusion commments', function () { | |||
return testPlugin('./test/fixtures/comments-to-exclude.css', './test/fixtures/comments-to-exclude.expected.css'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disable-enable-with-comments.css
@@ -55,14 +55,33 @@ module.exports = postcss.plugin('postcss-increase-specificity', function(options | |||
var opts = objectAssign({}, defaults, options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay @mihaisavezi 🙇
This looks like a great v1 we can merge of this feature 👍
My comments are mainly framing everything in terms of disable
/enable
instead of exclude
First stab at handling comments exclusions, see #17