Skip to content

Carbon multiple custom themes help #12839

Answered by tay1orjones
DenisCor asked this question in Help
Discussion options

You must be logged in to vote

Interesting question! I don't think we've directly thought about the use case of that many themes being emitted.

One option that might work in this case is to define each theme and then emit each one using the theme() mixin. This way you can scope each theme to a selector you can switch out at runtime.

@use '@carbon/react';

// Full token list: https://github.com/carbon-design-system/carbon/blob/main/packages/themes/docs/sass.md#api
$defaultTheme0: (background: rebeccapurple, background-active: green, ... );
$anotherTheme1: (background: rebeccapurple, background-active: yellow, ... );
$anotherTheme2: (background: rebeccapurple, background-active: red, ... );
$anotherTheme3: (background: r…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@DenisCor
Comment options

@tay1orjones
Comment options

Answer selected by tay1orjones
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants