Skip to content

refactor: map tailwind colors to css variables for dark mode support - #713

Open
matilde-sousa wants to merge 10 commits into
developfrom
refactor/color-system
Open

refactor: map tailwind colors to css variables for dark mode support#713
matilde-sousa wants to merge 10 commits into
developfrom
refactor/color-system

Conversation

@matilde-sousa

Copy link
Copy Markdown
Contributor

Closes #665

This pull request updates the application's color system to use new CSS custom properties for background, foreground, and accent colors, and refactors the body styles to use these variables instead of hardcoded Tailwind classes. This makes theming more consistent and maintainable across light and dark modes.

Color system and theming improvements:

  • Added new CSS custom properties (e.g., --color-background, --color-foreground, --color-accent, etc.) for both light mode (:root) and dark mode (.dark) to centralize color definitions and simplify future theme changes. [1] [2]
  • Updated the body styles to use the new bg-background and text-foreground utility classes, which reference the new color variables, replacing the previous hardcoded Tailwind color classes.

@netlify

netlify Bot commented Apr 14, 2026

Copy link
Copy Markdown

Deploy Preview for tts-fe-preview ready!

Name Link
🔨 Latest commit 1a3d091
🔍 Latest deploy log https://app.netlify.com/projects/tts-fe-preview/deploys/6a0a4696ca989f0008a9b7d5
😎 Deploy Preview https://deploy-preview-713--tts-fe-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown

🌐 Netlify Preview disponível:
https://69de9ebadecb4a000899bd75--tts-fe-preview.netlify.app

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a design-token based color system by defining theme CSS custom properties for light/dark mode and wiring Tailwind color utilities to those variables, so components can use consistent bg-*/text-* tokens across themes.

Changes:

  • Added 6 new CSS custom properties under :root and .dark for background/foreground/accent/border tokenization.
  • Extended Tailwind’s theme.colors to expose those CSS variables as utilities (bg-background, text-foreground, bg-accent, etc.).
  • Refactored the global body styling to use the new token utilities instead of hardcoded Tailwind colors.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
tailwind.config.js Adds Tailwind color entries mapped to new CSS variables so token utilities resolve via custom properties.
src/app.css Defines the new light/dark CSS variables and updates global body styling to use token utilities.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@NIAEFEUP NIAEFEUP deleted a comment from Copilot AI Apr 16, 2026

@PedroLunet PedroLunet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, just a quick correction! :)

Comment thread src/app.css Outdated
Comment thread src/app.css Outdated
@github-actions

Copy link
Copy Markdown

🌐 Netlify Preview disponível:
https://69f234436249660008633ce4--tts-fe-preview.netlify.app

@github-actions

Copy link
Copy Markdown

🌐 Netlify Preview disponível:
https://69f235048e1da80008452e3a--tts-fe-preview.netlify.app

@github-actions

Copy link
Copy Markdown

🌐 Netlify Preview disponível:
https://69f2362d0b5e70000849e598--tts-fe-preview.netlify.app

@PedroLunet PedroLunet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mariana2103 , @matilde-sousa and I upgraded this branch to tailwind 4 for it to be easier to solve the conflicts with develop.

I think its working fine but its hard to tell. This should have been a really easy PR but the migration on develop made it tricky.

Looks good to me but pls take close attention.

Comment thread src/app.css
--color-blueGray-950: #020617;

--color-background: var(--color-background);
--color-foreground: var(--color-foreground);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are self-referential, i am not that sure but i think CSS marks them all as invalid and they resolve to nothing. The actual values are defined in :root and .dark below.

outline:
'border border-slate-200 bg-white hover:bg-slate-100 hover:text-slate-900 dark:border-slate-800 dark:bg-slate-950 dark:hover:bg-slate-800 dark:hover:text-slate-50',
'outline-solid': 'bg-white border-2 border-black text-black hover:bg-gray-100',
secondary:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing dark mode classes, every other variant has dark: counterparts but this one uses hardcoded border-black text-black bg-white, which will look broken in dark mode.

- Keep tailwindcss 4.2.4, prettier 3.8.3, prettier-plugin-tailwindcss 0.8.0 from this branch
- Take postcss 8.5.14 from develop (newer)
- Keep outline-solid variant + CourseInfo type and courseInfo prop from both branches
@github-actions

Copy link
Copy Markdown

🌐 Netlify Preview disponível:
https://6a064398f86db60008993421--tts-fe-preview.netlify.app

@github-actions

Copy link
Copy Markdown

🌐 Netlify Preview disponível:
https://6a0a4696ca989f0008a9b7d5--tts-fe-preview.netlify.app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: define CSS design tokens and map Tailwind config to CSS variables

4 participants