CSS variables

Hard
2
23.8% Acceptance

Challenges Information

Create a CSS variable

Ensure you define a CSS variable named --bg-color at the :root level. This variable should be set to the color value #eeeeee.

Define a Text Color

At the :root level, create a CSS variable named --text-color. Set its value to white.

Add an Interactive Button

On your page, insert a button. Make sure this button has the id toggle-variables.

Toggle Variables with a Button

Here's a task that combines JavaScript with CSS! When the button with id toggle-variables is clicked, the --bg-color variable should change to white, and the --text-color variable should switch to #eeeeee.