[{"id":"tailwindadvanced-001","courseId":"tailwind-advanced","domain":"core-utilities","topic":"Breakpoint prefixes","prompt":"A paragraph has the classes text-left md:text-center. On which screen widths does the text end up centered?","hint":"Think about whether a prefixed class covers one band of widths or a threshold that holds from a point upward.","explain":"An unprefixed class applies at every screen size. A prefixed class is a threshold: it takes effect at one fixed width and stays in effect at every greater width unless a later rule changes it.","source":"https://tailwindcss.com/docs/responsive-design","interaction":{"type":"single"},"options":[{"id":"a","text":"It centers the text at the md breakpoint (48rem, 768px) and wider.","why":"md: applies from 48rem (768px) upward and stays applied at larger breakpoints, so the text is centered from that width up."},{"id":"b","text":"It centers the text on every screen size, phones included.","whyNot":"The unprefixed text-left applies everywhere; md:text-center only takes effect at its breakpoint and above."},{"id":"c","text":"It centers the text only on screens narrower than 768px.","whyNot":"Narrower screens get the unprefixed text-left, because the md: prefix doesn't apply below its breakpoint."},{"id":"d","text":"It centers the text only on screens exactly 768px wide.","whyNot":"A breakpoint prefix is a minimum width, not a single width, so it doesn't match just one size."}],"answer":"a","explanation":"Unprefixed utilities apply at all sizes. A prefix like md: applies from its minimum width (48rem, 768px) upward, overriding the base class at that width and wider.","concept":"Unprefixed utilities apply at all sizes. A prefix like md: applies from its minimum width (48rem, 768px) upward, overriding the base class at that width and wider.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["A prefix means 'at this breakpoint and above', not 'only on this screen size'."]},{"id":"tailwindadvanced-002","courseId":"tailwind-advanced","domain":"core-utilities","topic":"Dark mode default","prompt":"Out of the box, the dark: variant applies whenever a dark class is on an ancestor element of the element being styled.","hint":"Think about what the default dark variant listens for, and what it takes to change that.","explain":"A variant is a condition wrapped around a utility. Some conditions come from a browser media feature, and a stylesheet can redefine the selector that a variant matches with a custom variant declaration.","source":"https://tailwindcss.com/docs/dark-mode","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","whyNot":"The default trigger is the system color scheme, not a class; a class only works after the dark variant is redefined in the stylesheet."},{"id":"b","text":"False","why":"By default dark: uses the prefers-color-scheme media feature, so an ancestor class is ignored until you override the variant."}],"answer":"b","explanation":"The dark variant uses the prefers-color-scheme media feature by default. A class-based dark theme needs the dark variant overridden with a custom selector in the stylesheet.","concept":"The dark variant uses the prefers-color-scheme media feature by default. A class-based dark theme needs the dark variant overridden with a custom selector in the stylesheet.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["A dark class on html only works after the dark variant is redefined."]},{"id":"tailwindadvanced-003","courseId":"tailwind-advanced","domain":"core-utilities","topic":"peer marker placement","prompt":"A form has a required input with the class peer, followed by an error paragraph that should show only while that input is invalid. Which markup does this?","hint":"Consider which element must carry the marker, and where it must sit relative to the element that reacts.","explain":"CSS selectors can reach an element that comes later in the markup, but never one that comes earlier. A variant that reads another element's state is built on that reach.","source":"https://tailwindcss.com/docs/hover-focus-and-other-states","interaction":{"type":"single"},"options":[{"id":"a","text":"<input class='peer'> then <p class='hidden peer-invalid:block'> after it","why":"The marker is a previous sibling of the paragraph, so peer-invalid on the paragraph follows the input's invalid state."},{"id":"b","text":"<p class='peer'> then <input class='peer-invalid:block'> after it","whyNot":"The paragraph would be the marker, so the input would follow the paragraph's state, not the field's."},{"id":"c","text":"<p class='hidden peer-invalid:block'> before <input class='peer'>","whyNot":"The marker must come before the styled element, so a paragraph placed earlier can't read the input."},{"id":"d","text":"<input class='peer'> then <p class='hidden invalid:block'> after it","whyNot":"invalid: styles the paragraph itself, which is never invalid; the state has to come from the input through peer."}],"answer":"a","explanation":"peer-* variants style an element according to a peer marker on a previous sibling. The marker must come earlier in the markup because of how the subsequent-sibling combinator works.","concept":"peer-* variants style an element according to a peer marker on a previous sibling. The marker must come earlier in the markup because of how the subsequent-sibling combinator works.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Put peer on the field and peer-* on the element that follows it."]},{"id":"tailwindadvanced-004","courseId":"tailwind-advanced","domain":"core-utilities","topic":"Preflight resets","prompt":"Tailwind's preflight base styles reset several browser defaults. Which TWO of these statements describe what preflight does?","hint":"Think about what a browser adds to headings, paragraphs and media elements before your own CSS runs.","explain":"Browsers apply built-in styles to every element before any author CSS, and a base layer can override many of them. A reset matters most where a default shapes spacing, or how pictures and video sit in a line of text.","source":"https://tailwindcss.com/docs/preflight","interaction":{"type":"multiple","tellCount":true},"options":[{"id":"a","text":"Preflight removes the default margins from headings and paragraphs.","why":"The reset clears user-agent margins on elements like headings and paragraphs, so spacing comes only from your scale."},{"id":"b","text":"Images and svg elements are display block by default.","why":"Replaced elements default to block display, which avoids the alignment problems that inline display causes."},{"id":"c","text":"Headings keep the browser's default size and weight.","whyNot":"Headings are left completely unstyled, with the same size and weight as normal text."},{"id":"d","text":"Paragraphs keep the browser's default margins, unchanged.","whyNot":"The reset removes those margins, so they can't leak into your spacing."},{"id":"e","text":"Images display inline, the same as ordinary text.","whyNot":"Inline is the browser default that preflight replaces for images and other replaced elements."},{"id":"f","text":"Every element uses content-box sizing, so padding adds to width.","whyNot":"Preflight sets border-box sizing, so padding and borders stay inside a width you set."}],"answer":"ab","explanation":"Preflight removes browser default margins, leaves headings unstyled, makes images and other replaced elements block by default, and sets border-box sizing.","concept":"Preflight removes browser default margins, leaves headings unstyled, makes images and other replaced elements block by default, and sets border-box sizing.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Preflight strips browser margins, so spacing comes only from the spacing scale."]},{"id":"tailwindadvanced-005","courseId":"tailwind-advanced","domain":"core-utilities","topic":"Class names built in code","prompt":"A React button builds its class with the string text-${color}-600, and color is 'red'. The app runs, but the built CSS has no rule for that red text. What is the cause?","hint":"Think about when Tailwind reads your files and what it can see there.","explain":"A build step can only produce styles for names it can identify in your files before the program runs. Anything assembled while the program executes stays invisible to it, however the files are read.","source":"https://tailwindcss.com/docs/detecting-classes-in-source-files","interaction":{"type":"single"},"options":[{"id":"a","text":"Tailwind reads source files as plain text and never sees the full text-red-600 name.","why":"The class is built from pieces, so the complete string text-red-600 never appears in the source for Tailwind to find."},{"id":"b","text":"Tailwind generates CSS only while the component renders in the browser.","whyNot":"Tailwind works over your files at build time, not from what components render in the browser."},{"id":"c","text":"The red palette was removed from Tailwind's default theme.","whyNot":"red is in the default palette; the failure comes from how the class name is written, not from the color."},{"id":"d","text":"Tailwind only reads .html and .css files, not JavaScript sources.","whyNot":"Tailwind scans your source files as plain text, JavaScript included; the file type isn't the problem."}],"answer":"a","explanation":"Tailwind scans source files as plain text for complete class names and generates CSS only for those. Interpolated class names never appear in full, so no CSS is generated for them.","concept":"Tailwind scans source files as plain text for complete class names and generates CSS only for those. Interpolated class names never appear in full, so no CSS is generated for them.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Write every class name in full in the source, and choose between complete strings instead of building them."]}]