<?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: Rajeswaran</title>
    <description>The latest articles on Forem by Rajeswaran (@rajezz).</description>
    <link>https://forem.com/rajezz</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%2F515279%2F027ab67b-c1ac-4d6d-a5a8-1942da790d6f.jpeg</url>
      <title>Forem: Rajeswaran</title>
      <link>https://forem.com/rajezz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/rajezz"/>
    <language>en</language>
    <item>
      <title>6 CSS features you need to know about....</title>
      <dc:creator>Rajeswaran</dc:creator>
      <pubDate>Wed, 13 Oct 2021 17:12:03 +0000</pubDate>
      <link>https://forem.com/rajezz/6-css-features-you-need-to-know-about-3b72</link>
      <guid>https://forem.com/rajezz/6-css-features-you-need-to-know-about-3b72</guid>
      <description>&lt;p&gt;Hi 👋,&lt;/p&gt;

&lt;p&gt;Although being a Full Stack Web developer, I'm quite fond of designing beautiful UI.&lt;/p&gt;

&lt;p&gt;I would love to share with you some of the cool CSS features that you should know.&lt;/p&gt;

&lt;h3&gt;
  
  
  #1 - var()
&lt;/h3&gt;

&lt;p&gt;Variables have been available for many years with CSS preprocessing tools like Sass and Less. CSS variables, officially called CSS custom properties, were introduced later. Support for CSS variables was not great until more recently. They are now supported in all modern browsers.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: CSS variables are not supported in Internet Explorer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Why would we want to use variables in CSS? Suppose you're designing a website for a company. You use their brand color, #1092b3, in many places throughout your CSS. Later, the site is going through a rebranding, and the brand color is changing. You&lt;br&gt;
now have to change the brand color in every place you used #1092b3.&lt;br&gt;
Instead, you can define a brand-color variable and reference that variable everywhere you need to use the brand color. Later, when that color changes, you simply need to change the color value once in the variable declaration.&lt;/p&gt;

&lt;p&gt;CSS variables are declared with two dashes followed by the variable name, such as&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;--brand-color: #3FA2D9;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To reference a variable’s value later, you need to pass the variable name to the var function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;background-color: var(--brand-color);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  #2 - calc()
&lt;/h3&gt;

&lt;p&gt;The calc function lets you combine the different units for calculating an exact amount. Main advantages of using calc are&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Mixed units can be used in the calculation.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
    padding: calc(1.5rem - 10px);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;It works with CSS custom properties or variables.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:root {
    --spacing: 0.5rem
}

.container {
    padding: calc(var(--spacing) * 2);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  #3 - position: sticky
&lt;/h3&gt;

&lt;p&gt;The element acts as a relatively positioned element, scrolling with the document. When the element reaches a specified point, it turns into a fixed element. This point is specified via a top, right, bottom, or left value.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: position: sticky is not supported in Internet Explorer.&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;h3&gt;
  
  
  #4 - Magic of white-space, overflow &amp;amp; text-overflow used together
&lt;/h3&gt;

&lt;p&gt;Your design may require that text must fit within its container without overflowing or wrapping. This can easily be accomplished by using the &lt;strong&gt;&lt;code&gt;white-space, overflow, and text-overflow&lt;/code&gt;&lt;/strong&gt; properties together.&lt;/p&gt;

&lt;p&gt;First, white-space is set to nowrap. This ensures the text does not wrap but will in turn cause the text to overflow the container. By setting overflow to hidden, we can hide the overflowing content. However, then the text is abruptly cut off at the end of the container. Finally, we can set text-overflow to ellipsis to truncate the text and add an ellipsis at the end.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  #5 ::first-letter
&lt;/h3&gt;

&lt;p&gt;Applies the styles only to the first letter of the first line of an element.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  #6 prefers-reduced-motion
&lt;/h3&gt;

&lt;p&gt;Some users may have vestibular or seizure disorders that can be triggered by rapidly moving or flashing elements in your pages. You should be mindful of this when designing your animations. Most modern operating systems allow users to disable, or reduce, animations to help alleviate this.&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;style&amp;gt;
  @keyframes spin {
    from {
      transform: rotate(0deg);
    }

    to {
      transform: rotate(360deg);
    }
  }

  .loader {
    width: 10rem;
    height: 10rem;
    background: skyblue;
    animation: spin 500ms linear infinite;
  }
&amp;lt;/style&amp;gt;
&amp;lt;div class="loader"&amp;gt;&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This results in a square that spins very quickly, making one full rotation every 500ms.&lt;/p&gt;

&lt;p&gt;This could trigger seizures or other issues, as it moves very fast. We can conditionally disable the animation by using the prefers-reduced-motion media query.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@media (prefers-reduced-motion: reduce) {
  .loader {
    animation: none;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When this page is loaded on a system where the user has disabled motion, the box will not be animated.&lt;/p&gt;

&lt;p&gt;The prefers-reduced-motion query has two supported values: &lt;strong&gt;&lt;code&gt;reduce&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;no-preference&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: prefers-reduced-motion is not supported in Internet Explorer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's it for now. 😉&lt;/p&gt;

&lt;p&gt;Also, I know there are plenty of cool features in CSS. But writing them would eventually end up in a Book. But, I thought, why can't we pick a few of them.&lt;/p&gt;

&lt;p&gt;I hope you came to know about one new feature on CSS.&lt;/p&gt;

&lt;p&gt;Thank you! Have a great day 🎉&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
    </item>
    <item>
      <title>My first VSCode Theme...</title>
      <dc:creator>Rajeswaran</dc:creator>
      <pubDate>Wed, 04 Aug 2021 17:19:30 +0000</pubDate>
      <link>https://forem.com/rajezz/my-first-vscode-theme-o2a</link>
      <guid>https://forem.com/rajezz/my-first-vscode-theme-o2a</guid>
      <description>&lt;p&gt;Hi Folks 👋🏻,&lt;/p&gt;

&lt;p&gt;Hope you are safe out there!&lt;/p&gt;

&lt;p&gt;VSCode is a place where developers spent most of their time, right. So, it should look appealing to us. I know there are innumerable themes in VSCode. But, I just thought why can't be a part of that. Also, I personally love playing around with themes. So, I tried to create my own personalized colour theme for VSCode. And, I did that. I create pair of themes each for light and dark. Kindly do check out that 🙂.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fep5q8gatypyhs2todidn.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fep5q8gatypyhs2todidn.png" alt="Coding Theme"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Coding Theme - &lt;a href="https://marketplace.visualstudio.com/items?itemName=Rajeswaran.coding-theme" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/strong&gt;&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ys2mvti1zc0nn4pp7yk.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ys2mvti1zc0nn4pp7yk.png" alt="Coding Theme Light"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Coding Theme Light - &lt;a href="https://marketplace.visualstudio.com/items?itemName=Rajeswaran.coding-theme-light" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;And If you liked my theme, kindly share it with your friends.&lt;/p&gt;

&lt;p&gt;Have a great day :)&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>extension</category>
      <category>theme</category>
    </item>
  </channel>
</rss>
