Skip to content

Add CSS variable example - #8

Draft
jfhr wants to merge 1 commit into
mainfrom
css-variable-example
Draft

Add CSS variable example#8
jfhr wants to merge 1 commit into
mainfrom
css-variable-example

Conversation

@jfhr

@jfhr jfhr commented Jun 9, 2023

Copy link
Copy Markdown
Owner

This example show how to use CSS variables that change when a different theme is selected.

CSS variables can change at runtime, unlike Bootstrap variables, which are determined at compile time.

In this example, src/styles.sass uses a CSS variable called --primary. The variable is given a different value in each theme stylesheet:

  • src/default.sass
  • src/solar.sass
  • src/vapor.scss
  • src/united.scss

Selecting a different theme will load the associated stylesheet, which will update the value of the CSS variable.

@jfhr jfhr self-assigned this Jun 9, 2023
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.

1 participant