Skip to content

Commit

Permalink
Fix <alpha-value> Tailwind placeholder
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).
  • Loading branch information
StudioRectangle authored Jul 8, 2023
1 parent 40ad9af commit bf8b84f
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 bf8b84f

Please sign in to comment.