fbpx
Wikipedia

Tailwind CSS

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.[4][5]

Tailwind CSS
Original author(s)Adam Wathan, Jonathan Reinink, David Hemphill, and Steve Schoger
Developer(s)Tailwind Labs[1]
Stable release
3.4.3[2]  / 27 March 2024
Repository
  • github.com/tailwindlabs/tailwindcss
Written inTypeScript, Rust, CSS
PlatformWeb
Available inEnglish
LicenseMIT License[3]
Websitetailwindcss.com

For example, in other traditional systems, there would be a class message-warning 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: bg-yellow-300 and font-bold.

As of 17 April 2024, Tailwind CSS has over 78,000 stars on GitHub.[6]

Features edit

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 edit

The utility-first concept refers to the main differentiating feature of Tailwind.[7] 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...

Example: yellow notice
Result  
Code
<div class="m-4 p-4 bg-yellow-200 font-bold rounded-lg"> <p>Please be careful when feeding the birds.</p> </div> 
Classes Tailwind CSS equivalent
m-4 margin: 1rem;
p-4 padding: 1rem;
bg-yellow-200 background-color: rgba(254, 240, 138, 1);
font-bold font-weight: 700;
rounded-lg border-radius: 0.5rem;

Variants edit

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.[8] There are also variants for the different states an element can have, such as hover : for when hovered, focus: when keyboard selected or active: when in use,[9] or when the browser or operating system has dark mode enabled.[10]

Variants have two parts: the condition to be met and the class that is applied if the condition is met. For example, the variant md:bg-yellow-400 will apply the class bg-yellow-400 if the screen size is greater than the value defined for md.

Tailwind CSS is developed using JavaScript, runs via Node.js, and installs with environment package managers like npm or yarn.[11]

Settings and themes edit

It is possible to configure the utility classes and variants that Tailwind offers through a configuration file usually named tailwind.config.js. 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 edit

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.[12]

Just-in-time mode edit

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.[citation needed] 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.[12]

Versions edit

Tailwind CSS uses semantic versioning to identify its version compatibility.

See also edit

References edit

  1. ^ "Tailwind Labs". GitHub.
  2. ^ "Release 3.4.3". 27 March 2024. Retrieved 20 April 2024.
  3. ^ "Github: tailwindlabs/tailwindcss, LICENSE". GitHub.
  4. ^ Gerchev, Ivaylo (2022). Tailwind CSS. Sebastopol: O'Reilly Media. ISBN 978-1-0981-4099-1. OCLC 1314257318.
  5. ^ Rappin, Noel (2021). Modern CSS with Tailwind flexible styling without the fuss. Raleigh: The Pragmatic Bookshelf. ISBN 978-1-68050-857-4. OCLC 1277046918.
  6. ^ tailwindlabs/tailwindcss, Tailwind Labs, 17 April 2024, retrieved 17 April 2024
  7. ^ "Utility-First - Tailwind CSS". tailwindcss.com. Retrieved 13 November 2021.
  8. ^ "Responsive Design - Tailwind CSS". tailwindcss.com. Retrieved 13 November 2021.
  9. ^ "Hover, Focus, & Other States - Tailwind CSS". tailwindcss.com. Retrieved 13 November 2021.
  10. ^ "Dark Mode - Tailwind CSS". tailwindcss.com. Retrieved 13 November 2021.
  11. ^ "Installation - Tailwind CSS". tailwindcss.com. Retrieved 13 November 2021.
  12. ^ a b "Release v3.0.0-alpha.1 tailwindlabs/tailwindcss". GitHub. Retrieved 13 November 2021.

External links edit

  • Official Tailwind Documentation
  • Tailwind Play
  • Github Repo
  • Tailwind Converter

tailwind, open, source, framework, main, feature, this, library, that, unlike, other, frameworks, like, bootstrap, does, provide, series, predefined, classes, elements, such, buttons, tables, instead, creates, list, utility, classes, that, used, style, each, e. 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 4 5 Tailwind CSSOriginal author s Adam Wathan Jonathan Reinink David Hemphill and Steve SchogerDeveloper s Tailwind Labs 1 Stable release3 4 3 2 27 March 2024Repositorygithub wbr com wbr tailwindlabs wbr tailwindcssWritten inTypeScript Rust CSSPlatformWebAvailable inEnglishLicenseMIT License 3 Websitetailwindcss com For example in other traditional systems there would be a class message warning 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 bg yellow 300 and font bold As of 17 April 2024 Tailwind CSS has over 78 000 stars on GitHub 6 Contents 1 Features 1 1 Utility classes 1 2 Variants 1 3 Settings and themes 1 3 1 Build all and purge 1 3 2 Just in time mode 2 Versions 3 See also 4 References 5 External linksFeatures editDue 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 edit The utility first concept refers to the main differentiating feature of Tailwind 7 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 Example yellow notice Result nbsp Code lt div class m 4 p 4 bg yellow 200 font bold rounded lg gt lt p gt Please be careful when feeding the birds lt p gt lt div gt Classes Tailwind CSS equivalent m 4 span class nt margin span span class o span span class w span span class nt 1rem span span class o span p 4 span class nt padding span span class o span span class w span span class nt 1rem span span class o span bg yellow 200 span class nt background color span span class o span span class w span span class nt rgba span span class o span span class nt 254 span span class o span span class w span span class nt 240 span span class o span span class w span span class nt 138 span span class o span span class w span span class nt 1 span span class o span font bold span class nt font weight span span class o span span class w span span class nt 700 span span class o span rounded lg span class nt border radius span span class o span span class w span span class nt 0 span span class p span span class nc 5rem span span class o span Variants edit 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 8 There are also variants for the different states an element can have such as hover for when hovered focus when keyboard selected or active when in use 9 or when the browser or operating system has dark mode enabled 10 Variants have two parts the condition to be met and the class that is applied if the condition is met For example the variant md bg yellow 400 will apply the class bg yellow 400 if the screen size is greater than the value defined for md Tailwind CSS is developed using JavaScript runs via Node js and installs with environment package managers like npm or yarn 11 Settings and themes edit It is possible to configure the utility classes and variants that Tailwind offers through a configuration file usually named tailwind config js 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 edit 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 12 Just in time mode edit 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 citation needed 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 12 Versions editTailwind CSS uses semantic versioning to identify its version compatibility See also edit nbsp Free and open source software portal CSS framework jQuery Mobile JavaScript framework JavaScript library Bootstrap front end framework References edit Tailwind Labs GitHub Release 3 4 3 27 March 2024 Retrieved 20 April 2024 Github tailwindlabs tailwindcss LICENSE GitHub Gerchev Ivaylo 2022 Tailwind CSS Sebastopol O Reilly Media ISBN 978 1 0981 4099 1 OCLC 1314257318 Rappin Noel 2021 Modern CSS with Tailwind flexible styling without the fuss Raleigh The Pragmatic Bookshelf ISBN 978 1 68050 857 4 OCLC 1277046918 tailwindlabs tailwindcss Tailwind Labs 17 April 2024 retrieved 17 April 2024 Utility First Tailwind CSS tailwindcss com Retrieved 13 November 2021 Responsive Design Tailwind CSS tailwindcss com Retrieved 13 November 2021 Hover Focus amp Other States Tailwind CSS tailwindcss com Retrieved 13 November 2021 Dark Mode Tailwind CSS tailwindcss com Retrieved 13 November 2021 Installation Tailwind CSS tailwindcss com Retrieved 13 November 2021 a b Release v3 0 0 alpha 1 tailwindlabs tailwindcss GitHub Retrieved 13 November 2021 External links editOfficial Tailwind Documentation Tailwind Play Github Repo Tailwind Converter Retrieved from https en wikipedia org w index php title Tailwind CSS amp oldid 1220382614, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.