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

Can I apply multiple themes? #73

Open
YusukeSano opened this issue Dec 30, 2021 · 1 comment
Open

Can I apply multiple themes? #73

YusukeSano opened this issue Dec 30, 2021 · 1 comment
Labels
enhancement New feature or request v1 Planned for v1

Comments

@YusukeSano
Copy link

Hello, Thanks for the nice library.

I want to use this library to apply multiple themes of different nature.
In the example below, I am trying to apply a cross between two different color themes and two different font themes.

The current method applies all CSS variables to each theme:

:root {
  /* default theme (light small) */
  --background: white;
  --foreground: black;
  --fontsize: 16px;
}

:[data-theme='light large'] {
  --background: white;
  --foreground: black;
  --fontsize: 32px;
}

[data-theme='dark small'] {
  --background: black;
  --foreground: white;
  --fontsize: 16px;
}

[data-theme='dark large'] {
  --background: black;
  --foreground: white;
  --fontsize: 32px;
}

However, with this method, the amount of description increases in proportion to the number of themes as the number of CSS properties increases.
My goal is to compose CSS using only the properties of each theme.

Like so:

:root {
  /* default theme (light small) */
  --background: white;
  --foreground: black;
  --fontsize: 16px;
}

[data-theme*='light'] {
  --background: white;
  --foreground: black;
}

[data-theme*='dark'] {
  --background: black;
  --foreground: white;
}

[data-theme*='small'] {
  --fontsize: 16px;
}

[data-theme*='large'] {
  --fontsize: 32px;
}

Are there any good methods for that?
Pardon my broken English.

@pacocoursey pacocoursey added the enhancement New feature or request label Feb 1, 2022
@pacocoursey pacocoursey added the v1 Planned for v1 label Feb 20, 2022
@pacocoursey
Copy link
Owner

This is something I'd like to support in v1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v1 Planned for v1
Projects
None yet
Development

No branches or pull requests

2 participants