<?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: kachel</title>
    <description>The latest articles on Forem by kachel (@kachel).</description>
    <link>https://forem.com/kachel</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%2F1253664%2F60aa4778-5ef8-4a3d-b80a-752f10242193.png</url>
      <title>Forem: kachel</title>
      <link>https://forem.com/kachel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/kachel"/>
    <language>en</language>
    <item>
      <title>css breakfast #3</title>
      <dc:creator>kachel</dc:creator>
      <pubDate>Mon, 22 Jan 2024 21:24:05 +0000</pubDate>
      <link>https://forem.com/kachel/css-breakfast-3-1idm</link>
      <guid>https://forem.com/kachel/css-breakfast-3-1idm</guid>
      <description>&lt;p&gt;this blog post is more like a little snack. &lt;/p&gt;

&lt;p&gt;after watching Kevin Powell's styling underlined links &lt;a href="https://www.youtube.com/watch?v=x3MTfp3HDLc"&gt;video&lt;/a&gt;... i knew i had to try it out for myself!!&lt;/p&gt;

&lt;h2&gt;
  
  
  fancy &lt;code&gt;a&lt;/code&gt; tags
&lt;/h2&gt;

&lt;p&gt;turns out we do not need any of that pseudo class schtuff anymore!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a {
  text-decoration: none;
  position: relative;
}

a::after {
  content: '';
  position: absolute;
  width: 100%;
  bottom: -5px;
  left: 0;
  height: 3px;
  background: lime;
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://i.giphy.com/media/UrcXN0zTfzTPi/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/UrcXN0zTfzTPi/giphy.gif" alt="bye bye" width="245" height="200"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;instead we should use &lt;code&gt;text-decoration&lt;/code&gt;~! with it we can change the thickness, color, style, and line. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7vis1quk8k7rjqcnzug8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7vis1quk8k7rjqcnzug8.png" alt="screenshot of a styled a tag" width="800" height="236"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a {
  color: hotpink;
  text-decoration-thickness: 8px;
  text-decoration-color: lime;
  text-decoration-style: wavy;
  text-decoration-skip-ink: all;
  text-decoration-line: underline; 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;but that is so much typing, right?? &lt;/p&gt;

&lt;p&gt;good news!! you can shrink it down to one line &amp;lt;333 &lt;code&gt;text-decoration: 8px lime solid underline;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;here is a &lt;a href="https://codepen.io/kachel-the-decoder/pen/mdoMbzv?editors=1100"&gt;codepen&lt;/a&gt; where i do a couple smol animations to change the link stylings. &lt;/p&gt;

&lt;p&gt;ope! forgot about one more thing! in order to change the position of the underline, you will have to use a non decoration style called &lt;code&gt;text-underline-offset&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;now is your time to get fancy with your links. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/HDNcjt5ELkJSE/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/HDNcjt5ELkJSE/giphy.gif" alt="fancy" width="500" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
    </item>
    <item>
      <title>css breakfast #2</title>
      <dc:creator>kachel</dc:creator>
      <pubDate>Wed, 17 Jan 2024 18:57:06 +0000</pubDate>
      <link>https://forem.com/kachel/css-breakfast-2-3agm</link>
      <guid>https://forem.com/kachel/css-breakfast-2-3agm</guid>
      <description>&lt;p&gt;a meandering list of responsive tips&lt;/p&gt;

&lt;h2&gt;
  
  
  height + width... do not do it
&lt;/h2&gt;

&lt;p&gt;just don't. it is better to not use &lt;code&gt;height&lt;/code&gt; or &lt;code&gt;width&lt;/code&gt; to set the size for a responsive element!! instead it is better to set a &lt;code&gt;min-height&lt;/code&gt; or &lt;code&gt;max-width&lt;/code&gt;!&lt;/p&gt;

&lt;p&gt;setting a specific &lt;code&gt;height&lt;/code&gt; or &lt;code&gt;width&lt;/code&gt; can cause wonky overflow issues. barf horizontal scrolling. ew.&lt;/p&gt;

&lt;p&gt;using a max or min allows the elements to shrink or grown properly.&lt;/p&gt;

&lt;p&gt;it is a little hard to remember but for heights you want &lt;code&gt;min&lt;/code&gt; and for widths you want &lt;code&gt;max&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;here it is in action:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
    max-width: 960px;
    min-height: 500px;
    margin-inline: auto;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;note&lt;/em&gt;: that these general rules do not follow for elements with small specific sizes, maybe like a user's avatar or icons. &lt;/p&gt;

&lt;h2&gt;
  
  
  sometimes css is not as it seems!
&lt;/h2&gt;

&lt;p&gt;try this example out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  width: 100vw;
  height: 100vh;
  border: red solid 4px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;notice the horizontal scrolling!?!? what the heck, right? turns out that the scrollbar is actually taking up some of that screen real estate!! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/WtOdb75cMcjIK2jmTq/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/WtOdb75cMcjIK2jmTq/giphy.gif" alt="mind blown" width="480" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;less is more in this case. no need to declare that &lt;code&gt;100vh&lt;/code&gt; when the element is already a block. taking up all the room it needs. &lt;/p&gt;

&lt;p&gt;better to use something like &lt;code&gt;width: auto;&lt;/code&gt;. as a general rule, it is best to work with the browser than against it. &lt;/p&gt;

&lt;p&gt;counterintuitively viewport units are not more responsive... in fact, they do not quite work the way you think they are going to! using them in clamp might be a use case &lt;a href="https://dev.to/kachel/css-breakfast-1-38oo"&gt;see my previous article&lt;/a&gt;. but really just better avoid them for now. &lt;/p&gt;

&lt;h2&gt;
  
  
  overflowing images?? clean it up
&lt;/h2&gt;

&lt;p&gt;i love this one cause it is just one little line of css that does the trick!! bam. no mo' overflo'.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;img {
  display: block;
  max-width: 100%;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  let the browser do its thang
&lt;/h2&gt;

&lt;p&gt;using flex + wrap can do away with the need for specific media queries!! in the example below, instead of declaring widths for the containing unordered list element, best to let the browser figure out those wrap points for you!!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3rem;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;that concludes this little css breakfast!! thanks for reading. and if you take anything away from this post, let it be "work with the browser. it is your bestie."&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uyunBvGs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a6m0vfb6v7p1ef0jcvym.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uyunBvGs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a6m0vfb6v7p1ef0jcvym.png" alt="bestie browser" width="800" height="635"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;source:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"A practical guide to responsive web design", Kevin Powell, &lt;a href="https://youtu.be/x4u1yp3Msao?si=nPD0eUGxF1kcttVq"&gt;https://youtu.be/x4u1yp3Msao?si=nPD0eUGxF1kcttVq&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;if anything is wrong lemme know! i aint perfect.&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
    </item>
    <item>
      <title>css breakfast #1</title>
      <dc:creator>kachel</dc:creator>
      <pubDate>Wed, 10 Jan 2024 18:13:43 +0000</pubDate>
      <link>https://forem.com/kachel/css-breakfast-1-38oo</link>
      <guid>https://forem.com/kachel/css-breakfast-1-38oo</guid>
      <description>&lt;h2&gt;
  
  
  &lt;code&gt;clamp()&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;starting a mini blog series where i take a css concept and do a little dive onto how to use it and why i like it!!&lt;/p&gt;

&lt;p&gt;calling the series "css breakfast" because like the most important meal of the day, it is important to learn how to use the tools of the web without relying on JS or utility frameworks... &amp;gt;.&amp;lt; ( ok ok ok i will put away my soapbox now)&lt;/p&gt;

&lt;p&gt;we are starting off the blog series strong with a new favorite &lt;code&gt;clamp()&lt;/code&gt;!! it takes three params: &lt;code&gt;min&lt;/code&gt;, &lt;code&gt;current&lt;/code&gt;, and &lt;code&gt;max&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;things we like: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;replaces media queries for dynamic typography!&lt;/li&gt;
&lt;li&gt;good browser support!  ( whatevs IE )&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;things we don't like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you gotta be careful when using a relative unit for the current param as it affects manual zooming in and zooming out ( aka the size does not change when you do that )&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;^^^ in order to fix that problem it is best to mix the units for the current param: &lt;code&gt;clamp(50px, calc(7vw + 1 rem), 100px)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;imho the coolest thing you can do with this is set css variables with all your font sizes!! look at how gorgeous that is &amp;lt;333&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  --fs-300: clamp(0.94rem, calc(0.92rem + 0.08vw), 0.98rem);
  --fs-400: clamp(1.13rem, calc(1.06rem + 0.33vw), 1.31rem);
  --fs-500: clamp(1.35rem, calc(1.21rem + 0.69vw), 1.75rem);
  --fs-600: clamp(1.62rem, calc(1.37rem + 1.24vw), 2.33rem);
  --fs-700: clamp(1.94rem, calc(1.54rem + 2.03vw), 3.11rem);
  --fs-800: clamp(2.33rem, calc(1.7rem + 3.15vw), 4.14rem);
  --fs-900: clamp(2.8rem, calc(1.85rem + 4.74vw), 5.52rem);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;as with anything you gotta play around with the best sizes for your site! but say goodbye to those old dusty media queries and say hello to &lt;code&gt;clamp&lt;/code&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%2Fcfamc4b3zoj9e3fm6g7e.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%2Fcfamc4b3zoj9e3fm6g7e.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;resources&lt;/strong&gt;:&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/clamp" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/clamp&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=erqRw3E-vn4" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=erqRw3E-vn4&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=U9VF-4euyRo" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=U9VF-4euyRo&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=pbD55DJgOlw" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=pbD55DJgOlw&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;if anything is wrong lemme know! i aint perfect. &lt;/p&gt;

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