-
-
Notifications
You must be signed in to change notification settings - Fork 76
case insensitive processing and consistent cloning #502
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
case insensitive processing and consistent cloning #502
Conversation
Starting to wonder if I jinxed it when I decided that relaxing the PostCSS version constraint didn't warrant a re-release of all plugins. Probably not coincidental that I find a new error class that affects most plugins days later :D |
…sible-wolverine-14524204cc
"plugins/postcss-rebeccapurple": | ||
- plugins/postcss-rebeccapurple/** | ||
- experimental/postcss-rebeccapurple/** | ||
"plugins/postcss-color-rebeccapurple": |
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.
Nice catch!
return; | ||
} | ||
|
||
// value of the :dir pseudo-class | ||
const value = node.nodes.toString(); | ||
const value = node.nodes.toString().toLowerCase(); |
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 is later concatenated below which means this won't preserve developer casing. Is this something we should do?
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.
Good catch! I was indeed trying to avoid changing things and only using lower cased values in conditionals.
I will update this 🎉
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.
Coincidentally this was actually more correct imo.
[dir="RTL"]
or[dir="rtl"]
is not the same.- we generate
:not([dir="<inverse>"])
.
I think it is best to allow upper case in :dir
and keywords but only output lowercase.
@@ -11,16 +12,33 @@ function creator(opts) { | |||
postcssPlugin: 'postcss-gap-properties', | |||
// walk decl shorthand gap, column-gap, or row-gap declaration | |||
Declaration(decl) { | |||
if (gapPropertyRegExp.test(decl.prop) && decl.parent.some(isDisplayGrid)) { |
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.
❤️
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 is really impressive! Thanks for bringing up this so it's even closer to spec. I've left one minor comment but feel free to ignore it if it's fine.
The reasoning was that I'm OK with producing lowercase code but this seemed like transforming the user's code
Uh oh!
There was an error while loading. Please reload this page.