0
0
Astroframework~5 mins

Tailwind CSS integration in Astro - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is Tailwind CSS?
Tailwind CSS is a utility-first CSS framework that lets you style your web pages using small, reusable classes instead of writing custom CSS.
Click to reveal answer
beginner
How do you add Tailwind CSS to an Astro project?
You install Tailwind CSS via npm, create a tailwind.config.cjs file, add Tailwind directives to your CSS, and configure Astro to use PostCSS for processing.
Click to reveal answer
intermediate
What is the purpose of the @tailwind base;, @tailwind components;, and @tailwind utilities; directives?

These directives tell Tailwind to inject its base styles, component classes, and utility classes into your CSS file.

Click to reveal answer
intermediate
Why is it important to configure the content array in tailwind.config.cjs?
The <code>content</code> array tells Tailwind which files to scan for class names. This helps Tailwind remove unused styles and keep the CSS file small.
Click to reveal answer
beginner
How does Tailwind CSS support responsive design?
Tailwind uses special prefixes like sm:, md:, lg: to apply styles at different screen sizes, making it easy to build responsive layouts.
Click to reveal answer
Which command installs Tailwind CSS in an Astro project?
Anpm install -D tailwindcss postcss autoprefixer
Bnpm install astro-tailwind
Cnpm install tailwind-astro
Dnpm install -g tailwindcss
Where do you add Tailwind's CSS directives in an Astro project?
AIn a global CSS file imported in the project
BDirectly inside Astro component files
CIn the tailwind.config.cjs file
DIn the package.json file
What does the content field in tailwind.config.cjs specify?
ABrowser compatibility settings
BFiles to scan for Tailwind classes
CTailwind version to use
DOutput CSS file location
Which prefix applies styles for medium screen sizes in Tailwind?
Asm:
Bxs:
Clg:
Dmd:
Why use Tailwind CSS in Astro projects?
ATo replace JavaScript logic
BTo write complex CSS animations only
CTo quickly style components with utility classes
DTo manage backend data
Explain the steps to integrate Tailwind CSS into an Astro project.
Think about installation, configuration, and usage in Astro.
You got /5 concepts.
    Describe how Tailwind CSS helps with responsive design in Astro projects.
    Focus on how Tailwind classes change with screen sizes.
    You got /4 concepts.