{"id":56602,"date":"2023-02-06T10:37:51","date_gmt":"2023-02-06T05:07:51","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=56602"},"modified":"2023-02-12T20:55:55","modified_gmt":"2023-02-12T15:25:55","slug":"tailwind-css-learning-for-absolute-beginners","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/tailwind-css-learning-for-absolute-beginners\/","title":{"rendered":"Tailwind CSS: Learning For Absolute Beginners"},"content":{"rendered":"<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-56600 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/tail-1024x349.jpg\" alt=\"\" width=\"625\" height=\"213\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/tail-1024x349.jpg 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/tail-300x102.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/tail-768x262.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/tail-1536x524.jpg 1536w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/tail-2048x699.jpg 2048w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/tail-624x213.jpg 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<h2><strong>What is Tailwind CSS ? <\/strong><\/h2>\n<p>Tailwind CSS is basically a utility-first CSS framework. Rapidly build modern websites without ever leaving your HTML. With utility classes, We can style elements on hover, focus, and more. It is a highly customizable, low-level CSS framework. This CSS framework is packed with classes like flex, pt-4, text-center and rotate-90 etc.. Pull up for p It&#8217;s fast, flexible, and reliable with zero-runtime. Using responsive utility classes.<\/p>\n<h2><strong>Why use Tailwind?<\/strong><\/h2>\n<p>As we previously mentioned, Tailwind CSS eases the frontend work because of its <a href=\"https:\/\/tailwindcss.com\/\">extensive built-in classes<\/a> that you can simply call into any HTML element. So this means you don\u2019t have to leave your HTML file to customize any HTML code. It provides a <a href=\"https:\/\/tailwindcss.com\/docs\/theme\">default theme<\/a> with preset values for the color palette, fonts, breakpoints, spacing, and much more. This theme is also highly customizable.<\/p>\n<p><strong>Powerful &#8211;<\/strong> Makes the styling process faster because of its ready-to-use classes that can be further extended.<br \/>\n<strong>No more Naming &#8211;<\/strong> You don\u2019t have to rack your brain to come up with the aptest class name<br \/>\n<strong>Reusability &#8211;<\/strong> Save your CSS file from bulking up by using and re-using classes.<br \/>\n<strong>Global Warning &#8211;<\/strong> Worry less about breaking the design because you don\u2019t need to make global changes in the CSS file.<br \/>\n<strong>Responsive &#8211;<\/strong> Lets you build complex responsive interfaces with its broad set of utilities and breakpoint prefixes.<br \/>\n<strong>Improved Site Performance<\/strong> &#8211; Cleans out all the unnecessary code from your bulky CSS file. Usually ships less than 10kb of CSS.<\/p>\n<h2>Benefits of Tailwind CSS?<\/h2>\n<p><strong>1. <\/strong>You aren&#8217;t wasting energy inventing class names.<br \/>\n<strong>2.<\/strong> You keep your custom CSS files small.<br \/>\n<strong>3.<\/strong> Maintaining a Tailwind CSS project is much easier than maintaining a large traditional css file Minimum lines of Code in CSS file.<br \/>\n<strong>4.<\/strong> Faster Ul building process.<\/p>\n<h2><strong>Ways to use Tailwind CSS on your Local System<\/strong><\/h2>\n<p><strong>1.\u00a0 Play with CDN<\/strong><\/p>\n<p>Simply add the Play CDN script tag to the of your HTML file, and start using Tailwind\u2019s utility classes to style your content.<\/p>\n<pre><span style=\"font-weight: 400;\">&lt;script<\/span> <span style=\"font-weight: 400;\">src<\/span><span style=\"font-weight: 400;\">=<\/span><span style=\"font-weight: 400;\">\"https:\/\/cdn.tailwindcss.com\"<\/span><span style=\"font-weight: 400;\">&gt;&lt;\/script&gt;<\/span><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-56585\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t1-300x138.png\" alt=\"\" width=\"300\" height=\"138\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t1-300x138.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t1-1024x473.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t1-768x354.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t1-624x288.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t1.png 1298w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>We can add our custom CSS.<\/strong><\/p>\n<p>Edit the tailwind.config object to customize your configuration with your design tokens.<\/p>\n<p>Use type=&#8221;text\/tailwindcss&#8221; to add custom CSS that supports all of Tailwind&#8217;s CSS features.<\/p>\n<div>\n<pre>&lt;style type=\"text\/tailwindcss\"&gt;\r\n\r\n@layerutilities {\r\n\r\n.wrapper {\r\n\r\nmax-width: 1200px;\r\n\r\nmargin: 0auto;\r\n\r\npadding: 020px;\r\n\r\n}\r\n\r\n}\r\n\r\n&lt;\/style&gt;\r\n\r\n&lt;script&gt;\r\n\r\ntailwind.config = {\r\n\r\ntheme: {\r\n\r\nextend: {\r\n\r\ncolors: {\r\n\r\nclifford:'#da373d',\r\n\r\nbtn_color:'green',\r\n\r\n}\r\n\r\n}\r\n\r\n}\r\n\r\n}\r\n\r\n&lt;\/script&gt;<\/pre>\n<\/div>\n<pre><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-56586 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t2-1024x597.png\" alt=\"\" width=\"625\" height=\"364\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t2-1024x597.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t2-300x175.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t2-768x448.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t2-624x364.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t2.png 1158w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/pre>\n<p>In the above example warapper is added to the custom class in the utilities classes and clifford attribute is added in colors object.<\/p>\n<p>Now we can use all the tailwind utility classes and designed layout as the requirement.<\/p>\n<h2><strong>2. Using Tailwind CLI <\/strong><\/h2>\n<p>The simplest and fastest way to get up and running with Tailwind CSS from scratch is with the Tailwind CLI tool. The CLI is also available as a standalone executable if you want to use it without installing Node.js.<\/p>\n<p><strong>Steps to install tailwind css.<\/strong><\/p>\n<p><strong>Step 1:<\/strong> Install the Node.js and npm stable versions.<\/p>\n<pre>$ sudo apt install nodejs -y\r\n$ sudo apt install npm -y<\/pre>\n<p><strong>Step 2:<\/strong> Verify the installed Node.js npm version.<\/p>\n<pre>$ node --version\r\n$ npm --version<\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-56587 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t3-1024x365.png\" alt=\"\" width=\"625\" height=\"223\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t3-1024x365.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t3-300x107.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t3-768x273.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t3-624x222.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t3.png 1236w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><strong>Step 3 :<\/strong> Install Tailwind CSS<\/p>\n<pre>$ npm install -D tailwindcss\r\n$ npx tailwindcss init<\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-56588 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t4-1024x425.png\" alt=\"\" width=\"625\" height=\"259\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t4-1024x425.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t4-300x124.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t4-768x318.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t4-624x259.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t4.png 1307w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><strong>Step 4:<\/strong> Once tailwind Installed we have to configure the template path<br \/>\nIn tailwind.config.js<\/p>\n<div>\n<pre>\/** @type {import('tailwindcss').Config} *\/\r\n\r\nmodule.exports = {\r\n\r\ncontent: [\".\/src\/**\/*.{html,js}\"],\r\n\r\ntheme: {\r\n\r\nextend: {},\r\n\r\n},\r\n\r\nplugins: [],\r\n\r\n}<\/pre>\n<\/div>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-56589 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t5-1024x379.png\" alt=\"\" width=\"625\" height=\"231\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t5-1024x379.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t5-300x111.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t5-768x284.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t5-624x231.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t5.png 1285w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><strong>Step 5:<\/strong> Add the Tailwind directives to your CSS<br \/>\nAdd the @tailwind directives for each of Tailwind\u2019s layers to your main CSS file.<\/p>\n<pre>@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;<\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-56590 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t6-1024x454.png\" alt=\"\" width=\"625\" height=\"277\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t6-1024x454.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t6-300x133.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t6-768x340.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t6-624x277.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t6.png 1196w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><strong>Step 6:<\/strong> Start the Tailwind CLI build process<\/p>\n<p>Run the CLI tool to scan your template files for classes and build your CSS.<\/p>\n<div>\n<pre>npx tailwindcss -i .\/src\/css\/input.css -o .\/public\/css\/styles.css --watch<\/pre>\n<\/div>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-56591 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t7-1024x365.png\" alt=\"\" width=\"625\" height=\"223\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t7-1024x365.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t7-300x107.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t7-768x274.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t7-624x222.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t7.png 1293w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><strong>Step 7:<\/strong> Start using Tailwind in your HTML<\/p>\n<p>Add your compiled CSS file to &lt;head&gt; start using Tailwind\u2019s utility classes to style your content.<\/p>\n<div>\n<pre>&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"..\/public\/css\/style.css\"&gt;<\/pre>\n<\/div>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-56592 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t8-1024x347.png\" alt=\"\" width=\"625\" height=\"212\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t8-1024x347.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t8-300x102.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t8-768x260.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t8-624x211.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t8.png 1297w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><br \/>\nNow we can use all the tailwind utility classes and designed layout as the requirement.<\/p>\n<h2>Customizing Screens<\/h2>\n<p><strong>Customizing the default breakpoints for your project.<\/strong><\/p>\n<p><strong>Configuring custom screens<\/strong><\/p>\n<p>You define your project\u2019s breakpoints in the theme.screens section of your tailwind.config.js file. The keys become your responsive modifiers (like md:text-center), and the values are the min-width where that breakpoint should start.<br \/>\nCommon device resolutions inspire the default breakpoints:<\/p>\n<div>\n<pre>module.exports = {\r\ntheme: {\r\n\r\nscreens: {\r\n\r\n'sm': '640px',\r\n\r\n\/\/ =&gt; @media (min-width: 640px) { ... }\r\n\r\n'md': '768px',\r\n\r\n\/\/ =&gt; @media (min-width: 768px) { ... }\r\n\r\n'lg': '1024px',\r\n\r\n\/\/ =&gt; @media (min-width: 1024px) { ... }\r\n\r\n'xl': '1280px',\r\n\r\n\/\/ =&gt; @media (min-width: 1280px) { ... }\r\n\r\n'2xl': '1536px',\r\n\r\n\/\/ =&gt; @media (min-width: 1536px) { ... }\r\n\r\n}\r\n\r\n}\r\n\r\n}\r\n\r\n<\/pre>\n<\/div>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-56593 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t9-1024x489.png\" alt=\"\" width=\"625\" height=\"298\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t9-1024x489.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t9-300x143.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t9-768x367.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t9-624x298.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t9.png 1240w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><strong>Overriding the defaults<\/strong><\/p>\n<p>To completely replace the default breakpoints, add your custom screens configuration directly under the theme key:<\/p>\n<div>\n<pre>theme: {\r\n\r\nscreens: {\r\n\r\n'sm': '576px',\r\n\r\n\/\/ =&gt; @media (min-width: 576px) { ... }\r\n\r\n'md': '768px',\r\n\r\n\/\/ =&gt; @media (min-width: 768px) { ... }\r\n\r\n'lg': '991px',\r\n\r\n\/\/ =&gt; @media (min-width: 991px) { ... }\r\n\r\n'xl': '1280px',\r\n\r\n\/\/ =&gt; @media (min-width: 1280px) { ... }\r\n\r\n'2xl': '1536px',\r\n\r\n\/\/ =&gt; @media (min-width: 1536px) { ... }\r\n\r\n},\r\n\r\n},<\/pre>\n<\/div>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-56594 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t10-1024x480.png\" alt=\"\" width=\"625\" height=\"293\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t10-1024x480.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t10-300x141.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t10-768x360.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t10-624x292.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t10.png 1223w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<h2><strong>Adding larger breakpoints<\/strong><\/h2>\n<p>If you want to add larger screen size the easiest way to add an additional larger breakpoint is using the extend key:<\/p>\n<div>\n<pre>module.exports = {\r\n\r\ntheme: {\r\n\r\nextend: {\r\n\r\nscreens: {\r\n\r\n'3xl': '1600px',\r\n\r\n},\r\n\r\n},\r\n\r\n},\r\n\r\n}\r\n\r\n<\/pre>\n<\/div>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-56595 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t11-1024x510.png\" alt=\"\" width=\"625\" height=\"311\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t11-1024x510.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t11-300x150.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t11-768x383.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t11-624x311.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t11.png 1208w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<h2>Adding smaller breakpoints<\/h2>\n<p>If you want to add an additional small breakpoint, you can\u2019t use extend because the small breakpoint would be added to the end of the breakpoint list, and breakpoints need to be sorted from smallest to largest in order to work as expected with a min-width breakpoint system.<br \/>\nInstead, override the entire screen key, re-specifying the default breakpoints:<\/p>\n<div>\n<pre>theme: {\r\n\r\nscreens: {\r\n\r\n'smobile': '475px',\r\n\r\n...defaultTheme.screens,\r\n\r\n},\r\n\r\n},\r\n\r\n<\/pre>\n<\/div>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-56596 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t12-1024x461.png\" alt=\"\" width=\"625\" height=\"281\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t12-1024x461.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t12-300x135.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t12-768x346.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t12-624x281.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t12.png 1247w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><strong>Using custom screen names<\/strong><\/p>\n<p>You can name your custom screens whatever you like, and are not limited to following the sm\/md\/lg\/xl\/2xl convention that Tailwind uses by default.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-56597 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t13-1024x502.png\" alt=\"\" width=\"625\" height=\"306\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t13-1024x502.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t13-300x147.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t13-768x377.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t13-624x306.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t13.png 1181w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>In the same way, we can customize <a href=\"https:\/\/tailwindcss.com\/docs\/customizing-colors\">colors<\/a>, <a href=\"https:\/\/tailwindcss.com\/docs\/customizing-spacing\">spacing<\/a> etc.<\/p>\n<h2>Adding Custom Styles<\/h2>\n<p><strong>Using arbitrary values<\/strong><\/p>\n<p>While you can usually build the bulk of a well-crafted design using a constrained set of design tokens, once in a while, you need to break out of those constraints to get things pixel-perfect.<br \/>\nWhen you find yourself really needing something like top: 117px to get a background image in just the right spot, use Tailwind\u2019s square bracket notation to generate a class on the fly with any arbitrary value:<\/p>\n<div>\n<pre>&lt;div class=\"top-[117px]\"&gt;\r\n\r\n&lt;!-- ... --&gt;\r\n\r\n&lt;\/div&gt;<\/pre>\n<\/div>\n<p><strong>Adding component classes<\/strong><\/p>\n<p>Use the components layer for any more complicated classes you want to add to your project that you\u2019d still like to be able to override with utility classes.<br \/>\nTraditionally these would be classes like card, btn, badge \u2014 that kind of thing.<\/p>\n<div>\n<pre>@layer components {\r\n\r\n.card {\r\n\r\nbackground-color: theme('colors.white');\r\n\r\nborder-radius: theme('borderRadius.lg');\r\n\r\npadding: theme('spacing.6');\r\n\r\nbox-shadow: theme('boxShadow.xl');\r\n\r\n}\r\n\r\n\/* ... *\/\r\n\r\n}\r\n\r\n<\/pre>\n<\/div>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-56598 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t14-1024x471.png\" alt=\"\" width=\"625\" height=\"287\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t14-1024x471.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t14-300x138.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t14-768x353.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t14-624x287.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t14.png 1269w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><strong>Adding custom utilities<\/strong><\/p>\n<p>Add any of your own custom utility classes to Tailwind\u2019s utility layer:<\/p>\n<div>\n<pre>@layer utilities {\r\n\r\n.wrapper {\r\n\r\nmax-width: 1200px;\r\n\r\nmargin: 0 auto;\r\n\r\npadding: 0 20px;\r\n\r\n}\r\n\r\n}<\/pre>\n<\/div>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-56599 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t15-1024x476.png\" alt=\"\" width=\"625\" height=\"291\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/01\/t15-1024x476.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t15-300x139.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t15-768x357.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t15-624x290.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/01\/t15.png 1229w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>For more exploration, you can go through\u00a0<a href=\"https:\/\/tailwindcss.com\/docs\/installation\"> here<\/a><\/p>\n<p>Thanks for reading this article, Hope, you will find this helpful.<\/p>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>What is Tailwind CSS ? Tailwind CSS is basically a utility-first CSS framework. Rapidly build modern websites without ever leaving your HTML. With utility classes, We can style elements on hover, focus, and more. It is a highly customizable, low-level CSS framework. This CSS framework is packed with classes like flex, pt-4, text-center and rotate-90 [&hellip;]<\/p>\n","protected":false},"author":1546,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":35},"categories":[3429],"tags":[4862,4860,4857,2591],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/56602"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1546"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=56602"}],"version-history":[{"count":2,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/56602\/revisions"}],"predecessor-version":[{"id":56704,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/56602\/revisions\/56704"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=56602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=56602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=56602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}