<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Majid Behzadnasab</title>
    <description>The latest articles on DEV Community by Majid Behzadnasab (@mbehzadbhz).</description>
    <link>https://dev.to/mbehzadbhz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1122989%2F408528eb-0282-4f58-adbb-b024be3ce8e2.jpeg</url>
      <title>DEV Community: Majid Behzadnasab</title>
      <link>https://dev.to/mbehzadbhz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mbehzadbhz"/>
    <language>en</language>
    <item>
      <title>Tailwind CSS Plugin for Optimizing Bootstrap Grid</title>
      <dc:creator>Majid Behzadnasab</dc:creator>
      <pubDate>Wed, 19 Jul 2023 20:43:36 +0000</pubDate>
      <link>https://dev.to/mbehzadbhz/tailwind-css-plugin-for-optimizing-bootstrap-grid-23jh</link>
      <guid>https://dev.to/mbehzadbhz/tailwind-css-plugin-for-optimizing-bootstrap-grid-23jh</guid>
      <description>&lt;p&gt;Tailwind CSS is a highly customizable, low-level CSS framework that gives you all the building blocks you need to build bespoke designs. However, one thing that Tailwind doesn't directly provide out of the box is a robust grid system like the one Bootstrap has.&lt;/p&gt;

&lt;p&gt;Bootstrap's grid system, powered by flexbox, has a twelve-column system, five default responsive tiers, and a mobile-first system. Tailwind CSS, on the other hand, uses CSS Grids which technically can have however many columns and responsive tiers you'd like to have, offering more flexibility and customizability.&lt;/p&gt;

&lt;p&gt;So, how do you bring the Bootstrap-like grid system into Tailwind CSS? That's where our plugin, tw-bootstrap-grid-optimizer, comes into play.&lt;/p&gt;

&lt;p&gt;This plugin aims to bridge the gap between the grid system of Bootstrap and the utility classes of Tailwind CSS. With tw-bootstrap-grid-optimizer, you can manage your grid system in Tailwind just like you would in Bootstrap.&lt;/p&gt;

&lt;p&gt;github: &lt;a href="https://github.com/mbehzad-bhz/tw-bootstrap-grid-optimizer"&gt;https://github.com/mbehzad-bhz/tw-bootstrap-grid-optimizer&lt;/a&gt;&lt;br&gt;
npm: &lt;a href="https://www.npmjs.com/package/tw-bootstrap-grid-optimizer"&gt;https://www.npmjs.com/package/tw-bootstrap-grid-optimizer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How to use it?&lt;br&gt;
Firstly, install the plugin via npm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i tw-bootstrap-grid-optimizer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, include it in your Tailwind CSS configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const withMT = require("@material-tailwind/react/utils/withMT");

module.exports = withMT({
  content: ['./src/**/*.{js,jsx,ts,tsx,css,scss}', './index.html'],
  darkMode: 'media',
  development: true,
  mode: "jit",
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [
    require('tw-bootstrap-grid-optimizer')
  ],
});

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you are ready to use Bootstrap-like classes in your Tailwind project. Let's look at a simple example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function App() {
    return (
        &amp;lt;&amp;gt;
            &amp;lt;div className="container bg-red-600 text-center"&amp;gt;
                &amp;lt;div className="row"&amp;gt;
                    &amp;lt;div className="sm:col-6 md:col-4"&amp;gt;Column 1&amp;lt;/div&amp;gt;
                    &amp;lt;div className="sm:col-6 md:col-4"&amp;gt;Column 2&amp;lt;/div&amp;gt;
                    &amp;lt;div className="sm:col-6 md:col-4"&amp;gt;Column 3&amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/&amp;gt;
    )
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the plugin, you are not only limited to simple designs, but you can also manage more complex layouts. Here is an example with a table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function App() {
  return (
    &amp;lt;div className="container"&amp;gt;
      &amp;lt;div className="row"&amp;gt;
        &amp;lt;div className="sm:col-12 md:col-8"&amp;gt;
          &amp;lt;table className="table-auto w-full"&amp;gt;
            &amp;lt;thead&amp;gt;
              &amp;lt;tr&amp;gt;
                &amp;lt;th className="border px-4 py-2"&amp;gt;Name&amp;lt;/th&amp;gt;
                &amp;lt;th className="border px-4 py-2"&amp;gt;Age&amp;lt;/th&amp;gt;
                &amp;lt;th className="border px-4 py-2"&amp;gt;Email&amp;lt;/th&amp;gt;
              &amp;lt;/tr&amp;gt;
            &amp;lt;/thead&amp;gt;
            &amp;lt;tbody&amp;gt;
              &amp;lt;tr&amp;gt;
                &amp;lt;td className="border px-4 py-2"&amp;gt;John Doe&amp;lt;/td&amp;gt;
                &amp;lt;td className="border px-4 py-2"&amp;gt;30&amp;lt;/td&amp;gt;
                &amp;lt;td className="border px-4 py-2"&amp;gt;john@example.com&amp;lt;/td&amp;gt;
              &amp;lt;/tr&amp;gt;
              &amp;lt;tr&amp;gt;
                &amp;lt;td className="border px-4 py-2"&amp;gt;Jane Doe&amp;lt;/td&amp;gt;
                &amp;lt;td className="border px-4 py-2"&amp;gt;25&amp;lt;/td&amp;gt;
                &amp;lt;td className="border px-4 py-2"&amp;gt;jane@example.com&amp;lt;/td&amp;gt;
              &amp;lt;/tr&amp;gt;
            &amp;lt;/tbody&amp;gt;
          &amp;lt;/table&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div className="md:col-4 hidden sm:block"&amp;gt;
          &amp;lt;div className="p-4 bg-blue-300"&amp;gt;Sidebar content here&amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With tw-bootstrap-grid-optimizer, your Tailwind CSS projects can now leverage the simplicity and familiarity of Bootstrap's grid system, making your development process even more efficient and enjoyable. Give it a try today!&lt;/p&gt;

&lt;p&gt;Please feel free to adjust the content as per your requirements.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
