Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 19th and 20th questions replaced (freeCodeCamp#58067)
Browse files Browse the repository at this point in the history
Co-authored-by: Ilenia <26656284+ilenia-magoni@users.noreply.github.com>
Co-authored-by: Sem Bauke <sem@freecodecamp.org>
Co-authored-by: Krzysztof G. <60067306+gikf@users.noreply.github.com>
4 people authored Jan 25, 2025
1 parent 0c66f2c commit 1436d89
Showing 1 changed file with 10 additions and 42 deletions.
Original file line number Diff line number Diff line change
@@ -413,91 +413,59 @@ Which color model includes the `hue` component?

#### --text--

Which of the following is the correct syntax to create a CSS variable with a fallback value?
Which color function also allows you to set the opacity of the color?

#### --distractors--

```css
.element {
color: var(--main-color; red);
}
hsl(0, 20%, 30%, 50%)
```

---

```css
.element {
color: var(--main-color);
}
rgb(20, 30, 80, 0.5)
```

---

```css
.element {
color: var(--main-color: red);
}
rgba(20, 30, 80)
```

#### --answer--

```css
.element {
color: var(--main-color, red);
}
hsla(0, 20%, 30%, 50%)
```

### --question--

#### --text--

How can you use CSS variables to dynamically change the color of multiple elements?
Which of the following is the correct way to give an element a top-to-bottom red-to-blue gradient background?

#### --distractors--

```css
:root {
primary-color: blue;
}

.element1, .element2 {
color: --primary-color;
}
background: radial-gradient(red, blue)
```

---

```css
body {
--color: blue;
}

.element1, .element2 {
color: var(color);
}
background: radial-gradient(blue, red)
```

---

```css
:root {
primary: blue;
}

.element1, .element2 {
color: var(--primary);
}
background: linear-gradient(blue, red)
```

#### --answer--

```css
:root {
--primary-color: blue;
}

.element1, .element2 {
color: var(--primary-color);
}
background: linear-gradient(red, blue)
```

0 comments on commit 1436d89

Please sign in to comment.