Tailwind CSS
Purpose
It is used to create a set of utility class based on your theme configurations
Installation
Install the dependency
Create a CSS file and inject tailwind's bases, components and utilities on it
Generate the tailwind config, so that we can customize the style on it later
Set up post css configuration file
Compile into a set of utility classes on
output.css
based on your settings andinput.css
Utility-First Fundamentals
Using utility classes to build custom designs without writing CSS to prevent from the growth css file
The reusability of style is achieved based on separation of component instead of css class
Configuration
The configuration is mainly include content, theme & plugins
Content
The
content
section of yourtailwind.config.js
file is where you configure the paths to all of your HTML templates, JavaScript components, and any other source files that contain Tailwind class names.Tailwind uses a very simple approach to detecting class names in your content, and generate the your used class into
output.css
Theme
The
theme
section of yourtailwind.config.js
file is where you define your project’s design systemYou can extend or override the default theme
Plugin
Apply 3rd plugin which is a set of configuration to override or extend the theme
Directive
@tailwind
Base class stands for the a set of tailwind default element class
Component class stands for the custom class that applied tailwind utility class
Utilities class stands for the utility class that the
content
used
@layer
To customize the tailwind class in different levels
@apply
Use
@apply
to inline any existing utility classes into your own custom CSS.
@config
To specify the source tailwind config file
Functions
Tailwind adds a few custom functions you can use in your CSS to access Tailwind configuration values.
Component Library
Tailwind UI
Last updated
Was this helpful?