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.
module.exports = {
content: [
'./src/**/*.{html,js,jsx,ts,tsx}',
],
theme: {
extend: {},
},
plugins: [],
}In Tailwind CSS v3+, the content key replaces purge to specify files to scan for used classes. This enables removing unused styles.
Inlining critical CSS means the browser can style the visible part of the page immediately, improving perceived load speed on slow connections.
critical-, which selector matches only those classes?The attribute selector [class^='critical-'] matches elements whose class attribute starts exactly with 'critical-'.
Critical CSS makes the page visually complete faster, so screen readers and keyboard users get a meaningful layout and content structure sooner.
