Skip to content
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

feat: Update class safelist for darkmode support #17

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down