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

Rename Tailwind colors to semantic names and switch to CSS variables #4304

Open
zackkrida opened this issue May 10, 2024 · 1 comment
Open
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend ⛔ status: blocked Blocked & therefore, not ready for work

Comments

@zackkrida
Copy link
Member

This issue is part of the Dark Mode project: #3592. Please see the implementation plan for additional detail and context.

Description

Using the colors mapped in this issue, rename all of the colors in the Tailwind configuration file and the tailwind classes used in our frontend components to use new, semantic names.

I strongly reccommend using find-and-replace with scripts like ripgrep or tools like the find and replace built into VS Code (which uses ripgrep internally!).

This PR will not result in any visual changes but will have a large diff. Provided all tests pass it will be safe to merge.

This PR should also move the colors from being hardcoded in the Tailwind configuration to being CSS variables. These colors should be nested under a :root,:is(.light-mode *) {} CSS selector.

Here is an example with the "yellow" color:

Before (tailwind.config.ts)

{
  theme: {
    colors: {
      yellow: "#ffe033"
    }
  }
}

After

Tailwind.config.ts

{
  theme: {
    colors: {
      primary: var(--color-primary); // previously "yellow"
    }
  }
}

tailwind.css

@layer base {
  :root,
  :is(.light-mode *) {
    --color-primary: #ffe033 /* previously "yellow" */
  }
}
@zackkrida zackkrida added 🟨 priority: medium Not blocking but should be addressed soon ✨ goal: improvement Improvement to an existing user-facing feature 💻 aspect: code Concerns the software code in the repository 🧱 stack: frontend Related to the Nuxt frontend ⛔ status: blocked Blocked & therefore, not ready for work labels May 10, 2024
@zackkrida
Copy link
Member Author

This issue is blocked until we finalize and clarify names in #4268

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend ⛔ status: blocked Blocked & therefore, not ready for work
Projects
Status: ⛔ Blocked
Development

No branches or pull requests

1 participant