By default, Tailwind's height scale is a combination of the default spacing scale as well as some additional values specific to heights. Background Size classes: bg-auto; bg-cover; bg-contain. Use box-border to set an element's box-sizing to border-box, telling the browser to include the element's borders and padding when you give it a height or width.. Utilities for setting the width of an element. Is it big, normal or small? It is the alternative to the CSS font-size property. This class accepts lots of value in tailwind CSS in which all the properties are covered as in class form. The .container class sets the max-width of an element to match the min-width of the current breakpoint. Tailwind CSS Font Size. In a previous article, I’ve explained how to install Tailwind in a Nrwl NX workspace with Angular and Storybook.. Usage. Controlling File Size Strategies for keeping your generated CSS small and performant. You can customize the spacing scale for padding, margin, width, and height all at once in the theme.spacing section of your tailwind.config.js file: On paper, utility CSS actually sounds like it may be useful. Utilities for controlling the background size of an element's background image. You can control which variants are generated for the background size utilities by modifying the backgroundSize property in the variants section of your tailwind.config.js file. Developing with Tailwind CSS. In practice, though, Tailwind CSS (and utility CSS in general) suffers from the same issues that it attempts to solve and is, in my honest opinion, not worth your time. By default, Tailwind CSS will generate all the CSS utilities class name combinations, but many of those CSS classes will not be used in your project. Finally, Let's talk about the final CSS bundle size delivered to the browser. Add Tailwind to your CSS @tailwind base; @tailwind components; @tailwind utilities; h1 { color: purple; } @tailwind is not a valid CSS syntax. Use bg-contain to scale the background image to the outer edges without cropping or stretching. On my project, it was more than 2MB. It respectively says you want a small, large or extra-large font size. More about spacings can be read here. Here are a few examples to help you get an idea of how to build components like this using Tailwind. Font Size and Font Weight. This is useful if you'd prefer to design for a fixed set of screen sizes instead of trying to accommodate a fully fluid viewport. For more information about Tailwind's responsive design features, check out the Responsive Design documentation. Modular/Composable: Tailwind makes CSS styling really modular as each class does exactly one thing. You can control which variants are generated for the background size utilities by modifying the backgroundSize property in the modules section of your Tailwind config file. And my goal is to compress the css generated, for which I've added the purge key in tailwind.config.js. As w-full is assigned as width: 100%, w-1/2 is width: 50%, hence for 60% we use w-3/5 utility-first css class. /UjQLELdYu0?size=690x720 To control the size of an element's background image at a specific breakpoint, add a {screen}: prefix to any existing background size utility. Compare this to Bootstrap at 22.1kb — Tailwind is 14.3kb heavier. h1 will also be added to the stylesheet as-is. You change, add, or remove these by editing the theme.fontSize section of your Tailwind config. Tailwind CSS v1.0 is here! Learn more -> In comparison, the uncompressed file size of Bootstrap CSS is only 143kB. Proceed to import your index.css file into your app, place the following lines of code in your App.vue file like this: