mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-26 22:01:30 -04:00
fix(curriculum): replace ambiguous CSS variables quiz question (#64475)
Co-authored-by: majestic-owl448 <26656284+majestic-owl448@users.noreply.github.com>
This commit is contained in:
@@ -731,7 +731,13 @@ It assigns a default value for the property if none is set.
|
||||
|
||||
#### --text--
|
||||
|
||||
In the following CSS, how does the custom property `--bg-color` behave?
|
||||
Consider the following HTML and CSS. What background color will be applied to the `.card` element?
|
||||
|
||||
```html
|
||||
<div class="dark-theme">
|
||||
<div class="card">Content</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
```css
|
||||
:root {
|
||||
@@ -741,23 +747,27 @@ In the following CSS, how does the custom property `--bg-color` behave?
|
||||
.dark-theme {
|
||||
--bg-color: #333;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--bg-color);
|
||||
}
|
||||
```
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Overrides the root value globally.
|
||||
`white`
|
||||
|
||||
---
|
||||
|
||||
Applies to all elements by default.
|
||||
`transparent`
|
||||
|
||||
---
|
||||
|
||||
Is inherited automatically by all children.
|
||||
`inherit`
|
||||
|
||||
#### --answer--
|
||||
|
||||
Only applies within `.dark-theme` scope.
|
||||
`#333`
|
||||
|
||||
### --question--
|
||||
|
||||
|
||||
Reference in New Issue
Block a user