Tailwind CSS
   HOME

TheInfoList



OR:

Tailwind CSS is an open source CSS framework. The main feature of this library is that, unlike other CSS frameworks like Bootstrap, it does not provide a series of predefined classes for elements such as buttons or tables. Instead, it creates a list of "utility" CSS classes that can be used to style each element by mixing and matching. For example, in other traditional systems, there would be a class that would apply a yellow background color and bold text. To achieve this result in Tailwind, one would have to apply a set of classes created by the library: and . As of 23rd January 2023, Tailwind CSS has over 64,400 stars on
GitHub GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, continu ...
.


Features

Due to the difference in basic concepts in relation to other traditional CSS frameworks such as Bootstrap, it is important to know the philosophy from which Tailwind was created, as well as its basic usage.


Utility Classes

The ''utility-first'' concept refers to the main differentiating feature of Tailwind. Instead of creating classes around components (button, panel, menu, textbox ...), classes are built around a specific style element (yellow color, bold font, very large text, center element...). Each of these classes is called utility classes. There are many utility classes in TailwindCSS that enable to control a large number of CSS properties like colors, border, display type (''display''), font size and font, layout, shadow...


Variants

Tailwind offers the possibility to apply a utility class only in some situations through '' media queries'', which is called a variant. The main use of variants is to design a responsive interface for various screen sizes. There are also variants for the different states an element can have, such as for when hovered, when keyboard selected or when in use, or when the browser or operating system has
dark mode A light-on-dark color scheme —also called black mode, dark mode, dark theme, night mode, or lights-out (mode)— is a color scheme that uses light-colored text, icons, and graphical user interface elements on a dark background. It is often ...
enabled. Variants have two parts: the condition to be met and the class that is applied if the condition is met. For example, the variant will apply the class if the screen size is greater than the value defined for . Tailwind CSS is developed using
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
, runs via
Node.js Node.js is an open-source server environment. Node.js is cross-platform and runs on Windows, Linux, Unix, and macOS. Node.js is a back-end JavaScript runtime environment. Node.js runs on the V8 JavaScript Engine and executes JavaScript code o ...
, and installs with environment package managers like npm or
yarn Yarn is a long continuous length of interlocked fibres, used in sewing, crocheting, knitting, weaving, embroidery, ropemaking, and the production of textiles. Thread is a type of yarn intended for sewing by hand or machine. Modern manu ...
.


Settings and Themes

It is possible to configure the utility classes and variants that Tailwind offers through a configuration file usually named . In the configuration one can set the values of the utility classes, such as the color-palette or the sizes between elements for margins.


Build All and Purge

The default mode of Tailwind is that the system generates all possible CSS combinations based on the project settings. Then, by means of another utility such as PurgeCSS, all the files are traversed, and the classes that are not being used are removed from the resulting CSS file. Due to the number of classes that can be generated by the number of variants and their combinations, this method has the drawbacks of long waiting times and large sizes of CSS files before being purged. This mode of operation is no longer available in version 3 of Tailwind CSS.


JIT

JIT mode (''Just-In-Time'') is an alternative way to generate the CSS that, instead of generating all possible classes and then removing all those that are not being used, parses the content of HTML files (or configured extensions or locations) and instantly generates only those classes that are needed and used. Because all possible variables are no longer generated, the waiting time and size of the resulting CSS files is greatly reduced. This technical improvement has made it possible to introduce numerous new variants and utility classes, as well as the ability to create utility classes on the fly with arbitrary values ​​not set in the configuration. Starting with version 3 of Tailwind CSS, JIT mode has become the default.


Versions

Tailwind CSS uses
semantic versioning Software versioning is the process of assigning either unique ''version names'' or unique ''version numbers'' to unique states of computer software. Within a given version number category (e.g., major or minor), these numbers are generally assig ...
to identify its version compatibility.


Prominent uses

*
GitHub GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, continu ...
*
Firefox Mozilla Firefox, or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko rendering engine to display web pages, which implements current ...
*
Netlify Netlify is a remote-first cloud computing company that offers a development platform that includes build, deploy, and serverless backend services for web applications and dynamic websites. The platform is built on open web standards, making ...
* NBA *
NASA The National Aeronautics and Space Administration (NASA ) is an independent agencies of the United States government, independent agency of the US federal government responsible for the civil List of government space agencies, space program ...
*
Netflix Netflix, Inc. is an American subscription video on-demand over-the-top streaming service and production company based in Los Gatos, California. Founded in 1997 by Reed Hastings and Marc Randolph in Scotts Valley, California, it offers a fi ...
*
The Verge ''The Verge'' is an American technology news website operated by Vox Media, publishing news, feature stories, guidebooks, product reviews, consumer electronics news, and podcasts. The website launched on November 1, 2011, and uses Vox Media ...
* NBA


See also

*
Bootstrap (framework) Bootstrap is a free and open-source CSS framework directed at responsive, mobile-first front-end web development. It contains HTML, CSS and (optionally) JavaScript-based design templates for typography, forms, buttons, navigation, and other i ...


References

{{Reflist, 2


External links


Official Tailwind Documentation

Tailwind Play
real-time testing environment. Web frameworks Cascading Style Sheets