<?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: nolasco7a</title>
    <description>The latest articles on DEV Community by nolasco7a (@nolasco7a).</description>
    <link>https://dev.to/nolasco7a</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%2F359146%2F218fc8ec-b74d-4610-a62b-1a172526a0d2.png</url>
      <title>DEV Community: nolasco7a</title>
      <link>https://dev.to/nolasco7a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nolasco7a"/>
    <language>en</language>
    <item>
      <title>Responsive typography</title>
      <dc:creator>nolasco7a</dc:creator>
      <pubDate>Thu, 25 May 2023 20:38:36 +0000</pubDate>
      <link>https://dev.to/nolasco7a/responsive-typography-1eha</link>
      <guid>https://dev.to/nolasco7a/responsive-typography-1eha</guid>
      <description>&lt;p&gt;I have experience as a developer but I get surprise because every time you can discover new things, in my case I discover the power of font-size as size base for HTML document or web page&lt;/p&gt;

&lt;p&gt;let me explain, everybody knows 1rem = 16px, but.... why.&lt;br&gt;
this is thanks to font-size base in HTML that is 16px by default, then if you change your font-size to 20px, now 1rem = 20px, and then instead of changing all our typography classes or styles, we can simplify this task making the following to create a fully responsive typography:&lt;/p&gt;

&lt;p&gt;Imagine that you have the following styles for you typography&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;p {margin-bottom: 1rem;}

h1, h2, h3, h4, h5 {
  margin: 3rem 0 1.38rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  line-height: 1.3;
}

h1 {
  margin-top: 0;
  font-size: 3.052rem;
}

h2 {font-size: 2.441rem;}

h3 {font-size: 1.953rem;}

h4 {font-size: 1.563rem;}

h5 {font-size: 1.25rem;}

small, .text_small {font-size: 0.8rem;}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now to become our styles to a fully responsive typography we only have to add a media queries to change our font-size base&lt;br&gt;
example:&lt;br&gt;
&lt;/p&gt;

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

/* Media queries */
@media (max-width: 768px) {
  html {
    font-size: 12px;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then we have a typography fully responsive for our website, where for small devices 1rem = 12px and for other device sizes 1rem = 16px.&lt;/p&gt;

&lt;p&gt;I hope this blog helps someone.&lt;/p&gt;

</description>
      <category>css</category>
      <category>responsivedesign</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
