0
0
Tailwindmarkup~5 mins

Extending default theme values in Tailwind - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AIn the <code>package.json</code> file
BDirectly inside the <code>theme</code> key without <code>extend</code>
CIn the HTML file using <code>&lt;style&gt;</code> tags
DInside the <code>extend</code> key in <code>theme</code> of <code>tailwind.config.js</code>
What happens if you replace the entire theme object instead of extending it?
AYou remove all default styles and only use your custom ones
BYou keep all default styles and add new ones
CTailwind automatically merges defaults for you
DIt causes an error and stops compiling
Which file controls Tailwind's theme extensions?
Aindex.html
Btailwind.config.js
Cstyles.css
Dpackage.json
How would you add a new color named 'brandGreen' with hex '#00FF00'?
AAdd <code>brandGreen: '#00FF00'</code> in your CSS file
BAdd <code>brandGreen: '#00FF00'</code> directly in <code>theme</code>
CAdd <code>colors: { brandGreen: '#00FF00' }</code> inside <code>extend</code> in <code>theme</code>
DAdd <code>brandGreen: '#00FF00'</code> in your HTML file
Why is extending theme values helpful?
AIt lets you customize styles without losing default Tailwind utilities
BIt disables all default styles
CIt makes Tailwind slower
DIt removes unused CSS automatically
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.