-
-
Notifications
You must be signed in to change notification settings - Fork 75
only produce valid fallback values #1187
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
only produce valid fallback values #1187
Conversation
@@ -212,7 +212,7 @@ h1.test-custom-selectors:not(.does-not-exist), h2.test-custom-selectors:not(.doe | |||
} | |||
|
|||
.test-color-functional-notation { | |||
color: rgba(178, 34, 34, 0.5); | |||
color: rgba(179, 34, 34, 0.5); |
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 was always wrong, the color package is much more correct than what existed in the functional notation plugin.
@@ -1,6 +1,6 @@ | |||
import type { Node, AtRule } from 'postcss'; | |||
|
|||
const supportsCheck = /(\(color: rgb(a?)\(0 0 0 \/ 0)|(\(color: hsl(a?)\(0 0% 0% \/ 0)/i; | |||
export const rgb_hsl_functionRegex = /(?:rgb|hsl)a?\(/i; |
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.
Better to avoid hard coding to much of the supports conditions.
A simplistic check is fine here.
@@ -99,7 +103,7 @@ const postcssPlugin: PluginCreator<pluginOptions> = (opts?: pluginOptions) => { | |||
|
|||
if (options.enableProgressiveCustomProperties && options.preserve) { | |||
return { | |||
postcssPlugin: 'postcss-color-function', | |||
postcssPlugin: 'postcss-color-functional-notation', |
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.
Some unfortunate copy/paste in the past.
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.
LGTM! Great work!
fixes : #1185