Tailwind CSS
Tailwind CSS is an open-source CSS framework. Unlike other 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.[5][6] For example, in other traditional systems, there would be a class As of 5 August 2024, Tailwind CSS has over 81,000 stars on GitHub.[7] FeaturesDue 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 classesThe utility-first concept refers to the main differentiating feature of Tailwind.[8] 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 Tailwind CSS that enable to control a large number of CSS properties like colors, border, display type (display), font size and font, layout, shadow... VariantsTailwind 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.[9] There are also variants for the different states an element can have, such as Variants have two parts: the condition to be met and the class that is applied if the condition is met. For example, the variant Tailwind CSS is developed using JavaScript, runs via Node.js, and installs with environment package managers like npm or yarn.[12] Settings and themesIt is possible to configure the utility classes and variants that Tailwind offers through a configuration file usually named Build all and purgeThe 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.[13] Just-in-time modeJIT 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. By generating only the necessary CSS, JIT reduces the size of the CSS file. 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.[13] VersionsTailwind CSS uses semantic versioning to identify its version compatibility. See alsoReferences
External links |
Portal di Ensiklopedia Dunia