<?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: Xaver Fleer</title>
    <description>The latest articles on DEV Community by Xaver Fleer (@xaverfleer).</description>
    <link>https://dev.to/xaverfleer</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%2F484637%2Fd84f862c-1b0c-473f-9031-921fb87f54e8.jpeg</url>
      <title>DEV Community: Xaver Fleer</title>
      <link>https://dev.to/xaverfleer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xaverfleer"/>
    <language>en</language>
    <item>
      <title>1 Line of Spec a Day</title>
      <dc:creator>Xaver Fleer</dc:creator>
      <pubDate>Fri, 18 Jun 2021 21:44:44 +0000</pubDate>
      <link>https://dev.to/xaverfleer/1-line-of-spec-a-day-4kp7</link>
      <guid>https://dev.to/xaverfleer/1-line-of-spec-a-day-4kp7</guid>
      <description>&lt;p&gt;...keeps JavaScript guesswork away.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why?
&lt;/h1&gt;

&lt;p&gt;JavaScript is a wonderful language. Also a horrible one. Telling enough: Douglas Crockford's seminal book &lt;em&gt;JavaScript the good parts&lt;/em&gt; contains many pages on &lt;em&gt;The Bad Parts&lt;/em&gt; and &lt;em&gt;The Aweful Parts&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Life is too short for guesswork&lt;/strong&gt; what JavaScript does and for hoping it to do the right thing. On my quest to mastery I start a new challenge: &lt;strong&gt;Reading (at least) 1 line of Spec a Day&lt;/strong&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  How long will it take?
&lt;/h1&gt;

&lt;p&gt;The &lt;a href="https://tc39.es/ecma262/"&gt;spec&lt;/a&gt; has about 30 000 characters. Divide this by 60 characters per line leads to 500 days. This is 1 year 4 months and 15 days. Of course, I can read more than just one sentence a day to speed the process up. But the goal is just 1 line per day.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why just one line?
&lt;/h1&gt;

&lt;p&gt;Big tasks are hard to master. Perseverance is key. If I want to finish reading the spec I need to make reading a habit. This can only either achieved by strong willpower (which is difficult for me as father of a newborn) or by starting it gradually with a minimally exhausting task per day (it is hard for me to argue that 1 line of code is too much to read at any given day)&lt;/p&gt;

&lt;h1&gt;
  
  
  What are my main learnings?
&lt;/h1&gt;

&lt;p&gt;It's actually possible to read the whole spec in a reasonable amount of time.&lt;/p&gt;

&lt;p&gt;--&lt;/p&gt;

&lt;p&gt;#1LineOfSpec #1/N&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>spec</category>
    </item>
    <item>
      <title>How I Use CSS Grid for Sticky Headers</title>
      <dc:creator>Xaver Fleer</dc:creator>
      <pubDate>Wed, 07 Oct 2020 20:30:28 +0000</pubDate>
      <link>https://dev.to/xaverfleer/how-i-use-css-grid-for-sticky-headers-2ong</link>
      <guid>https://dev.to/xaverfleer/how-i-use-css-grid-for-sticky-headers-2ong</guid>
      <description>&lt;p&gt;Adam Racki's great &lt;a href="https://css-tricks.com/how-to-use-css-grid-for-sticky-headers-and-footers/"&gt;blog post&lt;/a&gt; made me realize that it is possible to use &lt;code&gt;display: grid&lt;/code&gt; to create sticky headers. As much as the contribution inspired me, it also confused me (why all this complexity in the code examples??). Here is what I took from it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Sticky headers traditionally get positioned with &lt;code&gt;display: absolute;&lt;/code&gt; or &lt;code&gt;display: fixed;&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;While this does work, there is a much more elegant syntax with &lt;code&gt;display: grid&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Demo: &lt;iframe height="600" src="https://codepen.io/xaverfleer/embed/JjKjLmr?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;

&lt;/h2&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;h3&gt;
  
  
  HTML
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Sticky Header&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;body&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"wrapper"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"sticky"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;A Panda Bear&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;main&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"scroll-element"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"A panda bear"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"500px"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://images.unsplash.com/photo-1526716121440-dc3b4f254a0a"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  CSS
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nf"&gt;#wrapper&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;500px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;#scroll-element&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;overflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  What's the magic?
&lt;/h2&gt;

&lt;p&gt;tbh, there is none (as with everything you understand).&lt;/p&gt;

&lt;h2&gt;
  
  
  Really, what's going on?
&lt;/h2&gt;

&lt;p&gt;Together the heading and the content are larger than what can be shown at once. The image is stands for lot of content. It has a fixed (large) height.&lt;/p&gt;

&lt;p&gt;The CSS rule &lt;code&gt;overflow: auto;&lt;/code&gt; allows the browser to scroll the &lt;code&gt;id="scroll-element"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The header with &lt;code&gt;id="sticky"&lt;/code&gt; is always completely shown since the &lt;code&gt;id="scroll-element"&lt;/code&gt; can shrink and overflow.&lt;/p&gt;

&lt;p&gt;That's it.&lt;/p&gt;

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