<?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>Forem: Shubam Bhasin</title>
    <description>The latest articles on Forem by Shubam Bhasin (@shubambhasin).</description>
    <link>https://forem.com/shubambhasin</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%2F546848%2F5ec8d789-f45c-45f9-8901-16bbc8c160fc.jpeg</url>
      <title>Forem: Shubam Bhasin</title>
      <link>https://forem.com/shubambhasin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/shubambhasin"/>
    <language>en</language>
    <item>
      <title>Lazy Load you React Components</title>
      <dc:creator>Shubam Bhasin</dc:creator>
      <pubDate>Sat, 10 Jul 2021 15:52:28 +0000</pubDate>
      <link>https://forem.com/shubambhasin/lazy-load-you-react-components-16j8</link>
      <guid>https://forem.com/shubambhasin/lazy-load-you-react-components-16j8</guid>
      <description>&lt;p&gt;Make your React websites load faster&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Lazy Loading ?
&lt;/h2&gt;

&lt;p&gt;Lazy loading in React is the technique that is used in  optimizing out web and mobile apps.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it Works ?
&lt;/h2&gt;

&lt;p&gt;This technique uses a method that renders only very important or critical user components in the first, rather then loading the whole website at once and then rendering the non-essential components later.&lt;/p&gt;

&lt;p&gt;As we write more and more code, as we write more and more components, the size of the application grows significantly bigger and it starts hindering the websites performance because now the bundle size has been increased. This makes the app look slow and chunky and hence directly lead to bad user experience.&lt;/p&gt;

&lt;p&gt;So to avoid all the hiccups that I explained above Lazy loading is a Savior to avoid all this and has many other advantages.&lt;/p&gt;

&lt;p&gt;There are a couple of benefits of lazy loading&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Faster load times for apps/websites&lt;/li&gt;
&lt;li&gt;Saving data or bandwidth&lt;/li&gt;
&lt;li&gt;System resources  are saved both on the client and server-side.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;**Note&lt;/em&gt;&lt;em&gt;: Loading all the components even when they have no use in the UI right now is wastage of bandwidth and resources. So its better if the content is asked/delivered only when required. Thats why Lazy loading makes sense.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I have my personal portfolio at &lt;a href="https://shubambhasinv2.netlify.app"&gt;Shubam Bhasin&lt;/a&gt; that uses Lazy loading, just have a look the the bundle size its so small that website loads up quickly.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Okay ! Enough talking lets write some code&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Official Reference*&lt;strong&gt;: &lt;a href="https://reactjs.org/docs/code-splitting.html#reactlazy"&gt;React Lazy Loading&lt;/a&gt;&lt;/strong&gt;*&lt;/p&gt;

&lt;p&gt;The React.lazy() function lets you render a dynamic import as a regular component.&lt;/p&gt;

&lt;p&gt;e.g.,&lt;/p&gt;

&lt;p&gt;Before Lazy()&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;OtherComponent&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./OtherComponent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;after Lazy()&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;OtherComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lazy&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./OtherComponent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You just have to add React.lazy() and then pass the import statement as a call back and half of it is done&lt;/p&gt;

&lt;p&gt;Here is small little catch&lt;/p&gt;

&lt;p&gt;All thee lazy components should be rendered in a &lt;strong&gt;&lt;em&gt;Suspense&lt;/em&gt;&lt;/strong&gt; component, which allows to show some regular react component before loading the lazy compoennt like a Loading screen etc&lt;/p&gt;

&lt;p&gt;e.g.,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Suspense&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;OtherComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lazy&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./OtherComponent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Suspense&lt;/span&gt; &lt;span class="na"&gt;fallback&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Loading...&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;OtherComponent&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Suspense&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can even wrap multiple lazy components with a single Suspense component, just like below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Suspense&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;OtherComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lazy&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./OtherComponent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;AnotherComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lazy&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./AnotherComponent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Suspense&lt;/span&gt; &lt;span class="na"&gt;fallback&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Loading...&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;section&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;OtherComponent&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
          &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;AnotherComponent&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;section&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Suspense&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Sometimes it can happen that the component fails to load, then what ?
&lt;/h3&gt;

&lt;p&gt;React.lazy do support error boundaries.&lt;/p&gt;

&lt;p&gt;You can handle these errors to show a nice user experience and manage recovery with Error Boundaries. Once you’ve created your Error Boundary, you can use it anywhere above your lazy components to display an error state when there’s a network error.&lt;/p&gt;

&lt;p&gt;e.g.,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Suspense&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;MyErrorBoundary&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./MyErrorBoundary&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;OtherComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lazy&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./OtherComponent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;AnotherComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lazy&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./AnotherComponent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;MyErrorBoundary&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Suspense&lt;/span&gt; &lt;span class="na"&gt;fallback&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Loading...&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;section&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;OtherComponent&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
          &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;AnotherComponent&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;section&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Suspense&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;MyErrorBoundary&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will lead to a better user experience.&lt;/p&gt;

&lt;p&gt;This was Lazy loading in React 🔥🔥&lt;/p&gt;

&lt;p&gt;See you lazy loading component in your apps/websites&lt;/p&gt;

</description>
      <category>performance</category>
      <category>optimization</category>
      <category>react</category>
    </item>
    <item>
      <title>Using styled-components with React</title>
      <dc:creator>Shubam Bhasin</dc:creator>
      <pubDate>Fri, 09 Jul 2021 17:56:34 +0000</pubDate>
      <link>https://forem.com/shubambhasin/using-styled-components-with-react-46d7</link>
      <guid>https://forem.com/shubambhasin/using-styled-components-with-react-46d7</guid>
      <description>&lt;p&gt;Well, we all love CSS, we all love JavaScript and we all love React. What if someone tells you that now you can create full-fledged Components ( e.g., a button, a navbar, a tile, etc ) while writing React code using CSS in a very easy handy way.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does a styled component looks like ?
&lt;/h2&gt;

&lt;p&gt;Just like this 👇&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="s2"&gt;`
  /* This renders the buttons above... Edit me! */
  display: inline-block;
  border-radius: 3px;
  padding: 0.5rem 0;
  margin: 0.5rem 1rem;
  width: 11rem;
  background: transparent;
  color: white;
  border: 2px solid white;
`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And how do we use it? Is it even simple? Yes, you guessed it right,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Writing this will give you a separate button component of the CSS properties &lt;/span&gt;
&lt;span class="c1"&gt;//mentioned above&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Big Button&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ain't it easy? Now you can use this button anywhere without writing any separate class or anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's dive a little deeper
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why Styled Components?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Automatic vendor prefixing:&lt;/strong&gt; You can use standard CSS properties, and styled-components will add vendor prefixes should they be needed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unique class names:&lt;/strong&gt; Styled components are independent of each other, and you do not have to worry about their names because the library handles that for you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Elimination of dead styles:&lt;/strong&gt; Styled components removes unused styles, even if they’re declared in your code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;It is super easy. You can do it through a &lt;a href="https://styled-components.com/docs/basics#installation"&gt;CDN&lt;/a&gt; or with a package manager like yarn or npm…&lt;/p&gt;

&lt;p&gt;for &lt;strong&gt;&lt;em&gt;npm&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// npm&lt;/span&gt;
&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;I&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;components&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;with &lt;strong&gt;&lt;em&gt;yarn&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;yarn&lt;/span&gt; &lt;span class="nx"&gt;add&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;components&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Let's learn the syntax now
&lt;/h3&gt;

&lt;p&gt;If I go a little precise, styled-components use Javascript's template literals to bridge the gap between components and the styles. So, technically when we write a styled component, we are actually writing React components with styles. &lt;/p&gt;

&lt;p&gt;Let's see an example now.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Styled component named StyledButton&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;OrangeButton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="s2"&gt;`
  background-color: orange;
  font-size: 1.5rem;
  color: white;
    border-radius: 5px;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// nothing special here, works just like a normal react component.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;SomeReactComponents&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;OrangeButton&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; Login &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;OrangeButton&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we know that whatever we write with styled components, in reality, is a React component. So a React component is definitely incomplete without props.&lt;/p&gt;

&lt;p&gt;Yes we can use props with styled components 😍🔥🔥&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's learn how to do that
&lt;/h3&gt;

&lt;p&gt;For example, we need a button, but the button's color is coming from the database or it is dynamic or dependent on some other component, how will we use that in &lt;strong&gt;&lt;em&gt;styled-components&lt;/em&gt;&lt;/strong&gt;? Obviously using props.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;DynamicButton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="s2"&gt;`

  font-size: 1.5rem;
  color: white;
    border-radius: 5px;
                                        //props                                                             
  background-color: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bg&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;red&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;red&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;green&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="s2"&gt;`;

function SomeReactComponent() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;DynamicButton bg="Red"&amp;gt;Red button&amp;lt;/DynamicButton&amp;gt;
      &amp;lt;DynamicButton bg="Green"&amp;gt;Green button&amp;lt;/DynamicButton&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So we pass a &lt;strong&gt;&lt;em&gt;bg&lt;/em&gt;&lt;/strong&gt; in props and if you pay a little attention &lt;strong&gt;&lt;em&gt;${props}&lt;/em&gt;&lt;/strong&gt; is used because styled components use JavaScript's template literals.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tip
&lt;/h2&gt;

&lt;p&gt;We can keep styles in a separate file with export statements and just simply import them wherever we want to use them.&lt;/p&gt;

&lt;p&gt;That's Styled components !!&lt;/p&gt;

&lt;h2&gt;
  
  
  Pros
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reusable&lt;/strong&gt; – just as the normal React components, you can make small reusable pieces of code and avoid code duplication. Typical use cases are buttons, tables, forms, etc.&lt;/li&gt;
&lt;li&gt;Writing pure CSS – оne of the biggest advantages of Styled components in comparison to other styling solutions in React. You don’t use weird syntax and write the CSS as a JavaScript object. Inside the template literals, you write SCSS or plain CSS.&lt;/li&gt;
&lt;li&gt;Dynamic styling – Using props, you can have dynamic values, which gives you a high level of flexibility by avoiding writing duplicated styles.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cons
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The only con I see is while debugging something in chrome dev tools. We see weird class names and hence it is difficult to find what class is doing what. Other than this I find them super lit.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;See you using styled components 😁&lt;/p&gt;

</description>
      <category>styledcomponents</category>
      <category>css</category>
      <category>react</category>
    </item>
    <item>
      <title>Vanilla CSS VS CSS Frameworks</title>
      <dc:creator>Shubam Bhasin</dc:creator>
      <pubDate>Mon, 14 Jun 2021 16:39:41 +0000</pubDate>
      <link>https://forem.com/shubambhasin/vanilla-css-vs-css-frameworks-3ol7</link>
      <guid>https://forem.com/shubambhasin/vanilla-css-vs-css-frameworks-3ol7</guid>
      <description>&lt;p&gt;If you are a beginner, someone who is just starting with web development. You must be exploring lots of resources from where you can learn building lots of awesome stuff. You may or may not have been adviced by your friends to start using Bootstrap, Material-UI, PureCSS etc etc. What are the perks of using them how you can quickly setup up everything with few lines of code. No doubt since you are a beginner you might start doing that. So,&lt;/p&gt;

&lt;p&gt;⚠⚠&lt;strong&gt;Please stop ! Dont do that.&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Behind the scenes
&lt;/h1&gt;

&lt;p&gt;3 years ago when I started my journey in Web Development. This was something I was totally confused in, should I learn CSS from scratch or should I just learn small little basics and jump into those eye catching, luring CSS frameworks. &lt;br&gt;
I was totally a noob in Web technologies ( although had decent knowledge of C, C++ ). Still it was difficult to choose. One one hand I had to learn the concepts like padding, margins, how to make a button beautiful and on the other hand &lt;em&gt;**Bootstrap *&lt;/em&gt;&lt;em&gt;was giving a small class &lt;br&gt;
*&lt;/em&gt;&lt;em&gt;"btn btn-success"&lt;/em&gt;** to create a awesome professional looking button like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1623664588094%2FOdU_XjGYD.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1623664588094%2FOdU_XjGYD.png" alt="k0Udi.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;button class="btn btn-success"&amp;gt;Beautiful button&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and the button I knew about looked like this &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1623664707563%2FVUybsfl--.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1623664707563%2FVUybsfl--.png" alt="HTML2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For obvious reasons I choose Bootstrap over vanilla CSS and now making a Navbar was a piece of cake, copy the boilerplate code from bootstrap website and get your work done 😁. Obviously I enjoyed building websites, components with such an ease but when it came to explaining stuff to other peoplem like how its done what is happening behind the scenes I almost knew nothing. I lacked basic understanding of things.&lt;/p&gt;

&lt;h1&gt;
  
  
  Thing I learned from this
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Because I chose a framework directly, I lacked basic understanding of CSS&lt;/li&gt;
&lt;li&gt;I was not even familiar with basic concepts of flex-box, grids, transitions etc.&lt;/li&gt;
&lt;li&gt;I got over confident of the things I knew nothing about.&lt;/li&gt;
&lt;li&gt;Obviously I regreted that decision later.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Fast forward 3 years. Now I dont need any framework to build anything, I can create thing from scratch. ( Yes I learnt everything from 0 again )&lt;/p&gt;

&lt;h1&gt;
  
  
  CSS Frameworks VS Vanilla CSS
&lt;/h1&gt;

&lt;p&gt;Short answer&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You might have heard about learning by doing, probably thats the case with CSS too, if you write your own styles without taking help from any framework surely you will learn it in a better way.&lt;/li&gt;
&lt;li&gt;You have full control on the things happening on the page, because you wrote it in your way, no framework is interfering with padding, margins width etc.
On the other hand: &lt;/li&gt;
&lt;li&gt;CSS frameworks makes work faster&lt;/li&gt;
&lt;li&gt;Boilerplate code keeps things at ease, if stuck you can refer documentation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Long Answer:&lt;/p&gt;

&lt;h1&gt;
  
  
  Vanilla CSS
&lt;/h1&gt;

&lt;p&gt;If you are a beginner basic under of CSS is very important. It is very much important to know what is happening on the page, how the content is flowing on the page, how the elements are adjusting themselves according to the space available, what is box model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Frameworks don't teach you all of that.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;As a beginner its okay to write a code that is not optimized. Its okay that your &lt;code&gt;button&lt;/code&gt; doesn't look professional. All of that will come over time. So learn the basics first and most importantly dont get intimidated by looking at the code that a professional wrote. You will be writing that one day may be better. &lt;strong&gt;So basics first !!!!!!!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros of using Vanilla CSS&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You know how things work, how padding works, what is &lt;code&gt;box-sizing: border-box&lt;/code&gt; etc.&lt;/li&gt;
&lt;li&gt;Control over all the styles.&lt;/li&gt;
&lt;li&gt;Better customization.&lt;/li&gt;
&lt;li&gt;You can put your design to reality.&lt;/li&gt;
&lt;li&gt;You can take inspiration from a design and implement it.&lt;/li&gt;
&lt;li&gt;You dont have to be dependent on someone else from changes in your styling.&lt;/li&gt;
&lt;li&gt;You will learn the best coding practices while writing it. &lt;/li&gt;
&lt;li&gt;You might learn new and better way of doing the same thing over time.&lt;/li&gt;
&lt;li&gt;Will definitely help you become a better &lt;em&gt;web developer&lt;/em&gt; over time&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;*Once you master your CSS skills you can infact create your own framework for you personel toy projects. Btw I have made one, you can check it at  &lt;a href="https://easecss.netlify.app" rel="noopener noreferrer"&gt;EaseCSS&lt;/a&gt; *&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cons of using CSS Frameworks&lt;/strong&gt;&lt;br&gt;
( if you directly jump into it)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You will lack basic understanding of CSS.&lt;/li&gt;
&lt;li&gt;You have less control on colors, padding, margins etc.&lt;/li&gt;
&lt;li&gt;If you copy boilerplate code, it can be bulky as it contains lot of unnecessary things that you actually dont need.&lt;/li&gt;
&lt;li&gt;Lots of websites use these frameworks so things might look the same ( sometimes might look copied ).&lt;/li&gt;
&lt;li&gt;Additionally, you might need to overwrite a lot of classes or use dirty tricks like &lt;code&gt;!important&lt;/code&gt; to really achieve the style you want.&lt;/li&gt;
&lt;li&gt;CSS frameworks need to be imported may be through a CDN and that might import the full package and will make the codebase look bulky, when all you require is may be just a &lt;code&gt;button&lt;/code&gt;, a &lt;code&gt;Navbar&lt;/code&gt; etc.&lt;/li&gt;
&lt;li&gt;If you dont know whats happening under the hood, debugging can be really difficult.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;
  
  
  CSS Frameworks
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1623671976575%2FyYHCtlSus.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1623671976575%2FyYHCtlSus.png" alt="trending-css-frameworks.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No doubt CSS frameworks are one of the best things that ever happened in the Web Development industry. It gave developers lot of flexibilty in writing code, and saved lot of their time. You may be working with an organization that uses a framework you are already familiar with so wont be a lot difficult to settle in there. So yes Frameworks do come in handy.&lt;/p&gt;

&lt;p&gt;But there is a time only after which you should think of using them. Offocourse if you have come reading this long you already know it,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Only when you are cleared with the basic understanding of the concepts, basics things like &lt;code&gt;flex-box&lt;/code&gt;, &lt;code&gt;grids&lt;/code&gt;, &lt;code&gt;box-model&lt;/code&gt; etc etc, then you can think of using frameworks.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Pros of using CSS frameworks&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Saves lot of time in writing code just by declaring few classes.
e.g.,&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Vanilla css:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;button&amp;gt;Vanilla CSS&amp;lt;/button&amp;gt;
.btn {
font-size: 1rem;
padding: 0.7rem 0.5rem;
margin: 0.5rem;
border-radius: 5px;
background-color: crimson;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bootstrap:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;button class="btn btn-danger"&amp;gt;CSS Framework&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you see it saves time.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Consistent styling across whole project&lt;/li&gt;
&lt;li&gt;Production and shipping of project becomes faster&lt;/li&gt;
&lt;li&gt;You don’t have to worry about tons of cross browser compatibility.&lt;/li&gt;
&lt;li&gt;Easy to use, since lot of example code is given in the documentation website where you can refer if you get stuck.&lt;/li&gt;
&lt;li&gt;You mostly dont have to worry about the optimized code.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Cons of Vanilla CSS&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Styling can be inconsistent.&lt;/li&gt;
&lt;li&gt;Code optimization could be a problem if you are a beginner.&lt;/li&gt;
&lt;li&gt;Have to care lot about cross brower compatibility.&lt;/li&gt;
&lt;li&gt;Production can be little slow, since you are writing code from scratch.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Frameworks are awesome no doubt. Vanilla CSS can be really messy sometimes and vice versa. But you should know when to use what and where to use what.&lt;/p&gt;

&lt;p&gt;I hope know you got a fair understanding of both the worlds. Obviously there could be lot more arguments about both and the debate might never end but I tried to be as consise as possible.&lt;/p&gt;

&lt;p&gt;Whatever I have missed you can always add that up in the comment section.&lt;/p&gt;

&lt;p&gt;Drop a review it would be awesome !!!!!&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
