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: add getThemingClass util #241

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

huyenltnguyen
Copy link
Member

Checklist:

In order to enable theming, the consumers need to add the theming class (either light-palette or dark-palette) to their body element. This is because some color tokens are defined based on those classes:

I don't really like that the consumer has to spell out the class name exactly as it's easy to make typos, and this also implies that the consumer needs to know the implementation detail (which class names we have).

So, I'm creating a util function to allow the consumers to control the theme while abstracting away the implementation detail.


Ref:

@huyenltnguyen huyenltnguyen marked this pull request as ready for review July 19, 2024 18:03
@huyenltnguyen huyenltnguyen requested review from a team as code owners July 19, 2024 18:03
@ahmaxed ahmaxed merged commit 4142d56 into freeCodeCamp:main Sep 10, 2024
7 checks passed
@huyenltnguyen huyenltnguyen deleted the feat/get-theme branch September 10, 2024 18:18
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.

2 participants