0
0
Tailwindmarkup~20 mins

Tailwind with Vue single-file components - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Tailwind Vue Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
selector
intermediate
2:00remaining
Which Tailwind class applies a responsive padding of 2rem on medium screens and above?
Choose the correct Tailwind CSS class that adds padding of 2rem (32px) on medium (md) screens and larger, but no padding on smaller screens.
Ap-8 md
Bp-md-8
Cp-8-md
Dmd:p-8
Attempts:
2 left
💡 Hint
Tailwind uses breakpoint prefixes before the utility class.
rendering
intermediate
2:00remaining
What will this Vue SFC render visually?
Given this Vue single-file component using Tailwind, what is the visible background color of the button on a large screen?
Tailwind
<template>
  <button class="bg-blue-500 lg:bg-red-500 text-white p-4">Click me</button>
</template>
ABlue background on small and medium, red on large screens and above
BBlue background on all screen sizes
CRed background on all screen sizes
DNo background color
Attempts:
2 left
💡 Hint
Tailwind applies the last matching class for the current screen size.
🧠 Conceptual
advanced
2:00remaining
What is the purpose of the scoped attribute in Vue SFC style blocks when using Tailwind?
In a Vue single-file component, why would you add the scoped attribute to the <style> tag when also using Tailwind CSS classes?
ATo enable Tailwind's utility classes inside the style block
BTo limit the CSS rules in the style block to only this component, preventing global style leaks
CTo automatically add responsive variants to Tailwind classes
DTo disable Tailwind CSS for this component
Attempts:
2 left
💡 Hint
Think about CSS scope and how Vue isolates styles.
layout
advanced
2:00remaining
Which Tailwind classes create a responsive two-column grid that stacks on small screens?
Select the correct Tailwind CSS classes to make a grid with two columns on medium screens and larger, but one column on smaller screens.
Agrid grid-cols-2 md:grid-cols-1
Bgrid-cols-2 grid md:grid-cols-1
Cgrid grid-cols-1 md:grid-cols-2
Dgrid-cols-1 grid-cols-2 md:grid
Attempts:
2 left
💡 Hint
Remember the mobile-first approach: base classes apply to all, prefixes override on larger screens.
accessibility
expert
3:00remaining
How to make a Tailwind-styled Vue button accessible with keyboard and screen readers?
You have a button styled with Tailwind in a Vue component. Which option best improves accessibility for keyboard users and screen readers?
Tailwind
<template>
  <button class="bg-green-600 text-white p-3 rounded">Submit</button>
</template>
ANo changes needed; button is accessible by default
BAdd <code>tabindex="0"</code> and <code>aria-label="Submit form"</code> to the button
CAdd <code>aria-hidden="true"</code> to the button
DAdd <code>role="button"</code> and <code>tabindex="-1"</code> to the button
Attempts:
2 left
💡 Hint
Think about keyboard focus and descriptive labels for screen readers.