0
0
Tailwindmarkup~20 mins

JIT mode and on-demand generation in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Tailwind JIT Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does Tailwind JIT mode generate styles?
Tailwind CSS uses JIT mode to create styles. What best describes how it works?
AIt generates styles only for the classes you use in your files as you write them.
BIt generates all possible styles upfront before you start coding.
CIt downloads styles from a CDN when the page loads.
DIt uses inline styles instead of CSS classes.
Attempts:
2 left
💡 Hint
Think about how Tailwind avoids creating unused CSS.
📝 Syntax
intermediate
2:00remaining
Which Tailwind config enables JIT mode?
You want to enable JIT mode in Tailwind CSS. Which config snippet is correct?
Amodule.exports = { mode: 'jit', content: ['./src/**/*.{html,js}'] }
Bmodule.exports = { jit: true, content: ['./src/**/*.{html,js}'] }
Cmodule.exports = { mode: 'on-demand', content: ['./src/**/*.{html,js}'] }
Dmodule.exports = { generate: 'jit', files: ['./src/**/*.{html,js}'] }
Attempts:
2 left
💡 Hint
Look for the correct property name and value to enable JIT.
rendering
advanced
2:00remaining
What is the rendered output of this Tailwind JIT example?
Given this HTML snippet using Tailwind classes with JIT mode enabled, what CSS color will the text have?
Tailwind
<p class="text-red-500 hover:text-blue-700">Hello World</p>
AThe text is blue normally and turns red on hover.
BThe text is red normally and turns blue on hover.
CThe text is always black because hover classes are ignored.
DThe text color does not change because JIT mode disables hover styles.
Attempts:
2 left
💡 Hint
Think about how Tailwind generates hover styles on demand.
selector
advanced
2:00remaining
Which Tailwind class triggers JIT to generate a 3rem margin?
You want to add a margin of 3rem using Tailwind JIT. Which class name will generate this margin?
Am-24
Bm-3
Cm-6
Dm-12
Attempts:
2 left
💡 Hint
Tailwind spacing scale uses multiples of 0.25rem. Calculate 3rem in this scale.
accessibility
expert
3:00remaining
How does Tailwind JIT help maintain accessibility with dynamic classes?
When using Tailwind JIT with dynamic class names (e.g., text-${color}-500), what must you do to ensure accessibility and correct CSS generation?
AUse only static class names because JIT cannot handle dynamic classes at all.
BDisable JIT mode to allow dynamic classes to work automatically.
CList all possible dynamic class variants explicitly in the content config for JIT to generate them.
DWrite inline styles instead of classes to avoid JIT issues.
Attempts:
2 left
💡 Hint
Think about how JIT scans files to find classes.