From ea427ad274bfaa24b2ecc1f18bbafaafc7c91652 Mon Sep 17 00:00:00 2001 From: Studio Rectangle <138102850+StudioRectangle@users.noreply.github.com> Date: Mon, 10 Jul 2023 21:29:12 +0200 Subject: [PATCH] fix Tailwind placeholder (#2369) Replace the special 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 / ). 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** --- .../@roots/bud-tailwindcss-theme-json/src/tailwind/palette.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/@roots/bud-tailwindcss-theme-json/src/tailwind/palette.ts b/sources/@roots/bud-tailwindcss-theme-json/src/tailwind/palette.ts index 5b5dbb3026..0ad84dd7f7 100644 --- a/sources/@roots/bud-tailwindcss-theme-json/src/tailwind/palette.ts +++ b/sources/@roots/bud-tailwindcss-theme-json/src/tailwind/palette.ts @@ -34,7 +34,7 @@ export interface transformEntry { (slug: Array, color: string): WordPressColors[any] } export const transformEntry: transformEntry = (slug, color) => ({ - color: color.toLowerCase(), + color: color.toLowerCase().replace(//g, `1`), name: name(slug), slug: slug.join(`-`).toLowerCase(), })