Recall & Review
beginner
What does it mean to extend default theme values in Tailwind CSS?
Extending default theme values means adding new styles or values to Tailwind's built-in design system without removing or replacing the original ones. It helps keep the default styles while customizing your project.
Click to reveal answer
beginner
How do you extend colors in Tailwind's theme configuration?
You add new colors inside the
extend section of the theme in tailwind.config.js. For example:<br>{
theme: {
extend: {
colors: {
brandBlue: '#1DA1F2'
}
}
}
}Click to reveal answer
intermediate
Why should you use
extend instead of replacing the whole theme section?Using
extend keeps all the default Tailwind styles intact and only adds your custom values. Replacing the whole theme section removes all defaults, which can break your design or require redefining everything.Click to reveal answer
beginner
What is the file name where you extend Tailwind's default theme values?
The file is
tailwind.config.js. This is where you configure and extend Tailwind's default theme settings for your project.Click to reveal answer
intermediate
Give an example of extending font sizes in Tailwind CSS.
Inside
tailwind.config.js, add:<br>{
theme: {
extend: {
fontSize: {
'xxs': '0.65rem'
}
}
}
}<br>This adds a new font size called xxs without removing the default sizes.Click to reveal answer
Where do you add custom values to extend Tailwind's default theme?
✗ Incorrect
Custom values should be added inside the
extend key to keep default styles and add new ones.What happens if you replace the entire
theme object instead of extending it?✗ Incorrect
Replacing the whole
theme removes default styles, so only your custom styles remain.Which file controls Tailwind's theme extensions?
✗ Incorrect
The
tailwind.config.js file is where you configure and extend Tailwind's theme.How would you add a new color named 'brandGreen' with hex '#00FF00'?
✗ Incorrect
You add new colors inside the
extend section of theme in tailwind.config.js.Why is extending theme values helpful?
✗ Incorrect
Extending allows adding custom styles while keeping all default Tailwind utilities available.
Explain how to extend the default theme values in Tailwind CSS and why it is important.
Think about adding new styles without losing what Tailwind already provides.
You got /4 concepts.
Describe the difference between replacing the theme object and extending it in Tailwind CSS.
Consider what happens to default styles in each case.
You got /4 concepts.