Skip to content

Import variables for specific themes in to another #18496

Answered by Taib-Rabah
amocarski asked this question in Help
Discussion options

You must be logged in to vote

You can achieve this like this:

:root {
  --background: white;
  --foreground: black;
}

/* Both dark and custom themes share the same base variables */
.dark,
.new-custom {
  --background: black;
  --foreground: white;
}

/* Then override specific variables for your custom theme */
.new-custom {
  --foreground: blue; /* Only this value changes while keeping others */
}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@amocarski
Comment options

Answer selected by amocarski
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants