Skip to content

Tailwind Introduction

Tailwind CSS is a utility-first CSS framework. Instead of writing custom CSS rules, you apply small, single-purpose classes directly in your HTML. Click here to access the Tailwind docs.

  • Utility-first, not opinionated: Tailwind gives you low-level utilities instead of pre-built components. You build your own designs without fighting framework defaults.
  • JIT compiled: Only the classes you use end up in your CSS bundle. Bootstrap ships its entire pre-compiled stylesheet.
  • Industry standard: Tailwind is the most widely used CSS framework in modern frontend development.

Since Vue uses SFCs (Single File Components), using <style scoped> is already convenient. However, prefer Tailwind utility classes for common styling needs like spacing, layout, and colors.

Use <style scoped> only when:

  • You need custom styles not covered by Tailwind (e.g., a unique animation)
  • You are defining reusable component-level classes (our cmd-* design system classes)

Throughout the codebase, you’ll see classes like px-2 and m-3. These control padding and margin.

  • m - margin
  • p - padding
  • t - top
  • b - bottom
  • l - left
  • r - right
  • x - left and right (horizontal)
  • y - top and bottom (vertical)
  • (omitted) - all sides

Tailwind uses a consistent spacing scale where each unit = 0.25rem (4px):

ClassValue
00
10.25rem (4px)
20.5rem (8px)
30.75rem (12px)
41rem (16px)
51.25rem (20px)
61.5rem (24px)
82rem (32px)
102.5rem (40px)
123rem (48px)
ClassDescription
m-4Margin on all sides = 1rem
pt-2Padding top = 0.5rem
py-0Padding top & bottom = 0
ml-autoMargin left = auto
px-6Padding left & right = 1.5rem

Tailwind’s flexbox utilities replace verbose CSS:

ClassCSS
flexdisplay: flex
flex-colflex-direction: column
items-centeralign-items: center
justify-betweenjustify-content: space-between
gap-2gap: 0.5rem
w-fullwidth: 100%
h-fullheight: 100%
growflex-grow: 1
<div class="flex flex-col gap-2 h-full">
<div class="flex justify-between items-center">
<h4>Title</h4>
<span>Status</span>
</div>
<div class="grow">Content</div>
</div>

We define a set of reusable component classes in app.css prefixed with cmd-:

  • cmd-btn, cmd-btn-sm - buttons
  • cmd-btn-danger, cmd-btn-success, cmd-btn-primary - button variants
  • cmd-btn-outline-danger, cmd-btn-outline-success - outline variants
  • cmd-modal - modal dialogs
  • cmd-list-item - list items

These are defined in <style scoped> blocks or app.css and provide consistent styling across the GUI. Use Tailwind for layout, use cmd-* classes for component styling.