<?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: Portious Banda</title>
    <description>The latest articles on DEV Community by Portious Banda (@portiousbanda).</description>
    <link>https://dev.to/portiousbanda</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%2F374900%2F61b56eb9-3dff-4f85-9944-d98eae3fbbc8.png</url>
      <title>DEV Community: Portious Banda</title>
      <link>https://dev.to/portiousbanda</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/portiousbanda"/>
    <language>en</language>
    <item>
      <title>Two simple CSS🍉 tips and a piece of love this Saturday.</title>
      <dc:creator>Portious Banda</dc:creator>
      <pubDate>Sat, 19 Mar 2022 13:20:57 +0000</pubDate>
      <link>https://dev.to/portiousbanda/two-simple-css-tips-and-a-piece-of-love-this-saturday-202p</link>
      <guid>https://dev.to/portiousbanda/two-simple-css-tips-and-a-piece-of-love-this-saturday-202p</guid>
      <description>&lt;p&gt;Hello, and thank you for choosing this article. I bring to you three amazing items, two for CSS and a piece of love from Twitter. I tried to include even links for further reading.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Though the title of the article favors beginners, anyone can read this; those interested to refresh their skills, or those paving their journey to senior developers. It depends on how you feel and the contents I have organized.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now let's dive in and get started.&lt;/p&gt;

&lt;h3&gt;
  
  
  The &lt;code&gt;inset&lt;/code&gt; CSS property
&lt;/h3&gt;

&lt;p&gt;Well, not a word so peculiar but a CSS property with abilities so fascinating. I have been passing it lately. I have had no intentions of learning what it does not until after the tweet below.&lt;/p&gt;


&lt;blockquote&gt;
&lt;p&gt;Damn i love the CSS inset property, it's short hand for top, left, bottom and right:&lt;br&gt;&lt;br&gt;stick to bottom:&lt;br&gt; position: absolute;&lt;br&gt; inset: auto 0 0 0;&lt;br&gt;&lt;br&gt;full screen:&lt;br&gt; position: absolute;&lt;br&gt; inset: 0;&lt;a href="https://t.co/fCcmDbRcgM"&gt;&lt;/a&gt;&lt;a href="https://t.co/fCcmDbRcgM"&gt;https://t.co/fCcmDbRcgM&lt;/a&gt;&lt;/p&gt;— Ada Rose Cannon (&lt;a class="mentioned-user" href="https://dev.to/adarosecannon"&gt;@adarosecannon&lt;/a&gt;) &lt;a href="https://twitter.com/AdaRoseCannon/status/1471855546580049925?ref_src=twsrc%5Etfw"&gt;December 17, 2021&lt;/a&gt;
&lt;/blockquote&gt; 

&lt;p&gt;I just said to myself, let me give it a try and this is what I found:&lt;/p&gt;

&lt;p&gt;Just like the tweet states, it's a shorthand that corresponds to the &lt;code&gt;top&lt;/code&gt;, &lt;code&gt;right&lt;/code&gt;, &lt;code&gt;bottom&lt;/code&gt;, and/or &lt;code&gt;left&lt;/code&gt; properties. &lt;/p&gt;

&lt;p&gt;It accepts numeric values in a clockwise direction, in the order &lt;em&gt;top&lt;/em&gt; &lt;em&gt;right&lt;/em&gt; &lt;em&gt;bottom&lt;/em&gt; and &lt;em&gt;left&lt;/em&gt;, meaning it has the same syntax as the &lt;em&gt;margin&lt;/em&gt; and &lt;em&gt;padding&lt;/em&gt; shorthand. &lt;/p&gt;

&lt;p&gt;It is part of the &lt;a href="https://adrianroselli.com/2019/11/css-logical-properties.html"&gt;CSS Logical Properties&lt;/a&gt; but it does not define logical offsets. It defines physical offsets, regardless of the element's writing mode, directionality, and text orientation.&lt;/p&gt;

&lt;p&gt;Before inset, the hack was to declare each inset sub-property separately, as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.box {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we can simplify that to a single line of CSS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.box {
  position: absolute;
  inset: 0; /* 🎉 */
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Syntax:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;inset:length|percentage|auto|inherit|initial|unset;

/* &amp;lt;length&amp;gt; values */
inset: 10px;   /* value applied to all edges */
inset: 4px 8px;   /* top/bottom left/right */
inset: 5px 15px 10px;   /* top left/right bottom */
inset: 2.4em 3em 3em 3em;   /* top right bottom left */

/* &amp;lt;percentage&amp;gt;s of the width (left/right) or height (top/bottom) of the containing block */
inset: 10% 5% 5% 5%;

/* Keyword value */
inset: auto;

/* Global values */
inset: inherit;
inset: initial;
inset: revert;
inset: unset;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;length&lt;/code&gt;: It sets a fixed value defined in px, cm, pt, etc. Negative values are also allowed. Its default value is 0px.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;percentage&lt;/code&gt;: It is the same as length but it set the size in terms of the percentage of the window size.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;auto&lt;/code&gt;: It is used when it is desired that the browser determines the inset size.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;initial&lt;/code&gt;: It is used to set the value of the inset property to its default value.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;inherit&lt;/code&gt;: It inherits the inset property value from its parent element.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;unset&lt;/code&gt;: It is used to unset the inset property and it is the default value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;More about the inset property &lt;a href="https://css-tricks.com/almanac/properties/i/inset/"&gt;here.&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Animating clip-paths
&lt;/h3&gt;

&lt;p&gt;One of the cool things we can do with clip-paths is animation.&lt;/p&gt;

&lt;p&gt;But only when the shapes are compatible can we animate our &lt;code&gt;clip-paths&lt;/code&gt;. That is keeping the same amount of points to animate with. &lt;br&gt;
For example, if we use a polygon as the first shape, then all the other shapes must be polygons with the same amount of coordinates(x y points). &lt;a href="https://codepen.io/portious_banda/pen/RwjYMBy"&gt;Here&lt;/a&gt; is a pen I made to demonstrate that. &lt;/p&gt;

&lt;p&gt;There are tons of situations on the web that require &lt;code&gt;clip-path&lt;/code&gt; CSS and it is just worth learning. Besides, animations are just so cool for users. Learn more about clip-path if you desire so by clicking &lt;a href="https://css-tricks.com/animating-with-clip-path/"&gt;here.&lt;/a&gt;&lt;/p&gt;



&lt;h3&gt;
  
  
  Today's advice is so simple and it's from one of the famous people on twitter.
&lt;/h3&gt;


&lt;blockquote&gt;
&lt;p&gt;"If you aren’t curious about it, you’ll never be good at it."&lt;a href="https://twitter.com/naval?ref_src=twsrc%5Etfw"&gt;@naval&lt;/a&gt;&lt;/p&gt;— Navalism (@NavalismHQ) &lt;a href="https://twitter.com/NavalismHQ/status/1498553624456138754?ref_src=twsrc%5Etfw"&gt;March 1, 2022&lt;/a&gt;
&lt;/blockquote&gt; 

&lt;p&gt;&lt;em&gt;Check your curiosity. Start learning!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A million thank you mate for making it this far. I'm so glad! However, I can only keep writing such articles if you like them so let me know what you think in the comments section below. I'll appreciate and take note of your reactions.&lt;/p&gt;

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