<?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: Sahil Garg</title>
    <description>The latest articles on DEV Community by Sahil Garg (@sahilgarg).</description>
    <link>https://dev.to/sahilgarg</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%2F440250%2F0d531008-4b1d-43c1-931e-330bf8318060.jpeg</url>
      <title>DEV Community: Sahil Garg</title>
      <link>https://dev.to/sahilgarg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sahilgarg"/>
    <language>en</language>
    <item>
      <title>Better way to make disabled variants of the components</title>
      <dc:creator>Sahil Garg</dc:creator>
      <pubDate>Fri, 06 Oct 2023 18:30:11 +0000</pubDate>
      <link>https://dev.to/sahilgarg/better-way-to-make-disabled-variants-of-the-components-1bh6</link>
      <guid>https://dev.to/sahilgarg/better-way-to-make-disabled-variants-of-the-components-1bh6</guid>
      <description>&lt;p&gt;When creating large projects or ones where you need full customization, it is usually a good practice to recreate the basic UI components according to the design system of the project. When creating these basic UI components, we usually create a disabled variant of button, input etc… These are usually styled by adding another class and then styling that class according to the design system and then disabling the click-handler and removing the &lt;code&gt;cursor: pointer;&lt;/code&gt; from it and optionally using &lt;code&gt;cursor: not-allowed;&lt;/code&gt;. And for this, we repeat the same code again and again or need to create a &lt;code&gt;mixin&lt;/code&gt; (if using a SCSS). What if I tell you that there's an easier way to style the disabled state of the elements together without needing to redefine the same styles again and again… Well, that's exactly what we will be going to look in this article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Toggling the disabled state of the element
&lt;/h2&gt;

&lt;p&gt;Instead of disabling the click handler or removing it depending on the &lt;code&gt;disabled&lt;/code&gt; variant, use the &lt;code&gt;disabled&lt;/code&gt; HTML attribute which gets toggled based on the variant.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"clickHandler()"&lt;/span&gt; &lt;span class="na"&gt;disabled=&lt;/span&gt;&lt;span class="s"&gt;{variant&lt;/span&gt; &lt;span class="err"&gt;===&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="na"&gt;disabled&lt;/span&gt;&lt;span class="err"&gt;'}&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  Hello world
&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, if the &lt;code&gt;variant&lt;/code&gt; prop passed is &lt;code&gt;disabled&lt;/code&gt; then the &lt;code&gt;disabled&lt;/code&gt; attribute will be set to true, else false is passed to &lt;code&gt;disabled&lt;/code&gt; and the &lt;code&gt;button&lt;/code&gt; won't be disabled.&lt;br&gt;
HTML's &lt;code&gt;disabled&lt;/code&gt; Boolean attribute, which will communicate a form control as semantically being disabled, change its styling to reflect its state and suppress all functionality along with disallowing the element's value from participating in form submission&lt;br&gt;
The &lt;code&gt;disabled&lt;/code&gt; attribute can be applied to other elements as well such as inputs and textarea the same was as applied to the &lt;code&gt;button&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Styling the disabled state
&lt;/h2&gt;

&lt;p&gt;CSS provides a pseudo-selector for selecting the disabled state of an element, &lt;code&gt;:disabled&lt;/code&gt;. When used with &lt;code&gt;*&lt;/code&gt; we can select the disabled state of all the elements.&lt;br&gt;
Usually in a design system, we have a fixed background, foreground and border color for disabled state and the hover state of the button is disallowed. Hence, it is more convenient and non-repetitive to write the disabled styles together for all the elements in the root stylesheet. Still if there are any styles which are specific to an element, they can be specified in their own components and the common ones in the root.&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* global.css */&lt;/span&gt;

&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;:disabled&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;gray&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#fff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;not-allowed&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;h2&gt;
  
  
  Improving accessibility of the disabled state
&lt;/h2&gt;

&lt;p&gt;To improve the accessibility of the disabled state of the element, &lt;code&gt;aria&lt;/code&gt; labels are of crucial importance. The &lt;code&gt;aria-disabled&lt;/code&gt; attribute, when set to &lt;code&gt;true&lt;/code&gt;, indicates that the element upon which it is set and all of its focusable descendants are meant to be in the disabled state. This declaration will inform people using assistive technologies, such as screen readers, that such elements are not meant to be editable or otherwise operable.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;disabled&lt;/span&gt; &lt;span class="na"&gt;aria-disabled=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Hello world&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
And in toggle-able form:
&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;disabled=&lt;/span&gt;&lt;span class="s"&gt;{variant&lt;/span&gt; &lt;span class="err"&gt;===&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="na"&gt;disabled&lt;/span&gt;&lt;span class="err"&gt;'}&lt;/span&gt; &lt;span class="na"&gt;aria-disabled=&lt;/span&gt;&lt;span class="s"&gt;{variant&lt;/span&gt; &lt;span class="err"&gt;===&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="na"&gt;disabled&lt;/span&gt;&lt;span class="err"&gt;'}&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  Hello world
&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But note that the state of being disabled applies to the element with &lt;code&gt;aria-disabled="true"&lt;/code&gt; and all of its focusable descendants such as input, button etc… Hence, when applying &lt;code&gt;aria-disabled="true"&lt;/code&gt; care must be taken to not apply it to containers with focusable elements as children in which you do not want disabled state.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;These &lt;code&gt;disabled&lt;/code&gt; attribute and pseudo-selector were launched with the initial versions of the browsers and have stayed here for a long time yet their use has decreased according to &lt;a href="https://caniuse.com" rel="noopener noreferrer"&gt;caniuse.com&lt;/a&gt;. These bring in more accessibility when combined with the aria labels compared to the traditional approach of using JS, &lt;code&gt;pointer-events: none;&lt;/code&gt; or making separate &lt;code&gt;.disabled&lt;/code&gt; classes.&lt;/p&gt;




&lt;p&gt;If you came this long, you must have liked the post. I highly recommend you to follow to never miss learning new and unknown things in the domain of web development. You can always unfollow if you don't like it in the future.&lt;br&gt;
Let's get connected on linkedin: &lt;a href="https://www.linkedin.com/in/sahil2004/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/sahil2004/&lt;/a&gt;&lt;br&gt;
I post such amazing content there as well.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>Nesting in CSS - A better way to structure styles</title>
      <dc:creator>Sahil Garg</dc:creator>
      <pubDate>Mon, 02 Oct 2023 03:30:03 +0000</pubDate>
      <link>https://dev.to/sahilgarg/nesting-in-css-a-better-way-to-structure-styles-5g8h</link>
      <guid>https://dev.to/sahilgarg/nesting-in-css-a-better-way-to-structure-styles-5g8h</guid>
      <description>&lt;p&gt;CSS can be cumbersome to read. It becomes easily very difficult to figure out which is the parent and which is the child. Also, which is the immediate parent and which is the immediate styles. Hence, concept of nesting was introduced, initially in CSS pre-processors such as SASS and now in native CSS.&lt;br&gt;
CSS now has a &lt;code&gt;&amp;amp;&lt;/code&gt; nesting selector support built in. This provides a familiar syntax to most of the CSS pre-processors to nest the CSS selectors.&lt;/p&gt;
&lt;h2&gt;
  
  
  CSS Nesting selector basics
&lt;/h2&gt;

&lt;p&gt;To nest CSS, it isn't necessary to use the nesting operator. It can be done without that as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.parent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/* Parent's CSS Code */&lt;/span&gt;
  &lt;span class="err"&gt;.child&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* Child's code */&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will evaluate to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.parent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/* Parent's CSS Code */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.parent&lt;/span&gt; &lt;span class="nc"&gt;.child&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/* Child's CSS Code */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But then why do we require the &lt;code&gt;&amp;amp;&lt;/code&gt; nesting operator?&lt;br&gt;
Well, we can also nest the pseudo-selectors and we might need to mention classes which require them to be written without the whitespace. In these situations, we are mandated to use the nesting operator. Let's see an example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.parent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/* Parent's code */&lt;/span&gt;
  &lt;span class="err"&gt;:hover&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* Hover state code */&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Intended functionality:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.parent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/* Parent's code */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.parent&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/* Hover state code */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But what we actually get:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.parent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/* Parent's code */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.parent&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/* Hover state code which gets applied to all the child element's hover states */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which is not the desired functionality.&lt;br&gt;
Also note that currently (at the time of writing of this article) browsers except firefox do not support type selectors (tags) to be nested without the nesting operator.&lt;/p&gt;
&lt;h3&gt;
  
  
  Appending the CSS nesting operator
&lt;/h3&gt;

&lt;p&gt;Nesting operator can be appended to the right as well to reverse the effect. With the &lt;code&gt;&amp;amp;&lt;/code&gt; at the left side of the operator, it was giving &lt;code&gt;.parent .child&lt;/code&gt;. But if we append it, we will get &lt;code&gt;.child .parent&lt;/code&gt; which reverses the effect. Now here we are referring to the element with .parent class which lies inside the element with &lt;code&gt;.child&lt;/code&gt; class.&lt;br&gt;
This can be done multiple times as well. Appending the nesting operator or pre-pending the nesting operator multiple times will duplicate the selector there.&lt;br&gt;
Here is an example to illustrate this:&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/sahil2004/embed/abPKxeG?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Well, with CSS nesting operator, it is now a better choice to use it rather than repeating the classes again and again just to point to their children. Also, if you are using CSS pre-processors such as SASS (or SCSS) just due to the variables and nesting, then you should reconsider your choice as CSS has support for both nesting as well as variables.&lt;/p&gt;




&lt;p&gt;If you came this long, you must have liked the post. I highly recommend you to follow to never miss learning new and unknown things in the domain of web development. You can always unfollow if you don't like it in the future.&lt;br&gt;
Let's get connected on linkedin: &lt;a href="https://www.linkedin.com/in/sahil2004/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/sahil2004/&lt;/a&gt;&lt;br&gt;
I post such amazing content there as well.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
      <category>css</category>
    </item>
    <item>
      <title>8 ways to center a div: The most common interview question</title>
      <dc:creator>Sahil Garg</dc:creator>
      <pubDate>Sat, 23 Sep 2023 07:56:19 +0000</pubDate>
      <link>https://dev.to/sahilgarg/8-ways-to-center-a-div-the-most-common-interview-question-54e</link>
      <guid>https://dev.to/sahilgarg/8-ways-to-center-a-div-the-most-common-interview-question-54e</guid>
      <description>&lt;p&gt;Centering a div is now a meme on internet but still to this day it is very common among software developers that they are not familiar either with all the ways or sometimes even with one. Having a knowledge of all these ways is a great asset in your skill set and efficiency as a web developer.&lt;/p&gt;

&lt;p&gt;The 8 ways are given below with the CSS code (and HTML code just for one) that needs to be applied to the elements. The HTML document structure for all the examples is as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"parent"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"child"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    Hello world!
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  1. Position absolute
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Centers both vertically and horizontally
&lt;/h3&gt;

&lt;p&gt;Position absolute brings the element out of the normal document flow. Then then we shift the top edge of the element 50% (of the document height) to the bottom and similarly the left side 50% (of the document width) to the right.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.parent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.child&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-50%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;-50%&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;h2&gt;
  
  
  2. Margin auto
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Centers only horizontally
&lt;/h3&gt;

&lt;p&gt;If we set the width of parent element to the appropriate size, making the child element of a set width less than the parent element, we can set the margins to auto to center the div horizontally.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.parent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.child&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;fit-content&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* 0 or anything for top and bottom but auto for left and right */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Flexboxes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Centers both horizontally and vertically
&lt;/h3&gt;

&lt;p&gt;If we make the parent as a flexbox. Then using &lt;code&gt;justify-content: center;&lt;/code&gt; and &lt;code&gt;align-items: center;&lt;/code&gt; we can center the div horizontally and vertically.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.parent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&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;h2&gt;
  
  
  4. Gird and place items
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Centers both horizontally and vertically
&lt;/h3&gt;

&lt;p&gt;Using place-items is a short hand for both &lt;code&gt;align-items&lt;/code&gt; and &lt;code&gt;justify-items&lt;/code&gt;. Now using this shorthand to center the div horizontally and vertically is very easy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.parent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;place-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&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;h2&gt;
  
  
  5. Grid and place self
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Centers both horizontally and vertically
&lt;/h3&gt;

&lt;p&gt;Instead of centering all the elements in a div, we can center individual items as well. This is done using &lt;code&gt;place-self: center;&lt;/code&gt;. This is a short hand for &lt;code&gt;justify-self: center;&lt;/code&gt; and &lt;code&gt;align-self: center;&lt;/code&gt;. You can use either one of them instead of &lt;code&gt;place-items&lt;/code&gt; if you want to center in just a single direction.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.parent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.child&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;place-self&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&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;h2&gt;
  
  
  6. Margin auto with a grid
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Centers both horizontally and vertically
&lt;/h3&gt;

&lt;p&gt;We can use &lt;code&gt;margin: auto;&lt;/code&gt; along with grid as well to center the div.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.parent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.child&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&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;h2&gt;
  
  
  7. Margin auto with a flexbox
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Center both horizontally and vertically
&lt;/h3&gt;

&lt;p&gt;We can use &lt;code&gt;margin: auto;&lt;/code&gt; along with flexboxes as well to center the div.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.parent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.child&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&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;h2&gt;
  
  
  8. Using &lt;center&gt;
&lt;/center&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Centers horizontally only
&lt;/h3&gt;

&lt;p&gt;HTML hasn’t faded away and there exists this method of centering the elements &lt;code&gt;&amp;lt;center&amp;gt;&lt;/code&gt; tag wrapped around the child element.&lt;/p&gt;

&lt;p&gt;Unlike other methods, for this we will need to modify the HTML and not the CSS.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"parent"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;center&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"child"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      Hello world!
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/center&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Example of all the methods
&lt;/h2&gt;

&lt;p&gt;To test out all the methods, here is a collective pen made just for this.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/sahil2004/embed/XWoVYRm?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Centering a div is a thing we need to do a lot as a frontend developer. This is also a very trending meme.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1hz1yp50ndq14chh5g64.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1hz1yp50ndq14chh5g64.png" alt="Meme on centering a div." width="640" height="712"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Source: &lt;a href="https://www.reddit.com/r/ProgrammerHumor/comments/95z1xn/if_you_can_successfully_center_a_div_you_can/" rel="noopener noreferrer"&gt;https://www.reddit.com/r/ProgrammerHumor/comments/95z1xn/if_you_can_successfully_center_a_div_you_can/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, save this article so that you can refer back to it whenever you need to center a div.&lt;/p&gt;




&lt;p&gt;If you came this long, you must have liked the post. I highly recommend you to follow to never miss learning new and unknown things in the domain of web development. You can always unfollow if you don’t like it in the future.&lt;/p&gt;

&lt;p&gt;Let’s get connected on linkedin: &lt;a href="https://www.linkedin.com/in/sahil2004/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/sahil2004/&lt;/a&gt;&lt;br&gt;
I post such amazing content there as well.&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>html</category>
      <category>frontend</category>
    </item>
    <item>
      <title>New way to create modals using HTML only</title>
      <dc:creator>Sahil Garg</dc:creator>
      <pubDate>Wed, 20 Sep 2023 15:43:11 +0000</pubDate>
      <link>https://dev.to/sahilgarg/new-way-to-create-modals-using-html-only-4a3g</link>
      <guid>https://dev.to/sahilgarg/new-way-to-create-modals-using-html-only-4a3g</guid>
      <description>&lt;p&gt;As HTML continues to evolve, the most used modal which were earlier implemented using JS have now gotten native support of HTML. It is completely game changer, as it now makes it a lot easier to implement Modals and popups without hacking the way into it.&lt;/p&gt;

&lt;p&gt;New dialog element also has the support for all the JS methods we will need. Thus it can be completely customized. Let’s explore this more…&lt;/p&gt;

&lt;h2&gt;
  
  
  Browser Compatibility
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcdxwe0jfyfmkjt9yhxhb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcdxwe0jfyfmkjt9yhxhb.png" alt="Browser support of &amp;lt;dialog&amp;gt; HTML element and ‘open’ attribute of &amp;lt;dialog&amp;gt;" width="720" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Currently, it is supported in all the major browsers. Hence, we can implement immediately in our production sites.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let’s get the basics down
&lt;/h2&gt;

&lt;p&gt;A dialog/modal, is a popup that appears on a button click. To create it, we have the  HTML tag. But there is a difference between a dialog and a modal. Dialog is just a simple popup with content that takes up space on the page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;dialog&lt;/span&gt; &lt;span class="na"&gt;open&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Greetings, one and all!&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;method=&lt;/span&gt;&lt;span class="s"&gt;"dialog"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&amp;gt;&lt;/span&gt;OK&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/dialog&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows a dialog box.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwghnadkgao5a55cm2oqh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwghnadkgao5a55cm2oqh.png" alt="Dialog box with ‘open’ attribute" width="233" height="122"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The open attribute displays the dialog box. Without it, there would be nothing on the screen. This however isn’t a modal but a simple dialog box and doesn’t take the priority over screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dual nature of Dialog
&lt;/h2&gt;

&lt;p&gt;The new dialog in HTML shows dual nature based on how you use it. It can work as a modal, appearing on top of everything and in the center of the page. It can also work as a normal box appearing at the place it is opened at.&lt;/p&gt;

&lt;p&gt;To control this functionality, dialog element has different methods to execute its different functionalities. To display it as a dialog we have &lt;code&gt;dialog.show()&lt;/code&gt; and to show it as a modal we have &lt;code&gt;dialog.showModal()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;As long as the dialog is open as a modal, all the other UI components become inert. The focus shifts to modal and when pressing tabs, the cursor rotates within the different HTML elements itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing the modal
&lt;/h2&gt;

&lt;p&gt;When the modal opens, we mostly need to set the background of the modal to make user focus on the modal more than the rest of content. Usually we set it to a blurry black. This can now easily be done using &lt;code&gt;::backdrop&lt;/code&gt; pseudo-selector.&lt;/p&gt;

&lt;h3&gt;
  
  
  Closing the modal or dialog:
&lt;/h3&gt;

&lt;p&gt;To close the modal, we have 4 methods — escape key, clicking an element with &lt;code&gt;formmethod="dialog"&lt;/code&gt; set inside the form, form’s &lt;code&gt;method="dialog"&lt;/code&gt; is set, or &lt;code&gt;dialog.close()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Both the functionalities of the dialog element, as a modal and as a dialog is aptly displayed in the following example:&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/sahil2004/embed/LYMzjNN?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;It is recommended, that you run this pen and tinker around and tweak the code to completely understand the dialog element.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Details
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;The dialog doesn’t make the elements in the background inert. It can be closed by a button in the body as well. This functionality is displayed in the pen.&lt;/li&gt;
&lt;li&gt;Dialog doesn’t need a &lt;code&gt;tabindex&lt;/code&gt;. It means that &lt;code&gt;tabindex&lt;/code&gt; property must not be applied to dialog.&lt;/li&gt;
&lt;li&gt;When the dialog opens, if it contains any element which can be focused, the first one gets autofocused if not stated otherwise or &lt;code&gt;autofocus&lt;/code&gt; is not used with any other element.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Thus the new dialog element is a good addition to the HTML. It decreases the code required to implement the modals using JavaScript and also provides more accessibility to the element which is most common in today’s websites and apps.&lt;/p&gt;




&lt;p&gt;If you came this long, you must have liked the post. I highly recommend you to follow to never miss learning new and unknown things in the domain of web development. You can always unfollow if you don’t like it in the future.&lt;/p&gt;

&lt;p&gt;Let’s get connected on linkedin: &lt;a href="https://www.linkedin.com/in/sahil2004/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/sahil2004/&lt;/a&gt;&lt;br&gt;
I post such amazing content there as well.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Why you should use Vue.js</title>
      <dc:creator>Sahil Garg</dc:creator>
      <pubDate>Mon, 11 Jan 2021 12:17:11 +0000</pubDate>
      <link>https://dev.to/sahilgarg/why-should-you-use-vue-js-163n</link>
      <guid>https://dev.to/sahilgarg/why-should-you-use-vue-js-163n</guid>
      <description>&lt;p&gt;You might have heard about vue.js. People will recommend you to use vue.js to simplify single page application coding. So, how does it actually simplify it?&lt;/p&gt;

&lt;h1&gt;
  
  
  How does it actually simplify it
&lt;/h1&gt;

&lt;p&gt;It simplifies it by dividing different parts of app into what we call components. These components have different code; and hence are stored in separate files for compartmentalization of code. Why have all the components in a single HTML file when we can have it in different files. Now what Vue or any other JS framework will do under the hood is it will converge all the components into a single file based on what you need. If you need Login page then you can insert a login page. Then after the user has logged in, you can remove the login page and instead of moving to another page it remains on the same page and just remove the component and updates it with a new component.&lt;/p&gt;

&lt;h1&gt;
  
  
  Computation within a component
&lt;/h1&gt;

&lt;p&gt;Now you'll ask that why do we need a JS framework to do that because JS will take a lot more time to render than to simply request a new HTML page.&lt;br&gt;
Here comes the computations that you can do under the hood in the component. You can make dynamic pages. Whenever the user has submitted a form then you can push the new content or remove the previous content of the page without reloading the whole page. Also, you can define several functions that can be performed on the data entered by the user.&lt;/p&gt;

&lt;h1&gt;
  
  
  The wonders of state management
&lt;/h1&gt;

&lt;p&gt;Now, you will ask that we can add onsubmit function and we can make a function in normal JS. Then why should we use Vue.js. Here comes the state management.&lt;br&gt;
All components have a state. By state what we mean is the state of an element at that current time. For example: an empty input field, user has pressed submitted button, now on submit we will update the database at the server and on the client side. Over here you can save the data at the place of one component and use that anywhere in your app, in any component. This will lead to update of the data in every component's HTML without reloading the whole page.&lt;/p&gt;

&lt;p&gt;Now this will lead to a simpler codebase in the long run if you have to scale the app. Else it will lead to a very long JS file that will be so difficult to understand that after a year you yourself will not understand what you have written. This is from my own experience. I made a single page application that had so many functions that even after naming the functions properly, after a month only I was unable to understand the code myself. And ended up leaving it.&lt;/p&gt;

&lt;p&gt;At all, devs love Vue for several reasons. Concluding the discussion, I want to provide you with four key strengths of Vue.js and its community:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An easy learning curve with perfect guides for beginners. It’s enough to know a bit of JavaScript and HTML to create your own application with Vue.&lt;/li&gt;
&lt;li&gt;Great flexibility which facilitates interaction with different libraries and suits different strategies, such as the development of PWAs.&lt;/li&gt;
&lt;li&gt;Optimal performance that is available thanks to the minimalism of the tool. Actually, Vue.js is even smaller than 20 KB.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>vue</category>
      <category>javascript</category>
      <category>html</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Houdini</title>
      <dc:creator>Sahil Garg</dc:creator>
      <pubDate>Sun, 20 Dec 2020 17:17:51 +0000</pubDate>
      <link>https://dev.to/sahilgarg/houdini-1lbp</link>
      <guid>https://dev.to/sahilgarg/houdini-1lbp</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Houdini is a set of low-level APIs that exposes parts of the CSS engine. Hence, giving developers the power to extend CSS by hooking into the styling and layout process of a browser’s rendering engine.  Houdini is a group of APIs that give developers direct access to the CSS Object Model (CSSOM), enabling developers to write code the browser can parse as CSS, thereby creating new CSS features without waiting for them to be implemented natively in browsers. Also, it takes quite long for new CSS features to come to the browsers. Houdini will help bring them faster.&lt;br&gt;
JavaScript-based polyfills can be used as a substitute for the lack of browser support in order to use new CSS features before they’re officially implemented. For example, &lt;a href="https://github.com/ckrack/scrollsnap-polyfill/" rel="noopener noreferrer"&gt;scrollsnap-polyfill &lt;/a&gt; is one of several polyfills that can be used to fix browser support inconsistencies for the CSS Scroll Snap specification.&lt;/p&gt;
&lt;h1&gt;
  
  
  Advantages
&lt;/h1&gt;

&lt;p&gt;Houdini enables faster parse times than using JavaScript style for style changes. Houdini's CSS Typed Object Model is a CSS Object Model with types and methods, exposing values as JavaScript objects making for more intuitive CSS manipulation than previous string based HTMLElement.style manipulations.&lt;/p&gt;
&lt;h1&gt;
  
  
  Disadvantages
&lt;/h1&gt;

&lt;p&gt;This would look great but there are a few things to keep in mind before using it. Those are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;With Houdini you could invent your own masonry, grid, or regions implementation, but doing so is not necessarily the best idea. The CSS Working group does a lot of work to ensure every feature is performant, handles all edge cases, and considers security, privacy, and accessibility. But as you extend CSS with Houdini, make sure to keep these considerations in mind.&lt;/li&gt;
&lt;li&gt;JavaScript Polyfill solutions run only after the initial render cycle has been completed, i.e. when both DOM and CSSOM have been created and the document has finished loading. After Polyfill makes changes to styles in the DOM, it causes the render process to run again and the whole page re-renders. Negative performance impact gets even more apparent if they rely on the user interactions like scroll events.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;
  
  
  Learn it
&lt;/h1&gt;

&lt;p&gt;To &lt;strong&gt;learn about it in a simpler manner&lt;/strong&gt;, a great article would be: &lt;a href="https://css-tricks.com/css-houdini-could-change-the-way-we-write-and-manage-css/#modularity" rel="noopener noreferrer"&gt;https://css-tricks.com/css-houdini-could-change-the-way-we-write-and-manage-css/#modularity&lt;/a&gt;&lt;/p&gt;
&lt;h6&gt;
  
  
  To learn it in a difficult manner
&lt;/h6&gt;

&lt;p&gt;Learn more about the specifications of Houdini and worklets here: &lt;br&gt;
&lt;a href="https://developers.google.com/web/updates/2016/05/houdini#the_specifications" rel="noopener noreferrer"&gt;https://developers.google.com/web/updates/2016/05/houdini#the_specifications&lt;/a&gt;&lt;br&gt;
To explore the various APIs that Houdini provides see here: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Houdini#The_Houdini_APIs" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/Houdini#The_Houdini_APIs&lt;/a&gt;&lt;/p&gt;
&lt;h6&gt;
  
  
  A recommended watch
&lt;/h6&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/5eBar5TI71M"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>javascript</category>
      <category>houdini</category>
    </item>
    <item>
      <title>Why Rust is good for Web Assembly and path to learning it...</title>
      <dc:creator>Sahil Garg</dc:creator>
      <pubDate>Tue, 10 Nov 2020 09:58:41 +0000</pubDate>
      <link>https://dev.to/sahilgarg/why-rust-is-good-for-web-assembly-and-path-to-learning-it-2njf</link>
      <guid>https://dev.to/sahilgarg/why-rust-is-good-for-web-assembly-and-path-to-learning-it-2njf</guid>
      <description>&lt;h1&gt;
  
  
  Introduction to Web Assembly
&lt;/h1&gt;

&lt;p&gt;WebAssembly is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++, C#, and Rust with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together.&lt;br&gt;
Also, it can be understood in a 2.15-minute video from Fireship:&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/cbB3QEwWMlA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Support
&lt;/h3&gt;

&lt;p&gt;WebAssembly 1.0 has shipped in 4 major browser engines: Chrome, Firefox, Safari, legacy Edge. &lt;em&gt;Source: &lt;a href="https://webassembly.org/" rel="noopener noreferrer"&gt;https://webassembly.org/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Web assembly = wasm
&lt;/h4&gt;

&lt;h1&gt;
  
  
  Why Rust is best for Web Assembly
&lt;/h1&gt;

&lt;p&gt;Many different languages can be compiled down to WebAssembly, including C# and Go, so why not use them instead of Rust? While the use of a programming language is always influenced by personal preference, there are many reasons why Rust is the best tool for the job. Because these languages have large runtimes that must be included in the WebAssembly binary, they're only really practical for greenfield projects (i.e., they're practical only as JavaScript replacements). This &lt;a href="https://github.com/golang/go/wiki/WebAssembly" rel="noopener noreferrer"&gt;Go wiki article&lt;/a&gt; on Wasm says the smallest achievable binary size uncompressed is around 2MB; this mirrors what I've seen. For Rust, which ships with an extremely minimal runtime (basically just an allocator), the "hello, world" example compiles to 1.6KB on my machine without any post-compile size optimizations (which could bring it down further).&lt;/p&gt;

&lt;p&gt;This is not to say that the future of Go or C# in the browser is bleak—I'm quite excited about what might come from those efforts. But the reality is that these technologies will probably always be best for greenfield projects.&lt;/p&gt;

&lt;p&gt;C and C++ ship with very small runtimes, just like Rust, and thus can be practical for embedding inside existing apps and libraries. However, Rust makes it really easy to create WebAssembly binaries that have fairly idiomatic JavaScript interfaces using the tools we'll explore in the other articles in this series, while the process in C and C++ is much more manual. The tooling in Rust is absolutely fantastic, and I think it makes the entire experience much more enjoyable. Rust is also a much more memory-safe language meaning that a whole class of bugs that are common in C and C++ are impossible to have in safe Rust. If you're used to memory-safe languages like JavaScript, Java, and C#, (and even if you're not), you probably want to go with Rust. &lt;br&gt;
You can read more about the benefits of using Rust with Web Assembly at: &lt;a href="https://developer.ibm.com/technologies/web-development/articles/why-webassembly-and-rust-together-improve-nodejs-performance/" rel="noopener noreferrer"&gt;Why using WebAssembly and Rust together improves Node.js performance&lt;/a&gt;&lt;br&gt;
Supporting my argument: &lt;a href="https://www.zdnet.com/article/microsoft-why-we-used-programming-language-rust-over-go-for-webassembly-on-kubernetes-app/#:~:text=WebAssembly%2C%20an%20open%20standard%20supported,compiled%20Wasm%20binaries%20or%20modules." rel="noopener noreferrer"&gt;Microsoft: Why we used programming language Rust over Go for WebAssembly on Kubernetes app&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  How to learn Rust?
&lt;/h1&gt;

&lt;p&gt;Learning Rust isn't a simple task but following a good path and a good guide will make it easier. First of all, you need to know the syntax. For this, I recommend this Rust Crash Course by Traversy Media on youtube: &lt;iframe width="710" height="399" src="https://www.youtube.com/embed/zF34dRivLOw"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Then after this, the next thing to do is to make a real-world project, not a practice script. Let's get into some of the things that can be made using this. I made many scripts in Rust to practice it. Like: &lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Sahil2004" rel="noopener noreferrer"&gt;
        Sahil2004
      &lt;/a&gt; / &lt;a href="https://github.com/Sahil2004/shutdown" rel="noopener noreferrer"&gt;
        shutdown
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A simple application created for shutting down the windows 10 OS through the start menu without using the mouse.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Shutdown&lt;/h1&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Description:&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;This was created by me as I am sometimes very lazy in shutting down the PC and feel lazy in doing those clicks to first open the start menu then clicking the power icon on the side and then clicking shutdown button to shutdown the PC. I made this script to simplify this task and then just click the start key on the keyboard and then start typing 'shutdown' as typing shutdown is much easier than those boring clicks. Hence, when the shutdown.exe appears on the side startmenu, just press 'enter' and its done.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;How to compile&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Compiling is easier, you have to open the directory and then in the cmd type&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;$ cargo build --release
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And it will compile it for you.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Contribution&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;If you want to contribute to it, just do it man. Open the issue and put in the discription that you want to work…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Sahil2004/shutdown" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
 &lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Sahil2004" rel="noopener noreferrer"&gt;
        Sahil2004
      &lt;/a&gt; / &lt;a href="https://github.com/Sahil2004/Mount-drive-in-linux" rel="noopener noreferrer"&gt;
        Mount-drive-in-linux
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Mount your external drive using nautilus and automate it with this script.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Mount-drive-in-linux&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;I tried mounting my HDD automatically with fstab but it is not giving me appropriate permissions. I tried everything. But then I found that if I mount using nautilus in gnome I was getting appropriate permissions. But here the problem was that I wasn't able to find automatic mount. But after researching I found that by using &lt;code&gt;gio mount&lt;/code&gt; command. So, that is what I wrote a script for in rust. Now putting it in startup scripts, it will mount my HDD automatically on startup.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Index&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/Sahil2004/Mount-drive-in-linux#technologies" rel="noopener noreferrer"&gt;Technologies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Sahil2004/Mount-drive-in-linux#setup" rel="noopener noreferrer"&gt;Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Sahil2004/Mount-drive-in-linux#credit" rel="noopener noreferrer"&gt;Credit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Sahil2004/Mount-drive-in-linux#contribute" rel="noopener noreferrer"&gt;Contribute&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Sahil2004/Mount-drive-in-linux#license" rel="noopener noreferrer"&gt;License&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Technologies&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Project is created with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;rustc 1.45.0&lt;/li&gt;
&lt;li&gt;cargo 1.45.0&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Setup&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;First of all open the &lt;code&gt;src/main.rs&lt;/code&gt; and change the drive name al line 8 to what you wish to mount.
To run the project you need to install rust version 1.45.0. For reference you can see &lt;a href="https://github.com/Sahil2004/Mount-drive-in-linux#technologies" rel="noopener noreferrer"&gt;Technologies&lt;/a&gt;. Then run:&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;
&lt;pre class="notranslate"&gt;&lt;code&gt;$ git clone https://github.com/Sahil2004/Mount-drive-in-linux.git
$ cd Mount-drive-in-linux
$&lt;/code&gt;&lt;/pre&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Sahil2004/Mount-drive-in-linux" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
 &lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Sahil2004" rel="noopener noreferrer"&gt;
        Sahil2004
      &lt;/a&gt; / &lt;a href="https://github.com/Sahil2004/delete-npm-error-logs" rel="noopener noreferrer"&gt;
        delete-npm-error-logs
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      This helps to clear out all the logs left behind due to errors when installing a npm package.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Delete-npm-error-logs&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;This helps to clear out all the logs left behind due to errors when installing a npm package. I made this because I usually fix the errors in a single go before switching off my pc and do not want to keep extra stuff on the storage.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Contribution&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;You may contribute as you may wish.&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Sahil2004/delete-npm-error-logs" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;
 Also as they are open-sourced you can see their code and learn and then make something like this that solves some kind of problem. You can even make a module for python project and then import it into python with rust-cpython; a good article will be: &lt;a href="https://developers.redhat.com/blog/2017/11/16/speed-python-using-rust/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://developers.redhat.com/blog/2017/11/16/speed-python-using-rust/" rel="noopener noreferrer"&gt;https://developers.redhat.com/blog/2017/11/16/speed-python-using-rust/&lt;/a&gt;. This will give you somewhat good practice of Rust.

&lt;h1&gt;
  
  
  Getting into Web Assembly
&lt;/h1&gt;

&lt;p&gt;First, you will need to look at some background concepts: &lt;a href="https://rustwasm.github.io/docs/book/background-and-concepts.html" rel="noopener noreferrer"&gt;https://rustwasm.github.io/docs/book/background-and-concepts.html&lt;/a&gt;. Now the reference will be this book: &lt;a href="https://rustwasm.github.io/docs/book/" rel="noopener noreferrer"&gt;https://rustwasm.github.io/docs/book/&lt;/a&gt;. This is a great way of learning Web Assembly.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Web Assembly and Rust together can do wonders. Learning this combo can make you a better Web Developer. Web Assembly with Rust is something which only a few know now but the future is this.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>webassembly</category>
      <category>webdev</category>
      <category>webpack</category>
    </item>
    <item>
      <title>Figma for VS Code: Now get styles listing and copying CSS &amp; listing layer tree and a preview of top-level layers</title>
      <dc:creator>Sahil Garg</dc:creator>
      <pubDate>Sat, 31 Oct 2020 14:21:05 +0000</pubDate>
      <link>https://dev.to/sahilgarg/figma-for-vs-code-now-get-styles-listing-and-copying-css-listing-layer-tree-and-a-preview-of-top-level-layers-4m3f</link>
      <guid>https://dev.to/sahilgarg/figma-for-vs-code-now-get-styles-listing-and-copying-css-listing-layer-tree-and-a-preview-of-top-level-layers-4m3f</guid>
      <description>&lt;h1&gt;
  
  
  Introduction 💌
&lt;/h1&gt;

&lt;p&gt;Many people use Figma for designing and need to copy the styles to VS Code from there or just see the styles in VS Code to code their websites like the way they designed it. Hence, it's a great pain to work with both on a single monitor. But VS Code being the most powerful code editors, it can handle it all.&lt;/p&gt;

&lt;h1&gt;
  
  
  Solution 😉
&lt;/h1&gt;

&lt;p&gt;There's an extension in VS Code: &lt;a href="https://marketplace.visualstudio.com/items?itemName=idered.figma" rel="noopener noreferrer"&gt;Figma by Kasper Mikiewicz&lt;/a&gt;. This is the goto solution for this. I have been using it for the past few days and it is damn amazing.&lt;/p&gt;

&lt;h1&gt;
  
  
  Installation ✔
&lt;/h1&gt;

&lt;p&gt;First of all, there are some requirements, let's fulfill them. By the way, the same you will find on the extension page in VS Code, but these are more elaborate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Figma Personal Access Token&lt;/li&gt;
&lt;li&gt;Team ID&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  If you don't know how to get them here's how:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Go to Account Settings in Figma.&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Create a new personal access token&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Name your token and copy it.&lt;/li&gt;
&lt;li&gt;In VS Code open the commands by using &lt;strong&gt;Ctrl + Shift + P&lt;/strong&gt; menu and execute &lt;strong&gt;Figma: Connect&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Paste your Figma token and press enter.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Team
&lt;/h3&gt;

&lt;p&gt;You must be a part of any team to be able to browse and select files or you can create your own team. To get your team id:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to Figma and click on any team in the sidebar&lt;/li&gt;
&lt;li&gt;Copy id from URL: &lt;a href="https://www.figma.com/files/team/ID/example" rel="noopener noreferrer"&gt;https://www.figma.com/files/team/ID/example&lt;/a&gt;. But for this, you will have to open it in the browser.&lt;/li&gt;
&lt;li&gt;In VS Code open the commands menu by using &lt;strong&gt;Ctrl + Shift + P&lt;/strong&gt; and execute &lt;strong&gt;Figma: Add Team&lt;/strong&gt; command&lt;/li&gt;
&lt;li&gt;Type in your team name&lt;/li&gt;
&lt;li&gt;Paste team id and press enter&lt;/li&gt;
&lt;li&gt;You're now able to select any team file using Figma: Select File from the command palette.&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Limitations 😢
&lt;/h1&gt;

&lt;p&gt;Browsing files works only for teams. You can't browse your drafts. But they say that in the future there will be support for adding single files by id.&lt;br&gt;
Also, it is in the preview version. With the release version of 0.1.0 at the time of writing this article.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;This extension has helped me save my time and will definitely help you integrate your Figma designs into code with great ease and saving a lot of time.&lt;/p&gt;

</description>
      <category>design</category>
      <category>codenewbie</category>
      <category>productivity</category>
      <category>vscode</category>
    </item>
    <item>
      <title>Design Systems now have CODE with the new XD extension for VS Code</title>
      <dc:creator>Sahil Garg</dc:creator>
      <pubDate>Thu, 22 Oct 2020 09:16:02 +0000</pubDate>
      <link>https://dev.to/sahilgarg/design-systems-now-have-code-with-the-new-xd-extension-for-vs-code-3ood</link>
      <guid>https://dev.to/sahilgarg/design-systems-now-have-code-with-the-new-xd-extension-for-vs-code-3ood</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;There's a new Adobe XD update here. So, what Adobe has brought us is a new extension for VS Code and a new file format called DSP (Design System Packages). This will bring designers and developers close and make them work together to build functional design systems.&lt;/p&gt;

&lt;p&gt;There's a teaser video that will sum it all up.&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/q6cx3t1P0cE"&gt;
&lt;/iframe&gt;
&lt;br&gt;
This teaser video was mainly for the VS Code extension.&lt;/p&gt;

&lt;h1&gt;
  
  
  DSP
&lt;/h1&gt;

&lt;p&gt;It is a new open format standard for building design systems in an effort to normalize the way we use design systems. Most of the design tools expose design systems in their own way which is not very universal across organizations.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frvdwpn0re4ad5gv513p1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frvdwpn0re4ad5gv513p1.png" alt="Design systems of various organizations" width="800" height="107"&gt;&lt;/a&gt;&lt;br&gt;
When a design system is normalized into a formal like DSP it helps companies share their design systems in a way that developers can take advantage of it. It is a bit similar to how PDF was made a standard for sharing pages and content. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fppxepls8oag6xyalmzaz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fppxepls8oag6xyalmzaz.png" alt="DSP documentation Github page" width="800" height="363"&gt;&lt;/a&gt;&lt;br&gt;
DSP is a new open-format folder-structure created to help teams share design system information across tools. From designers to developers tools that are compatible with this format can exchange &lt;br&gt;
design data and stay in sync.&lt;br&gt;
DSP is a collaborative effort and open-sourced so it's not owned by Adobe although they were a huge player in this initiative.&lt;/p&gt;

&lt;h1&gt;
  
  
  Extension for VS Code
&lt;/h1&gt;

&lt;p&gt;This extension allows you to create and consume DPSs visually with code-completion features. If you import from Creative Cloud libraries with colors and character styles and components new DSPs can be created in seconds.&lt;/p&gt;

&lt;p&gt;Hence, coming to how this extension works is that designers are creating their own sticker sheets and design system libraries in XD as they normally would and after publishing the library the link can be shared inside VS Code to get a head start in the design system package. This creates colors, character styles, and component tokens. The extension will then create a skeleton for our DSP but the developer will have to create the code snippets that will generate the code. &lt;/p&gt;

&lt;p&gt;Documentation can be added with each component including images, gifs, and other media like iframes to actually coded components.&lt;/p&gt;

&lt;h1&gt;
  
  
  Where to learn?
&lt;/h1&gt;

&lt;p&gt;You can learn more at &lt;a href="https://letsxd.com/vscode" rel="noopener noreferrer"&gt;https://letsxd.com/vscode&lt;/a&gt; with their videos on "Getting Started with Design Tokens", "Consuming a Design System Package (DSP) in VS Code", "Design System Packages (DSP) Importing Assets from Libraries".&lt;br&gt;
You can also get some publicly available DSPs &amp;amp; tools to get started immediately.&lt;/p&gt;

&lt;h1&gt;
  
  
  Team behind it
&lt;/h1&gt;

&lt;p&gt;The team behind this was headed by &lt;a href="https://twitter.com/demianborba" rel="noopener noreferrer"&gt;Demian Borba&lt;/a&gt; who is XD's product manager focused on developer workflows.&lt;/p&gt;

</description>
      <category>design</category>
      <category>productivity</category>
      <category>codenewbie</category>
      <category>vscode</category>
    </item>
    <item>
      <title>How to uninstall and reinstall play store without root</title>
      <dc:creator>Sahil Garg</dc:creator>
      <pubDate>Fri, 16 Oct 2020 08:16:47 +0000</pubDate>
      <link>https://dev.to/sahilgarg/how-to-uninstall-and-reinstall-play-store-without-root-3lff</link>
      <guid>https://dev.to/sahilgarg/how-to-uninstall-and-reinstall-play-store-without-root-3lff</guid>
      <description>&lt;p&gt;I uninstalled Google play store from my phone as I a privacy respecting person and installed Aurora Store. But now as I have to give buy a new phone and sell the old one, I thought of reinstalling Google services, especially the play store. Then I used ADB for installing it but faced an error. But then I found a command for ADB that installed it without giving me any error. I was relieved a lot. &lt;br&gt;
Now, I thought that I should share it with the community as someone out there might also be facing the same issue.&lt;/p&gt;
&lt;h1&gt;
  
  
  Installing the tool
&lt;/h1&gt;

&lt;p&gt;Now for uninstalling the apps without root you will need to download a tool that is named ADB whose full form is "Android Debugging Tool".&lt;/p&gt;
&lt;h2&gt;
  
  
  Setup Computer with ADB Platform Tools
&lt;/h2&gt;

&lt;p&gt;Windows Install:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;With Chocolatey: choco install ADB&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dl.google.com/android/repository/platform-tools_r30.0.4-windows.zip" rel="noopener noreferrer"&gt;Download the zip&lt;/a&gt;, extract it in a folder, then Open Windows Explorer and browse to where you extracted the contents of this ZIP file. Then open up a Command Prompt from the same directory as this ADB binary. This can be done by holding Shift and Right-clicking within the folder then click the “open command prompt here” option. (Some Windows 10 users may see “PowerShell” instead of “command prompt”.)
Linux Install with Terminal: sudo apt-get install android-tools-adb android-tools-fastboot
MacOS Install with Homebrew:&lt;/li&gt;
&lt;li&gt;Homebrew install - ruby -e “$(curl -fsSL &lt;a href="https://raw.githubusercontent.com/Homebrew/install/master/install)" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/Homebrew/install/master/install)&lt;/a&gt;"&lt;/li&gt;
&lt;li&gt;ADB Homebrew Install - brew cask install android-platform-tools&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Setup Phone for ADB Debugging
&lt;/h2&gt;

&lt;p&gt;Open Settings, and select “About”.&lt;br&gt;
Tap on “Build number” seven times.&lt;br&gt;
Go back, and select “Developer options”.&lt;br&gt;
Scroll down, and check the “Android debugging” or “USB debugging” entry under “Debugging”.&lt;br&gt;
Plug your device into your computer.&lt;br&gt;
On the computer, open up a terminal/command prompt and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ adb devices
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A dialog should show on your device, asking you to allow USB debugging. Check “always allow”, and choose “OK”.&lt;br&gt;
Note: If you don’t see this prompt on your device change the USB connection to MTP or File Transfer on the device&lt;/p&gt;
&lt;h1&gt;
  
  
  Uninstalling Google play store
&lt;/h1&gt;

&lt;p&gt;In the terminal/command prompt type the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;adb shell pm uninstall --user 0 com.android.vending
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this command we are basically uninstalling the play store for the User 0 that is the default user only. Without root it can't be uninstalled completely from the phone. This doesn't disable software updates from your OEM/Phone manufacturer. 'com.android.vending' is the name of the package the play store has. I know it is a very confusing name. That is the reason I asked the name of the package on &lt;a href="https://www.reddit.com/r/degoogle/comments/ism7hz/what_is_the_name_of_playstore_package/" rel="noopener noreferrer"&gt;reddit&lt;/a&gt;. Now, we need a software for installing apps.&lt;/p&gt;

&lt;h1&gt;
  
  
  Other FOSS alternatives of Google Playstore
&lt;/h1&gt;

&lt;p&gt;There are 2 best FOSS alternatives of play store.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.f-droid.org/" rel="noopener noreferrer"&gt;F-Droid&lt;/a&gt;: This is an app store that includes those apps only which come in the category of FOSS and hence there is an option for individual app where there repository is written.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://auroraoss.com/downloads.php" rel="noopener noreferrer"&gt;Aurora store&lt;/a&gt;: It uses Google play store API to let you install apps listed on Google play store. You can download it from its website or from F-Droid. In Aurora Store you can download apps without signing in to Google hence Anonymously or you have an option to signin to your Google account.&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Installing FOSS alternatives
&lt;/h1&gt;

&lt;p&gt;You have to download their apk from their websites and then just put them on your phone storage and then just click on the apk in the phone and Install it by clicking the install button. But you may need to enable the option in the settings that says 'install apps from Unknown sources', this setting will be available in the developer options.&lt;/p&gt;

&lt;h1&gt;
  
  
  Reinstalling Google Playstore
&lt;/h1&gt;

&lt;p&gt;If you want to reinstall playstore. Plug your device into your computer. On the computer, open up a terminal/command prompt and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ adb devices
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, in the same command prompt type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ adb shell cmd package install-existing com.android.vending
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you should get the line in the command prompt stating: "Package com.android.vending installed for user: 0". If this is shown, play store has been downloaded successfully. Now you can disconnect your phone from the computer.&lt;/p&gt;

</description>
      <category>degoogle</category>
      <category>privacy</category>
      <category>android</category>
      <category>playstore</category>
    </item>
    <item>
      <title>Journey of my first CSS art</title>
      <dc:creator>Sahil Garg</dc:creator>
      <pubDate>Tue, 04 Aug 2020 15:04:37 +0000</pubDate>
      <link>https://dev.to/sahilgarg/journey-of-my-first-css-art-512o</link>
      <guid>https://dev.to/sahilgarg/journey-of-my-first-css-art-512o</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Today I made my first CSS artwork. It was a coffee mug. And thinking of sharing this with all, I am writing this post. I consider it a journey because it is very different from writing CSS for styling websites.&lt;/p&gt;

&lt;p&gt;I styled a lot of websites using CSS but never made a CSS artwork. Whenever I saw any artwork on Twitter shared by the dev community I thought about the difficulty in making it. I thought that there might be a lot of work went into it and a lot of CSS knowledge that I still don't have. But today I found an &lt;a href="https://dev.to/laasrinadiaa/make-your-first-css-art-29jo"&gt;article&lt;/a&gt; on dev.to that helped me in starting and making my first CSS artwork. It contains the link to some important websites that you will need.&lt;/p&gt;

&lt;p&gt;I saw many artwork codepens and the second thing that my eyes saw was the length of code. This made me upset.&lt;/p&gt;

&lt;h1&gt;
  
  
  Starting with the artwork
&lt;/h1&gt;

&lt;p&gt;But today I just made a folder in my documents folder and opened VS Code and made two files: index.html and style.scss.&lt;br&gt;
Yea, I use SCSS and not CSS as SCSS makes writing CSS a lot easier. But then when I was going to start typing HTML, I started wondering about the thing that I was going to create.&lt;/p&gt;

&lt;p&gt;Then I opened FIGMA, design tool that I use. And made a new file. Then I started designing the coffee mug that I saw in the above mentioned article. I didn't copy the code or referred to the code, but instead used my prior CSS knowledge. I made a design with element hierarchy.&lt;/p&gt;

&lt;p&gt;Then I made the div for the cup, that I took as the base for making the art. And began styling it. It took me some time to style the cup but subsequent elements took no time. The artwork was ready in an hour's time.&lt;/p&gt;

&lt;h1&gt;
  
  
  Feelings After completing it
&lt;/h1&gt;

&lt;p&gt;I was feeling great after completing it. I got my lost confidence, that was really needed. I posted it on &lt;a href="https://codepen.io/sahil2004/pen/GRZKaQg" rel="noopener noreferrer"&gt;codepen&lt;/a&gt; and then shared it on Twitter as well with the community that appreciates it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conculsion
&lt;/h1&gt;

&lt;p&gt;If you have even a little knowledge about CSS, then just start making it. It will teach a lot of things during the journey. The best experience can be gained by doing it and not reading other's experience. Take this post as a motivation for you to start making your own CSS artwork.&lt;/p&gt;

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