medium10 pts · first answer countsdesign-systemsthemingdesign-to-code
Switching themes in CSS
What happens to .card when JavaScript sets data-theme="dark" on the html element?
:root { --bg-surface: #FFFFFF; }
[data-theme="dark"] { --bg-surface: #1C1C1E; }
.card { background: var(--bg-surface); }Discussion 0
Join free to post in the discussion.
Related questions
- Editing a main componentUI/UX Designer
- What detaching an instance doesUI/UX Designer
- Showing or hiding an icon in a componentUI/UX Designer
- Editable button label in the panelUI/UX Designer
- Choosing which icon a button showsUI/UX Designer
- Hug contents in auto layoutUI/UX Designer
- Atomic design levelsUI/UX Designer
- Slashes in component namesUI/UX Designer