Challenge - 5 Problems
Critical CSS Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
What is the main purpose of extracting critical CSS in a Tailwind CSS project?
Why do developers extract critical CSS when using Tailwind CSS in their web projects?
Attempts:
2 left
💡 Hint
Think about what 'critical' means in the context of page loading.
✗ Incorrect
Extracting critical CSS means isolating the styles needed to render the visible part of the page first. This helps the browser show content faster, improving user experience.
📝 Syntax
intermediate2:00remaining
Which Tailwind CSS configuration snippet correctly enables purging unused styles for production?
Select the correct Tailwind CSS config code that removes unused CSS classes during production builds.
Tailwind
module.exports = {
content: [
'./src/**/*.{html,js,jsx,ts,tsx}',
],
theme: {
extend: {},
},
plugins: [],
}Attempts:
2 left
💡 Hint
Look for the modern property name used to specify files for purging.
✗ Incorrect
In Tailwind CSS v3+, the content key replaces purge to specify files to scan for used classes. This enables removing unused styles.
❓ rendering
advanced2:00remaining
What will be the visible effect of extracting critical CSS on a slow network?
Imagine a webpage styled with Tailwind CSS where critical CSS is extracted and inlined in the HTML. What will the user see first on a slow network?
Attempts:
2 left
💡 Hint
Think about what 'critical CSS' means for initial rendering.
✗ Incorrect
Inlining critical CSS means the browser can style the visible part of the page immediately, improving perceived load speed on slow connections.
❓ selector
advanced2:00remaining
Which CSS selector targets only the critical CSS classes extracted for above-the-fold content?
Given that critical CSS classes are prefixed with
critical-, which selector matches only those classes?Attempts:
2 left
💡 Hint
Look for a selector that matches class names starting with a specific string.
✗ Incorrect
The attribute selector [class^='critical-'] matches elements whose class attribute starts exactly with 'critical-'.
❓ accessibility
expert3:00remaining
How does extracting critical CSS affect accessibility during page load?
When critical CSS is extracted and inlined, what accessibility benefit does this provide to users relying on screen readers or keyboard navigation?
Attempts:
2 left
💡 Hint
Think about how faster visual rendering helps assistive technologies.
✗ Incorrect
Critical CSS makes the page visually complete faster, so screen readers and keyboard users get a meaningful layout and content structure sooner.