<?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: Marcos Rafael</title>
    <description>The latest articles on DEV Community by Marcos Rafael (@marcosrafael).</description>
    <link>https://dev.to/marcosrafael</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%2F844395%2Fc30bfb7f-4188-4aa1-92b7-ff780a93b93b.jpeg</url>
      <title>DEV Community: Marcos Rafael</title>
      <link>https://dev.to/marcosrafael</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marcosrafael"/>
    <language>en</language>
    <item>
      <title>Css Units</title>
      <dc:creator>Marcos Rafael</dc:creator>
      <pubDate>Sun, 01 May 2022 15:59:53 +0000</pubDate>
      <link>https://dev.to/marcosrafael/css-units-1ddp</link>
      <guid>https://dev.to/marcosrafael/css-units-1ddp</guid>
      <description>&lt;p&gt;Let's briefly learn about CSS units!&lt;/p&gt;

&lt;h2&gt;
  
  
  px (absolute)
&lt;/h2&gt;

&lt;p&gt;Avoid using 'px' for font-size. Use for small details, like shadow or borders.&lt;/p&gt;

&lt;h2&gt;
  
  
  % (relative)
&lt;/h2&gt;

&lt;p&gt;Good to use for layouts and width/height.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;size is defined as percentage of the value of the mostly parent element.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.example {
font-size: 20 px;
line-height: 50%; /* 10px */
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  em (relative)
&lt;/h2&gt;

&lt;p&gt;Can be used for font-size and margin/padding. This will adjust this properties based on that element's font size.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;changes behavior based on property&lt;/li&gt;
&lt;li&gt;'em' = parent font-size&lt;/li&gt;
&lt;li&gt;if parent don't have a size, defaults to 16px (body)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.parent-div {
font-size: 10px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.list-item {
font-size: 2em; /* 10px * 2 or 20px */ 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Rem (relative)
&lt;/h2&gt;

&lt;p&gt;You can also use 'rem' for font-size and margin/padding. 'rem' is easier to work with than 'em', because it's more consistent.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Relative to hoot HTML, no matter what(default is 16px)&lt;/li&gt;
&lt;li&gt;You can change the root HTML size. For example, if you change it to 20px, 1 'rem' will always be 20px.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;html {
font-size: 10px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;p{
font-size: 1.5rem;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we've set the HTML default size to 10px. So, 1.5 rem is 15px. 2rem will be 20px instead of default 32px.&lt;/p&gt;

&lt;h2&gt;
  
  
  vw/vh (relative)
&lt;/h2&gt;

&lt;p&gt;ww/vw are relative to the width/height of the browser window. 100vw means full width of the screen. Use vw/vh for bigger layouts, like background.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;very useful for responsive websites because everything scales.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ch (relative)
&lt;/h2&gt;

&lt;p&gt;'ch' is relative to the width of the number 0 of the current font.'ch' is used to size the width of a paragraph. In general, you want a 45-70 character wide column for readability.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You would use it like this:&lt;/li&gt;
&lt;li&gt;max-width: 20ch;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This set the width of the column to a maximum of 20 characters per line.&lt;/p&gt;

&lt;h2&gt;
  
  
  this  is hard to remember, so...
&lt;/h2&gt;

&lt;p&gt;Like and Save this post&lt;/p&gt;

&lt;p&gt;credits to Sai Pranay for the inspiration.&lt;/p&gt;

</description>
      <category>css</category>
      <category>html</category>
      <category>react</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Test for Github workflow</title>
      <dc:creator>Marcos Rafael</dc:creator>
      <pubDate>Tue, 26 Apr 2022 03:12:06 +0000</pubDate>
      <link>https://dev.to/marcosrafael/test-for-github-workflow-1hck</link>
      <guid>https://dev.to/marcosrafael/test-for-github-workflow-1hck</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/marcos-rafael-br"&gt;https://github.com/marcos-rafael-br&lt;/a&gt;&lt;/p&gt;

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