[{"id":"tailwindbeginner-001","courseId":"tailwind-beginner","domain":"core-utilities","topic":"Utility-first styling","prompt":"A teammate is styling a chat notification card in a Tailwind project. Which approach matches how Tailwind expects you to build the design?","hint":"Think about where the styling rules live compared with the markup.","explain":"A style rule can be shared across many elements, so an edit reaches all of them, or it can be attached so its reach stops at one. Think about how far an edit travels under each setup.","source":"https://tailwindcss.com/docs/styling-with-utility-classes","interaction":{"type":"single"},"options":[{"id":"a","text":"Combine several small classes like p-6 and rounded-xl directly in the markup","why":"Utility-first styling puts single-purpose classes right on each element, and the page describes this as the way to build designs."},{"id":"b","text":"Write one semantic class per component and define its rules in a separate CSS file","whyNot":"That is the traditional approach the page contrasts with, since it means switching between HTML and CSS files."},{"id":"c","text":"Put every rule for the whole page into one large class to reuse everywhere","whyNot":"Utility classes are small and single-purpose; one giant class would work against the approach."},{"id":"d","text":"Pick a unique class name for each element before writing any markup","whyNot":"The page says this approach saves you from spending time coming up with class names."}],"answer":"a","explanation":"Tailwind styles elements by combining many single-purpose utility classes directly in markup, so changing one element's classes only affects that element.","concept":"Tailwind styles elements by combining many single-purpose utility classes directly in markup, so changing one element's classes only affects that element.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Tailwind puts small utility classes on each element instead of writing named component rules."]},{"id":"tailwindbeginner-002","courseId":"tailwind-beginner","domain":"core-utilities","topic":"Spacing scale from --spacing","prompt":"The p-4 utility sets a fixed padding value, and changing the theme's --spacing variable cannot affect it.","hint":"Check which variable the padding utilities are built from.","explain":"A utility can hard-code a value, or compute one from a theme variable that a project may redefine. Which of these a class uses decides whether changing that variable reaches it.","source":"https://tailwindcss.com/docs/padding","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","whyNot":"p-4 is computed from --spacing, so changing that variable changes the padding."},{"id":"b","text":"False","why":"The p- utilities are driven by the --spacing theme variable, so a theme change does change them."}],"answer":"b","explanation":"The p-<number> padding utilities compute calc(var(--spacing) * number), and --spacing can be customized in your own theme, so the values follow the theme.","concept":"The p-<number> padding utilities compute calc(var(--spacing) * number), and --spacing can be customized in your own theme, so the values follow the theme.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Spacing utilities are multiples of the --spacing theme variable, so customizing that variable rescales them."]},{"id":"tailwindbeginner-003","courseId":"tailwind-beginner","domain":"core-utilities","topic":"Horizontal margin utilities","prompt":"A teammate asks how Tailwind margin utilities behave. Which TWO statements are correct?","hint":"Look at how the spacing shortcut treats a group of siblings.","explain":"Margin is the space outside an element, and a utility can be written to flip its sign. Siblings can be spaced by a shortcut that acts on a whole group, and that shortcut has boundaries worth knowing.","source":"https://tailwindcss.com/docs/margin","interaction":{"type":"multiple","tellCount":true},"options":[{"id":"a","text":"Adding a dash before a margin class, like -mt-8, makes that margin negative.","why":"The page says a dash before the class name converts it to a negative value."},{"id":"b","text":"The space-x-4 utility works by adding margin to every child, including the last one.","whyNot":"The page calls space utilities a shortcut for adding margin to all-but-the-last item, so the last item gets none."},{"id":"c","text":"The space-x-4 utility works by adding margin to all children except the last one.","why":"The page describes space utilities as a shortcut for adding margin to all-but-the-last item in a group."},{"id":"d","text":"The space utilities are the best choice for grid layouts and layouts that wrap.","whyNot":"The page says they are not designed for grids or wrapping layouts, and suggests gap utilities instead."},{"id":"e","text":"-mt-8 is invalid, so negative margins need an arbitrary value like mt-[-32px].","whyNot":"A dash before the class name is the documented way to make a margin negative, so -mt-8 is valid."},{"id":"f","text":"The space and divide utilities are designed to be combined on the same children.","whyNot":"The page says the space utilities are not designed to work together with the divide utilities."}],"answer":"ac","explanation":"Margin utilities set margin, a dash makes a margin value negative, and the space utilities add margin to all but the last item in a group; they don't suit grids or wrapping layouts.","concept":"Margin utilities set margin, a dash makes a margin value negative, and the space utilities add margin to all but the last item in a group; they don't suit grids or wrapping layouts.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Use gap for grid and flex spacing; space utilities only cover simple, unwrapped groups of siblings."]},{"id":"tailwindbeginner-004","courseId":"tailwind-beginner","domain":"core-utilities","topic":"Hiding elements with display","prompt":"A menu should disappear from the page entirely, leaving no space behind it. Which utility does that?","hint":"Look for the display utility that takes a box out of the layout.","explain":"Hiding can mean two different things: taking a box out of the layout completely, or removing it from sight while keeping it for assistive tools. Compare each option by what it does to the layout.","source":"https://tailwindcss.com/docs/display","interaction":{"type":"single"},"options":[{"id":"a","text":"hidden","why":"The hidden utility removes the element from the document, so it takes up no space."},{"id":"b","text":"sr-only","whyNot":"It hides the element visually but keeps it available to screen readers."},{"id":"c","text":"not-sr-only","whyNot":"It undoes sr-only, making a screen-reader-only element visible to sighted users again."},{"id":"d","text":"The visibility property","whyNot":"Visibility hides an element visually but keeps it in the document, so it is not removed."}],"answer":"a","explanation":"The hidden utility removes an element from the document. sr-only hides visually but keeps the element for screen readers, and the visibility property keeps the element in the document.","concept":"The hidden utility removes an element from the document. sr-only hides visually but keeps the element for screen readers, and the visibility property keeps the element in the document.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Use hidden to remove an element from the page; use sr-only when only sighted users should miss it."]},{"id":"tailwindbeginner-005","courseId":"tailwind-beginner","domain":"core-utilities","topic":"Column flex direction","prompt":"A flex container holds three items that should stack vertically, with the first item at the top. Which class sets that direction?","hint":"Pick the direction that runs along the vertical axis, going forward.","explain":"Flex items sit along a main axis whose direction the container controls. That axis can run horizontally or vertically, and each can run forward or in reverse.","source":"https://tailwindcss.com/docs/flex-direction","interaction":{"type":"single"},"options":[{"id":"a","text":"flex-row","whyNot":"flex-row positions flex items horizontally, in the same direction as text."},{"id":"b","text":"flex-col","why":"flex-col positions flex items vertically, so they stack from top to bottom."},{"id":"c","text":"flex-col-reverse","whyNot":"It stacks items vertically too, but in the opposite direction, so the first item ends up at the bottom."},{"id":"d","text":"flex-row-reverse","whyNot":"It keeps items horizontal and reverses their order, so it never stacks them vertically."}],"answer":"b","explanation":"flex-col sets the flex direction so items are positioned vertically; the reverse variant runs them in the opposite direction.","concept":"flex-col sets the flex direction so items are positioned vertically; the reverse variant runs them in the opposite direction.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Use flex-col to stack flex items vertically; flex-col-reverse stacks them in the opposite direction."]}]