Skip to content

Latest commit

 

History

History
180 lines (148 loc) · 6.58 KB

what-is-tailwind.blade.md

File metadata and controls

180 lines (148 loc) · 6.58 KB
extends title
_layouts.documentation
What is Tailwind?

What is Tailwind?

Tailwind is a utility-first CSS framework for rapidly building custom user interfaces.

Tailwind is different from frameworks like Bootstrap, Foundation, or Bulma in that it's not a UI kit.

It doesn't have a default theme and there's no built-in UI components.

On the flip side, it also has no opinion about how your site should look and doesn't impose design decisions that you have to fight to undo.

If you're looking for a framework that comes with a menu of predesigned widgets to build your site with, Tailwind might not be the right framework for you.

But if you want a huge head start implementing a custom design with its own identity, Tailwind might be just what you're looking for.

Utility-first

Creating a framework for building custom UIs means you can't provide abstractions at the usual level of buttons, forms, cards, navbars, etc.

Instead, Tailwind provides highly composable, low-level utility classes that make it easy to build complex user interfaces without encouraging any two sites to look the same.

Here's an example of a contact card component built with Tailwind without writing a single line of CSS:

@component('_partials.code-sample', ['class' => 'bg-grey-lighter py-8'])

Adam Wathan

Developer at NothingWorks Inc.

Message
@slot('code')

Adam Wathan

Developer at NothingWorks Inc.

Message
@endslot @endcomponent

Component-friendly

While you can do a lot with just utility classes, sometimes a component class is the right decision.

Tailwind provides tools for extracting component classes from repeated utility patterns, making it easy to update multiple instances of a component from one place:

@component('_partials.code-sample', ['lang' => 'html', 'class' => 'text-center']) Button

@slot('code')

Button Button <style> .btn { @apply .font-bold .py-2 .px-4 .rounded; } .btn-blue { @apply .bg-blue .text-white; } .btn-blue:hover { @apply .bg-blue-dark; } </style>

@endslot @endcomponent

Responsive to the core

Every Tailwind utility also comes in responsive flavors, making it extremely easy to build responsive interfaces without ever leaving your HTML.

Tailwind uses an intuitive {breakpoint}: prefix that makes it easy to notice responsive classes in your markup while keeping the original class name recognizable and in tact.

@component('_partials.responsive-code-sample') @slot('none')

1
2
3
@endslot @slot('sm')
1
2
3
@endslot @slot('md')
1
2
3
@endslot @slot('lg')
1
2
3
@endslot @slot('xl')
1
2
3
@endslot @slot('code')
@endslot @endcomponent

Designed to be customized

If it makes sense to be customizable, Tailwind lets you customize it.

This includes colors, border sizes, font weights, spacing utilities, breakpoints, shadows, and tons more.

Tailwind is written in PostCSS and configured in JavaScript, which means you have the full power of a real programming language at your finger tips.

Tailwind is more than a CSS framework, it's an engine for creating design systems.

const colorPalette = {
  // ...
  'grey-lighter': '#f3f7f9',
  // ...
}


module.exports = {
  // ...
  backgroundColors: colorPalette,
  borderColors: {
    default: colorPalette['grey-lighter'],
    ...colorPalette,
  },
  // ...
}