Skip to content

Commit

Permalink
fix <alpha-value> Tailwind placeholder (#2369)
Browse files Browse the repository at this point in the history
Replace the special <alpha-value> placeholder. Tailwind CSS uses this placeholder to inject the alpha value when using an opacity modifier. The placeholder has been replaced with the default value of 1. Currently, the color value is copied as is, leading to broken colors such as --wp-preset-color--primary: rgba(0 0 0 / <alpha-value>). This fix ensures that the value is replaced with --wp-preset-color--primary: rgba(0 0 0 / 1).



## Type of change

**PATCH: backwards compatible change**
  • Loading branch information
StudioRectangle authored Jul 10, 2023
1 parent 40ad9af commit ea427ad
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface transformEntry {
(slug: Array<string>, color: string): WordPressColors[any]
}
export const transformEntry: transformEntry = (slug, color) => ({
color: color.toLowerCase(),
color: color.toLowerCase().replace(/<alpha-value>/g, `1`),
name: name(slug),
slug: slug.join(`-`).toLowerCase(),
})
Expand Down

0 comments on commit ea427ad

Please sign in to comment.