From 98a8a1a4cb9b2268252945a00355bd8592ff687f Mon Sep 17 00:00:00 2001 From: Matt Bearman Date: Thu, 11 Jul 2024 10:39:49 +0100 Subject: [PATCH] feat: Update class safelist for darkmode support --- src/index.js | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 5f4610c..9de6bdc 100644 --- a/src/index.js +++ b/src/index.js @@ -42,16 +42,54 @@ const plugin = withOptions( return { safelist: [ + // For the Badge component "bg-gray-100", + "dark:bg-grayCool-800", + + // 50 is for the Badge component + // 500 is for the Dot component { pattern: /^bg-\w+-(50|500)$/, }, + + // 400 is for the Dot component + // 900 is for the Badge component + { + pattern: /^bg-\w+-(400|900)$/, + variants: ["dark"], + }, + + // For the Badge component + { + pattern: /^border-\w+-600$/, + }, + + // For the Badge component { - pattern: /^border-\w+-(600)$/, + pattern: /^border-\w+-300$/, + variants: ["dark"], }, + + // 600 is for the Paragraph component + // 700 is for the Badge component { pattern: /^text-\w+-(600|700)$/, }, + + // For the Paragraph component + { + pattern: /^text-\w+-(300)$/, + variants: ["dark"], + }, + + // For the Badge component + "dark:text-grayCool-200", + + // For the Badge component + { + pattern: /^text-\w+-100$/, + variants: ["dark"], + }, ], theme: { colors: palette,