Open
Conversation
Author
|
stab at #17 |
| const commentStart = 'no important-start'; | ||
| const commentEnd = 'no important-end'; | ||
|
|
||
| if(node.text === commentStart) { |
Owner
There was a problem hiding this comment.
Do we have to worry about comparing whitespace here? Perhaps we need to node.text.trim()?
Comment on lines
+63
to
+64
| const commentStart = 'no important-start'; | ||
| const commentEnd = 'no important-end'; |
Owner
There was a problem hiding this comment.
Do we have to
Suggested change
| 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; |
Owner
There was a problem hiding this comment.
Suggested change
| let isExcluded = false; | |
| let isDisabled = false; |
| }); | ||
|
|
||
| it('should handle exclusion commments', function () { | ||
| return testPlugin('./test/fixtures/comments-to-exclude.css', './test/fixtures/comments-to-exclude.expected.css'); |
Owner
There was a problem hiding this comment.
disable-enable-with-comments.css
| @@ -55,14 +55,33 @@ module.exports = postcss.plugin('postcss-increase-specificity', function(options | |||
| var opts = objectAssign({}, defaults, options); | |||
Owner
There was a problem hiding this comment.
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
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First stab at handling comments exclusions, see #17