Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Component in Tailwind CSS:

In Tailwind CSS, a component refers to a collection of utility classes that are grouped
together to create a specific UI element or component. For example, a button
component might consist of utility classes for styling the button's appearance, size,
color, and other properties. Components in Tailwind8 CSS are built by composing utility
classes together to achieve the desired visual and functional outcome.

inflexible

Utility class in Tailwind CSS:

A utility class in Tailwind CSS refers to a single-purpose class that applies a specific style
or behavior to an HTML element. Tailwind CSS provides a large set of utility classes for
common CSS properties such as margin, padding, typography, colors, and more.

Flexible

• Utility classes operate at a low level

• Utility classes are easy to customize, so we can build any design.

• Utility classes can be adopted to any design.

• Utility classes are completely customizable and extensible.

• Utility classes allow for much easier implementation of responsive design


patterns.

Tailwind:

• Tailwind is a set of low-level, reusable utility classes that can be used like building
blocks

the span tag is a generic inline container element. You use this element for styling purposes or
to add attributes to a section of text without creating a new line of content.
A div element is used for block-level organization and styling of page elements, whereas a span
element is used for inline organization and styling
• The <div> element is often used as container for other HTML elements.
• By default, browsers always place a line break before and after the <div> element. However, this
can be changed with CSS.

1. @tailwind base: This directive includes the base styles provided by Tailwind CSS.
These base styles typically include CSS resets and normalize styles, ensuring
consistent styling across different browsers.
2. @tailwind components: This directive includes the pre-designed components
provided by Tailwind CSS, such as buttons, forms, cards, etc. These components
are built using Tailwind's utility classes and can be customized or extended as
needed.
3. @tailwind utilities: This directive includes all of Tailwind CSS's utility classes. These
utility classes cover a wide range of CSS properties, allowing you to quickly apply
styles to your HTML elements without having to write custom CSS.

In Tailwind CSS, @layer is a directive used to define a layer for your styles. Within this layer, you
typically set foundational styles that affect the basic structure or appearance of your HTML
document.

• Flex box is a method that allow us to layout items in one dimension


• Horizontally
• Vertically
• Flexbox is a container usually invisible
• Items laid out the way we want in container
• Children items can themselves be flex container for smaller items within them

• Use @apply to inline any existing utility classes into your own custom CSS.
• useful when you need to write custom CSS
• override the styles in a third-party library
use the same syntax you’re used to using in your HTML

• Use the @layer directive to tell Tailwind which “bucket” a set of custom styles belong to. Valid
layers are
• base,
• components,
• utilities.

• Tailwind will automatically move the CSS within any @layer directive to the same place as the
corresponding @tailwind rule, so you don’t have to worry about authoring your CSS in a
specific order to avoid specificity issues.
• Any custom CSS added to a layer will only be included in the final build if that CSS is
actually used in your HTML, just like all of the classes built in to Tailwind by default.

You might also like