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

Use CSS variables for theme system #671

Open
mateusfg7 opened this issue Feb 11, 2024 · 0 comments
Open

Use CSS variables for theme system #671

mateusfg7 opened this issue Feb 11, 2024 · 0 comments
Assignees
Labels
feat New feature or request lint/refactor Lint or refact code for facility the maintenance

Comments

@mateusfg7
Copy link
Owner

Describe new feat

Replace theme system with css variables, something like:

global.css

@layer base {
  :root {
    --primary: #345678;
    --primary-foreground: #652345;
  }
  .train-rain {
    --primary: #236587;
    --primary-foreground: #235687;
  }
  .waterfall {
    --primary: #236587;
    --primary-foreground: #235687;
  }
}

tailwind.config.js

// code ...
extend: {
  colors: {
    primary: {
      DEFAULT: "var(--primary)",
      foreground: "var(--primary-foreground)"
    }
  }
}

some-component.tsx

<span class="text-primary-foreground">Some Text</span>

And remove all the bunch of tailwind variants for each component. Use a centralized class and variables theme system.

Referencies

No response

@mateusfg7 mateusfg7 added feat New feature or request lint/refactor Lint or refact code for facility the maintenance labels Feb 11, 2024
@mateusfg7 mateusfg7 self-assigned this Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request lint/refactor Lint or refact code for facility the maintenance
Projects
None yet
Development

No branches or pull requests

1 participant