-
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
Use :not(#\20)
stackable root - more specificity
#9
Conversation
> Consider use :not(#\20), :not(.\20) and :not(\20) > Rationale: \20 is a css escape for U+0020 Space, and neither classname, nor id, nor tagname can contain a space > — https://twitter.com/subzey/status/829050478721896448 Fix MadLittleMods#8
3c27893
to
b2c9bb3
Compare
return opts.stackableRoot.repeat(opts.repeat) + ' ' + selector; | ||
}); | ||
|
||
if(opts.overrideIds) { | ||
if( | ||
// If an id is in there somewhere | ||
(/#/).test(rule.selector) || | ||
(/#(?!\\)/).test(rule.selector) || |
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.
this thing was needed to be changed, because otherwise original regexp catches #
in :not(#\20)
and doesnt add !important
so, @MadLittleMods what do you think? |
@MadLittleMods is something wrong? |
@@ -16,7 +16,8 @@ | |||
}, | |||
"main": "index.js", | |||
"scripts": { | |||
"test": "mocha" | |||
"test": "mocha", | |||
"tdd": "mocha --watch" |
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.
We could use npm test -- --watch
instead
Sorry for the delay @iamstarkov 😢 Reviewing now |
:not(#\20)
stackable root - more specificity
if( | ||
selector === 'html' || | ||
selector === ':root' || | ||
selector === ':not(#\\20)' || |
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.
We should put this back to :root
as it is root level thing . :not(#\\20)
would be covered by the last case selector === opts.stackableRoot
[idea]: https://twitter.com/subzey/status/829050478721896448 | ||
[@subzey]: https://github.com/subzey | ||
[@iamstarkov]: https://github.com/iamstarkov | ||
[#9]: https://github.com/MadLittleMods/postcss-increase-specificity/pull/9 |
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.
I prefer inline linking vs references. Seems fine to keep it for now as it will be changed in the release.
@iamstarkov I'll take care of the remaining points (no need for a further fix commit). |
Merged via #10 Thanks @iamstarkov 💓 😺 Appreciate the ping again to take a look. This was sitting in my inbox for too long. |
@MadLittleMods thank you |
Fix #8
Here I am with a PR 😄
Use
:not(#\20)
stackable root to get more specificity.