Created
July 16, 2022 11:08
-
-
Save lior-amsalem/418265bcd5b72a2bf9eedb65b9ae3eda to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body[data-theme="light"] { | |
--app-background-color-200: #272727; | |
/* we can apply more css selectors colors here */ | |
} | |
body[data-theme="dark"] { | |
--app-background-color-200: #787878; | |
/* we can apply more css selectors colors here */ | |
} | |
/* apply css vars to a specific body data attribute means that we don’t have to refer to the theme within our css code. Like example below: */ | |
.app-wrapper { | |
/* here we use app background color 200 once, but the color will change base on what we define on the body data attribute */ | |
background-color: var(--app-background-color-200); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment