{"id":382357,"date":"2023-05-18T09:03:42","date_gmt":"2023-05-18T09:03:42","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=382357"},"modified":"2026-01-30T06:29:27","modified_gmt":"2026-01-30T06:29:27","slug":"how-to-use-tailwind-css-in-magento-2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/","title":{"rendered":"How to use Tailwind.css in Magento 2"},"content":{"rendered":"\n<p><strong>Tailwind CSS<\/strong> is a modern, utility-first CSS framework that enables developers to build responsive and visually consistent user interfaces with minimal custom styling.<\/p>\n\n\n\n<p>In Magento 2, integrating <strong>Tailwind CSS<\/strong> can significantly simplify frontend styling, especially when building custom features, modules, or UI components.<\/p>\n\n\n\n<p>Whether you want to enhance performance, reduce unused CSS, or maintain a modular design approach, Tailwind provides a flexible and efficient solution.<\/p>\n\n\n\n<p>This output file is a static CSS asset that contains styles strictly used in your templates, resulting in a smaller and more optimized stylesheet.<\/p>\n\n\n\n<p>By eliminating unused CSS, Tailwind improves frontend performance and keeps styling lightweight, which is especially beneficial for modular architectures like <a href=\"https:\/\/store.webkul.com\/Magento-2.html\">Magento 2 custom<\/a> modules.<\/p>\n\n\n\n<p><strong>Work with Tailwind CSS from scratch via CLI command:<\/strong><\/p>\n\n\n\n<p>Install npm and set up its environment. Then install Tailwind CSS via the command line:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">npm install -D tailwindcss@3<\/pre>\n\n\n\n<p>Now check the presence of Tailwind in your environment via the command line :<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">npm info tailwindcss version<\/pre>\n\n\n\n<p>The above command will give you the stable version of the installed Tailwind CSS.<\/p>\n\n\n\n<p><strong>Now,<\/strong> how to use <strong>Tailwind in a custom plugin in Magento.<\/strong><\/p>\n\n\n\n<p>Create a <a href=\"https:\/\/webkul.com\/blog\/create-hello-module-in-magento2\/\">custom module in Magento 2<\/a>. After that, create the configuration file for Tailwind inside the js directory for any scope. This can be achieved via the command line.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">npx tailwindcss init app\/code\/Webkul\/TailwindTest\/view\/frontend\/web\/js\/tailwindcss-config.js<\/pre>\n\n\n\n<p>This will create the tailwindcss-config.js file in the JS directory in the front-end scope.<\/p>\n\n\n\n<p>This file provides the path of the template files for the content key:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"662\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config-1200x662.png\" alt=\"Config\" class=\"wp-image-382378\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config-1200x662.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config-300x166.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config-250x138.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config-768x424.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config-1536x848.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config.png 1837w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Now, manage the classes in the template files:<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;h1 class=&quot;text-3xl font-bold underline&quot;&gt;\n    Hello world!\n&lt;\/h1&gt;\n&lt;br&gt;\n&lt;button class=&quot;text-white font-semibold bg-blue-500 hover:bg-blue-700\n               border-blue-700 border-b hover:border-indigo-900 \n               transition-all px-6 py-2 rounded-full&quot;&gt;\n  Click To Wonder!\n&lt;\/button&gt;\n&lt;br&gt;&lt;br&gt;&lt;br&gt;\n&lt;h1 class=&quot;text-3xl font-bold underline&quot;&gt;\n    Content Display\n&lt;\/h1&gt;\n&lt;figure class=&quot;md:flex bg-slate-100 rounded-xl p-8 md:p-0 dark:bg-slate-800&quot;&gt;\n  &lt;img class=&quot;w-24 h-24 md:w-48 md:h-auto md:rounded-none rounded-full mx-auto&quot; \n  src=&quot;&lt;?= $this-&gt;getViewFileUrl(&#039;Webkul_TailwindTest::images\/img.jpg&#039;);?&gt;&quot; alt=&quot;&quot; width=&quot;384&quot; height=&quot;512&quot;&gt;\n  &lt;div class=&quot;pt-6 md:p-8 text-center md:text-left space-y-4&quot;&gt;\n    &lt;blockquote&gt;\n      &lt;p class=&quot;text-lg font-medium&quot;&gt;\n        \u201cTailwind CSS is the only framework that I&#039;ve seen scale\n        on large teams. It\u2019s easy to customize, adapts to any design,\n        and the build size is tiny.\u201d\n      &lt;\/p&gt;\n    &lt;\/blockquote&gt;\n    &lt;figcaption class=&quot;font-medium&quot;&gt;\n      &lt;div class=&quot;text-sky-500 dark:text-sky-400&quot;&gt;\n        John Doe\n      &lt;\/div&gt;\n      &lt;div class=&quot;text-slate-700 dark:text-slate-500&quot;&gt;\n        Software Engineer, XYZ\n      &lt;\/div&gt;\n    &lt;\/figcaption&gt;\n  &lt;\/div&gt;\n&lt;\/figure&gt;<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"660\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/template-1200x660.png\" alt=\"template\" class=\"wp-image-382379\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/template-1200x660.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/template-300x165.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/template-250x138.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/template-768x422.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/template-1536x845.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/template.png 1838w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Now, create the input.css file in view\/frontend\/web\/css\/input.css. And write the content below.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">@tailwind base;\n\n@tailwind components;\n\n@tailwind utilities;<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"660\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/input-1200x660.png\" alt=\"input\" class=\"wp-image-382380\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/input-1200x660.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/input-300x165.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/input-250x138.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/input-768x422.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/input-1536x845.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/input.png 1838w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>This file contains the&nbsp;<a href=\"https:\/\/tailwindcss.com\/docs\/functions-and-directives#layer\"><strong><code>@tailwind<\/code>&nbsp;directives<\/strong><\/a> that will place each of Tailwind\u2019s layers into your main CSS file.<\/p>\n\n\n\n<p>After processing all configured templates, Tailwind generates a final output file that contains the corresponding CSS styles.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">For this run, the CLI command<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\">npx tailwindcss -c app\/code\/Webkul\/TailwindTest\/view\/frontend\/web\/js\/tailwindcss-config.js -i app\/code\/Webkul\/TailwindTest\/view\/frontend\/web\/css\/input.css -o app\/code\/Webkul\/TailwindTest\/view\/frontend\/web\/css\/output.css<\/pre>\n\n\n\n<p>It generates the output.css at app\/code\/Webkul\/TailwindTest\/view\/frontend\/web\/css\/output.css<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"611\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Unmini-1200x611.png\" alt=\"Unmini\" class=\"wp-image-382416\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Unmini-1200x611.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Unmini-300x153.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Unmini-250x127.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Unmini-768x391.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Unmini-1536x782.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Unmini.png 1838w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>The content displayed in the snapshot is automatically minified and generated using command-line tools.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"660\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/output-1200x660.png\" alt=\"output\" class=\"wp-image-382382\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/output-1200x660.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/output-300x165.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/output-250x138.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/output-768x422.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/output-1536x845.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/output.png 1838w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<pre class=\"EnlighterJSRAW\">npx tailwindcss -o app\/code\/Webkul\/TailwindTest\/view\/frontend\/web\/css\/output.css --minify<\/pre>\n\n\n\n<p>Now we can use this CSS inside the layout file as managed via Magento.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"660\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/templatesss-1200x660.png\" alt=\"templatesss\" class=\"wp-image-382385\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/templatesss-1200x660.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/templatesss-300x165.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/templatesss-250x138.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/templatesss-768x422.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/templatesss-1536x845.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/templatesss.png 1838w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Now run the front-end on route test\/test\/index, corresponding to the layout:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"611\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/doe-1200x611.png\" alt=\"doe\" class=\"wp-image-382433\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/doe-1200x611.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/doe-300x153.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/doe-250x127.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/doe-768x391.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/doe-1536x782.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/doe.png 1838w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>For more reference, <a href=\"https:\/\/tailwindcss.com\/docs\/installation\">https:\/\/tailwindcss.com\/docs\/installation<\/a><\/p>\n\n\n\n<p>If you require technical support, feel free to email us at&nbsp;<a href=\"mailto:support@webkul.com\">support@webkul.com<\/a><\/p>\n\n\n\n<p>Additionally, explore a wide array of solutions to boost your store\u2019s capabilities by visiting our&nbsp;<a href=\"https:\/\/store.webkul.com\/Magento-2.html\" target=\"_blank\" rel=\"noreferrer noopener\">Adobe Commerce modules section<\/a>&nbsp;and&nbsp;<a href=\"https:\/\/store.webkul.com\/Magento-2\/Marketplace-Addons.html\" target=\"_blank\" rel=\"noreferrer noopener\">Adobe Commerce marketplace addons<\/a>.<\/p>\n\n\n\n<p>Or looking to improve your store\u2019s speed and overall performance? Check out our&nbsp;<a href=\"https:\/\/webkul.com\/magento-speed-optimization-services\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 Speed &amp; Optimization services<\/a>.<\/p>\n\n\n\n<p>Get expert support and build&nbsp;<a href=\"https:\/\/webkul.com\/blog\/magento-customization\/\" target=\"_blank\" rel=\"noreferrer noopener\">customized solutions<\/a>&nbsp;by hiring skilled&nbsp;<a href=\"https:\/\/webkul.com\/hire-magento-developers\/\" target=\"_blank\" rel=\"noreferrer noopener\">Adobe Commerce developers<\/a>&nbsp;for your project.<\/p>\n\n\n\n<p>Thanks &amp; Happy Coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tailwind CSS is a modern, utility-first CSS framework that enables developers to build responsive and visually consistent user interfaces with minimal custom styling. In Magento 2, integrating Tailwind CSS can significantly simplify frontend styling, especially when building custom features, modules, or UI components. Whether you want to enhance performance, reduce unused CSS, or maintain a <a href=\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":277,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-382357","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to use Tailwind.css in Magento 2 - Webkul Blog<\/title>\n<meta name=\"description\" content=\"Tailwind CSS scanned all your html files, templates files and JavaScript components for class names and in result it generates\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to use Tailwind.css in Magento 2 - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Tailwind CSS scanned all your html files, templates files and JavaScript components for class names and in result it generates\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-18T09:03:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-30T06:29:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config-1200x662.png\" \/>\n<meta name=\"author\" content=\"Akash Rajput\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Akash Rajput\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/\"},\"author\":{\"name\":\"Akash Rajput\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/9831fa86f42528fdcf494b59ff6cf6e2\"},\"headline\":\"How to use Tailwind.css in Magento 2\",\"datePublished\":\"2023-05-18T09:03:42+00:00\",\"dateModified\":\"2026-01-30T06:29:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/\"},\"wordCount\":458,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config-1200x662.png\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/\",\"name\":\"How to use Tailwind.css in Magento 2 - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config-1200x662.png\",\"datePublished\":\"2023-05-18T09:03:42+00:00\",\"dateModified\":\"2026-01-30T06:29:27+00:00\",\"description\":\"Tailwind CSS scanned all your html files, templates files and JavaScript components for class names and in result it generates\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config.png\",\"width\":1837,\"height\":1014,\"caption\":\"Config\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use Tailwind.css in Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/9831fa86f42528fdcf494b59ff6cf6e2\",\"name\":\"Akash Rajput\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c7618982141d5bb19bbb0abea082fba6c06a2041a254b738d9132ec7f9c1bc20?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c7618982141d5bb19bbb0abea082fba6c06a2041a254b738d9132ec7f9c1bc20?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Akash Rajput\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/akash-rajput648\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to use Tailwind.css in Magento 2 - Webkul Blog","description":"Tailwind CSS scanned all your html files, templates files and JavaScript components for class names and in result it generates","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/","og_locale":"en_US","og_type":"article","og_title":"How to use Tailwind.css in Magento 2 - Webkul Blog","og_description":"Tailwind CSS scanned all your html files, templates files and JavaScript components for class names and in result it generates","og_url":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-05-18T09:03:42+00:00","article_modified_time":"2026-01-30T06:29:27+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config-1200x662.png","type":"","width":"","height":""}],"author":"Akash Rajput","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Akash Rajput","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/"},"author":{"name":"Akash Rajput","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/9831fa86f42528fdcf494b59ff6cf6e2"},"headline":"How to use Tailwind.css in Magento 2","datePublished":"2023-05-18T09:03:42+00:00","dateModified":"2026-01-30T06:29:27+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/"},"wordCount":458,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config-1200x662.png","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/","url":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/","name":"How to use Tailwind.css in Magento 2 - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config-1200x662.png","datePublished":"2023-05-18T09:03:42+00:00","dateModified":"2026-01-30T06:29:27+00:00","description":"Tailwind CSS scanned all your html files, templates files and JavaScript components for class names and in result it generates","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/Config.png","width":1837,"height":1014,"caption":"Config"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-magento-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to use Tailwind.css in Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/9831fa86f42528fdcf494b59ff6cf6e2","name":"Akash Rajput","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c7618982141d5bb19bbb0abea082fba6c06a2041a254b738d9132ec7f9c1bc20?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c7618982141d5bb19bbb0abea082fba6c06a2041a254b738d9132ec7f9c1bc20?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Akash Rajput"},"url":"https:\/\/webkul.com\/blog\/author\/akash-rajput648\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/382357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/277"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=382357"}],"version-history":[{"count":12,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/382357\/revisions"}],"predecessor-version":[{"id":524330,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/382357\/revisions\/524330"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=382357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=382357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=382357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}