<?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: jonosellier</title>
    <description>The latest articles on DEV Community by jonosellier (@jonosellier).</description>
    <link>https://dev.to/jonosellier</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%2F372558%2Fb5639a18-8010-4f3c-8dbb-12f5061d69eb.png</url>
      <title>DEV Community: jonosellier</title>
      <link>https://dev.to/jonosellier</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jonosellier"/>
    <language>en</language>
    <item>
      <title>You don't need... JavaScript to do tabs</title>
      <dc:creator>jonosellier</dc:creator>
      <pubDate>Tue, 05 Apr 2022 20:47:28 +0000</pubDate>
      <link>https://dev.to/jonosellier/you-dont-need-javascript-to-do-tabs-5g3b</link>
      <guid>https://dev.to/jonosellier/you-dont-need-javascript-to-do-tabs-5g3b</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;The current development ecosystems we code in make it &lt;em&gt;so easy&lt;/em&gt; to make a highly interactive experience with client-side code. Sometimes we reach for JavaScript (or worse yet, a whole framework) when we should hold off on that for as long as possible. &lt;/p&gt;

&lt;p&gt;This is the first of (hopefully) many entries in a series I like to call &lt;strong&gt;You don't need...&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What do we need for tab navigation?
&lt;/h2&gt;

&lt;p&gt;To do tabs we need to do 2 things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Track the current tab index&lt;/li&gt;
&lt;li&gt;Show and hide tab content based on the index&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And CSS can do both!&lt;/p&gt;

&lt;h2&gt;
  
  
  The principals
&lt;/h2&gt;

&lt;p&gt;CSS has a class of selectors called a sibling selector (&lt;code&gt;+&lt;/code&gt; for immediately after and &lt;code&gt;~&lt;/code&gt; for somewhere after) which will select a sibling element (one that is on the same "level" and shares their containing element).&lt;/p&gt;

&lt;p&gt;CSS also has &lt;code&gt;nth&lt;/code&gt; pseudo selectors, specifically the &lt;code&gt;:nth-of-type(i)&lt;/code&gt; selector which will select the &lt;code&gt;i&lt;/code&gt;th element of whatever selector you put before it.&lt;/p&gt;

&lt;p&gt;The CSS principal you need to understand is the &lt;code&gt;:checked&lt;/code&gt; pseudo selector which applies to &lt;code&gt;input&lt;/code&gt; elements that have been checked (like a radio button or check box&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting it done
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Track the current tab index
&lt;/h3&gt;

&lt;p&gt;In JavaScript we would update the tab index whenever we clicked on the tab. CSS has a way of tracking &lt;code&gt;input&lt;/code&gt; element state with &lt;code&gt;:checked&lt;/code&gt; as mentioned above so we can detect this in CSS with &lt;code&gt;input.tab:checked:nth-of-type(i)&lt;/code&gt; where &lt;code&gt;i&lt;/code&gt; is the index of the tab selected. We can make a new rule for every tab but it's kind of useless without some action based on the index&lt;/p&gt;

&lt;h3&gt;
  
  
  Show and hide tab content based on selected index
&lt;/h3&gt;

&lt;p&gt;For starters, the default state of a tab is hidden so I think &lt;code&gt;display: none&lt;/code&gt; on our tab content is obvious. And showing it is as simple as &lt;code&gt;display: block&lt;/code&gt;. The trick is showing the &lt;code&gt;i&lt;/code&gt;th content when the &lt;code&gt;i&lt;/code&gt;th tab is selected. For that we use the &lt;code&gt;~&lt;/code&gt; (general sibling) selector. As long as your tabs are of one type (probably a &lt;code&gt;label&lt;/code&gt; element for each of your hidden &lt;code&gt;input&lt;/code&gt; state-managing elements) and your content is another type (a &lt;code&gt;div&lt;/code&gt; maybe?) then you can group them as different "types" and use a rule like &lt;code&gt;input.tab:checked:nth-of-type(1)~div.tab-content:nth-of-type(1)&lt;/code&gt; to select the first tab content element whenever the first tab is selected&lt;/p&gt;

&lt;h2&gt;
  
  
  A working example
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://jsfiddle.net/brq8g0um/"&gt;JSFiddle link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also change the input type to &lt;code&gt;checkbox&lt;/code&gt; for toggles &lt;a href="https://jsfiddle.net/dsj7poar/"&gt;JSFiddle link&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How long does it take for you to resort to JavaScript to perform interactivity on an otherwise static site?
&lt;/h2&gt;

&lt;p&gt;I am curious what other people think of avoiding JavaScript. I personally prefer to avoid it if the site is going to be mostly static since it means all my &lt;code&gt;noscript&lt;/code&gt; users still have a good experience. At the very least, I want them to be able to sucessfuly use the site in a limited form, even if the optional frills I throw in do not function&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>css</category>
      <category>tutorial</category>
      <category>a11y</category>
    </item>
    <item>
      <title>Things you might not know about Windows Terminal</title>
      <dc:creator>jonosellier</dc:creator>
      <pubDate>Mon, 20 Dec 2021 13:08:06 +0000</pubDate>
      <link>https://dev.to/jonosellier/things-you-might-not-know-about-windows-terminal-ma2</link>
      <guid>https://dev.to/jonosellier/things-you-might-not-know-about-windows-terminal-ma2</guid>
      <description>&lt;p&gt;With Microsoft announcing that Windows Terminal will be the &lt;a href="https://www.theverge.com/2021/12/15/22837218/microsoft-windows-terminal-default-windows-11-changes" rel="noopener noreferrer"&gt;new default terminal&lt;/a&gt;, I wanted to take the time to share some of the things you might not know about the new default.&lt;/p&gt;

&lt;h2&gt;
  
  
  Launch anything
&lt;/h2&gt;

&lt;p&gt;You can configure Windows Terminal with various profiles that let you launch into any program you want. &lt;/p&gt;

&lt;p&gt;Say you needed to remote into a machine super often. Setting up a profile with &lt;code&gt;ssh user@hostname&lt;/code&gt; puts you right into that machine with a &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;Shift&lt;/code&gt; + &lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt; keystroke. The same can be done for WSL containers or REPLs. I literally use my Node REPL profile daily for quickly transforming objects or making quick calculations. &lt;/p&gt;

&lt;h2&gt;
  
  
  Launch Anywhere
&lt;/h2&gt;

&lt;p&gt;You can also set your starting directory so you can have shortcuts to open a new tab in any directory you choose. I use this to quickly get between my main projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Launch as anyone
&lt;/h2&gt;

&lt;p&gt;This is more of a hacky workaround for the PowerShell "Run as different user" option but as long as you have an SSH server running you can SSH into your own system as another user. Simply run &lt;code&gt;ssh [domain\]username@localhost&lt;/code&gt; and you're able to log in (as admin)! If you find yourself doing this often, put it in a profile since it's no different to any other SSH command.&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%2Fcontent.spiceworksstatic.com%2Fservice.community%2Fp%2Fpost_images%2F0000350437%2F5c93d00b%2Fattached_image%2FUntitled.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%2Fcontent.spiceworksstatic.com%2Fservice.community%2Fp%2Fpost_images%2F0000350437%2F5c93d00b%2Fattached_image%2FUntitled.png" alt="The feature we are trying to emulate"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The feature we are trying to emulate&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Have a terminal that looks like it's been updated since the 90s
&lt;/h2&gt;

&lt;p&gt;Windows Terminal supports ligatures and &lt;a href="https://www.nerdfonts.com/" rel="noopener noreferrer"&gt;Nerd Fonts&lt;/a&gt; so installing one of those opens the door to alternative prompts like &lt;a href="https://ohmyposh.dev" rel="noopener noreferrer"&gt;Oh My Posh&lt;/a&gt; that gives you inline Git info, privilege level and so on. I have mentioned this before and go into greater detail on &lt;a href="https://dev.to/jonosellier/4-must-have-tools-for-developing-on-windows-3eg8"&gt;another post&lt;/a&gt; but it's worth mentioning again because it's so good. &lt;/p&gt;

&lt;h3&gt;
  
  
  Bonus modernization features you should install anyways
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/devblackops/Terminal-Icons" rel="noopener noreferrer"&gt;Terminal Icons&lt;/a&gt; makes your &lt;code&gt;ls&lt;/code&gt; a bit prettier and more useful. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://tech.ligthartnet.nl/powershell-tab-completion/" rel="noopener noreferrer"&gt;Change Tab Completion&lt;/a&gt; so you can see all arguments and options available to you. You can also bind &lt;code&gt;UpArrow&lt;/code&gt; and &lt;code&gt;DownArrow&lt;/code&gt; to &lt;code&gt;HistorySearchForward&lt;/code&gt; and &lt;code&gt;HistorySearchBackward&lt;/code&gt; in the same way to cycle the history of commands starting with what you typed.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>productivity</category>
      <category>windows</category>
      <category>terminal</category>
      <category>cli</category>
    </item>
    <item>
      <title>Easy Overlay Scrollbars with Reactive Design</title>
      <dc:creator>jonosellier</dc:creator>
      <pubDate>Fri, 29 Oct 2021 23:51:51 +0000</pubDate>
      <link>https://dev.to/jonosellier/easy-overlay-scrollbars-variable-width-1mbh</link>
      <guid>https://dev.to/jonosellier/easy-overlay-scrollbars-variable-width-1mbh</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;As of Chromium 114 (June 2023) overlay scrollbar functionality has been removed and therefore this guide is no longer valid.&lt;/strong&gt; While I understand wanting to conform to a standard, it is unfortunate that this functionality has been removed. Being unable to have a native scrollbar overlay content at the developer's discretion negatively affects the number of ways one can lay content out without UI items jumping around due to scrollbar space requirements changing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why even use overlay scrollbars?
&lt;/h2&gt;

&lt;p&gt;Overlay scrollbars are great because they don't affect the width of the content as they appear and disappear. When I discovered this trick, I was specifically looking to solve the problem of content reflow as a page went from &lt;code&gt;&amp;lt;100vh&lt;/code&gt; to &lt;code&gt;&amp;gt;100vh&lt;/code&gt;. The other nice thing with overlay scrollbars is that they can more seamlessly get out of the way when you aren't using them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Great, how do I do it?
&lt;/h2&gt;

&lt;p&gt;With &lt;code&gt;overflow: overlay&lt;/code&gt;. Seems too easy right? Well it's Chromium only (so Edge, Brave, Chrome) so it can't be your only overflow option. Ideally, you want to wrap it in &lt;code&gt;@supports(overflow: overlay)&lt;/code&gt; with a fallback to &lt;code&gt;auto&lt;/code&gt; or &lt;code&gt;scroll&lt;/code&gt;. This is what it looks like on Windows without any further styling:&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%2F0xkn4h9pnciunqn7d7ut.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%2F0xkn4h9pnciunqn7d7ut.png" alt="What overly scrollbars look like on Windows without any further styling"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll notice that the scrollbars literally &lt;em&gt;just&lt;/em&gt; go over the content. We'll need to make the scrollbars look a bit better:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Transparent background so we can see the content it overlays&lt;/li&gt;
&lt;li&gt;Semitransparent scrollbar for the same reason&lt;/li&gt;
&lt;li&gt;Small enough it doesn't get in the way&lt;/li&gt;
&lt;li&gt;Big enough for a mouse to click and grab (because our grandfathers deserve to scroll how they're used to)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So all we have to do is use some scrollbar CSS (which is supported on Chromium too) to make it look a bit better...&lt;/p&gt;

&lt;p&gt;Apply the following CSS...&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;span class="nt"&gt;body&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="n"&gt;overlay&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;::-webkit-scrollbar&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="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;16px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;::-webkit-scrollbar-button&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="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;::-webkit-scrollbar-track&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#00000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;::-webkit-scrollbar-track-piece&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#00000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;::-webkit-scrollbar-thumb&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#00000040&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="m"&gt;#ffffff40&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;24px&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;p&gt;...and we get this:&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%2Fgybf24srysqcavn4h28d.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%2Fgybf24srysqcavn4h28d.png" alt="The scrollbar in a usable but imperfect form"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll see that the scrollbar is wide enough to grab with a mouse (it's as wide as it is on Windows, &lt;code&gt;16px&lt;/code&gt;) but a bit too wide as a pure indicator. Those last 2 points are important but seem to be a bit contradictory. We could make the scrollbar get bigger on hover but you need to hit that small target before it gets bigger so you might as well keep it small. Unless we...&lt;/p&gt;

&lt;h2&gt;
  
  
  (Ab)use shadows to make things more usable
&lt;/h2&gt;

&lt;p&gt;If we set the shadow behind the scrollbar to be some solid inset shadow and a large, transparent border, then we can make the bar itself transparent, so the only thing we see is the inset shadow, that is smaller than the bar itself due to the border.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;::-webkit-scrollbar-thumb&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#00000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="nb"&gt;transparent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;24px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt; &lt;span class="m"&gt;#00000040&lt;/span&gt; &lt;span class="nb"&gt;inset&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;::-webkit-scrollbar-thumb:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#00000040&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="nb"&gt;transparent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&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;p&gt;The result we get is a bar that looks 6px wide but is really 16px:&lt;br&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%2Fe5ddfqpheqd83asns6lx.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%2Fe5ddfqpheqd83asns6lx.png" alt="A small scrollbar"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And when we hover near the "smaller bar" (within 5px), it looks just the same as before with the same pointer target size since the element itself is not any smaller.&lt;/p&gt;

&lt;p&gt;Now if we extract that color to a CSS variable we can go further!&lt;/p&gt;

&lt;h2&gt;
  
  
  Going even further
&lt;/h2&gt;

&lt;p&gt;We gotta extract that scrollbar color to a variable, let's call it &lt;code&gt;--scrollbar-color&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Then let's add a few more CSS rules to change this scrollbar color based on whether or not the page/element is focused. This is the new CSS that uses variables and &lt;code&gt;:hover&lt;/code&gt;, etc. selectors:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--scrollbar-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#00000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;:focus&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;:focus-within&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--scrollbar-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#00000040&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;::-webkit-scrollbar-thumb&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#00000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="nb"&gt;transparent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;24px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--scrollbar-color&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nb"&gt;inset&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nd"&gt;::-webkit-scrollbar-thumb:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--scrollbar-color&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="nb"&gt;transparent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&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;p&gt;This will make your scrollbar invisible unless you hover over the element (or page).&lt;/p&gt;

&lt;p&gt;But what if we want it to look like a mobile phone's indicator that disappears unless we are currently scrolling? Well for that we finally need JavaScript&lt;/p&gt;

&lt;h2&gt;
  
  
  Finally needing JavaScript
&lt;/h2&gt;

&lt;p&gt;We got pretty far with CSS but it's time to listen for events, scroll events. Below we add a class to &lt;code&gt;body&lt;/code&gt; whenever we are currently scrolling. &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;barTimeout&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onscroll&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;barTimeout&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="nf"&gt;clearTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;barTimeout&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//clear to reset&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;barTimeout&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;scrolling&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//0.5s delay&lt;/span&gt;
  &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;scrolling&lt;/span&gt;&lt;span class="dl"&gt;'&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;p&gt;Then we adjust our CSS a little to instead change the &lt;code&gt;--scrollbar-color&lt;/code&gt; on &lt;code&gt;body.scrolling&lt;/code&gt;:&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;p&gt;&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
  &lt;span class="py"&gt;--scrollbar-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#00000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="nc"&gt;.scrolling&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
  &lt;span class="py"&gt;--scrollbar-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#00000040&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Final touches for production&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;Just make sure to wrap all this CSS in &lt;code&gt;@supports(overflow: overlay)&lt;/code&gt; and so on! It will work in this current state on &lt;a href="https://caniuse.com/css-overflow-overlay" rel="noopener noreferrer"&gt;79% of browsers we want to target*&lt;/a&gt; but we need to support Safari and Firefox still!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;* Since we are emulating mobile device scrollbars, we can only look at desktop browsers&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The final product
&lt;/h2&gt;

&lt;p&gt;Available on JSFiddle with hover effect &lt;a href="https://jsfiddle.net/fhb4k15o/48/" rel="noopener noreferrer"&gt;here&lt;/a&gt; and scroll effect &lt;a href="https://jsfiddle.net/fhb4k15o/50/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Let me know if this helps you out in any way! 🚀
&lt;/h2&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>showdev</category>
    </item>
    <item>
      <title>4 Must-Have Tools for Developing on Windows</title>
      <dc:creator>jonosellier</dc:creator>
      <pubDate>Wed, 23 Sep 2020 00:45:37 +0000</pubDate>
      <link>https://dev.to/jonosellier/4-must-have-tools-for-developing-on-windows-3eg8</link>
      <guid>https://dev.to/jonosellier/4-must-have-tools-for-developing-on-windows-3eg8</guid>
      <description>&lt;p&gt;No I am not talking about &lt;em&gt;those&lt;/em&gt; apps, the ones everyone probably already has installed. The VSCodes, the VIMs, the Postmans. Nor am I talking about any of those environments that you only use because that's what you are developing for, no Node or Deno here, not even Docker. But you should totally try them all out if you haven't.&lt;/p&gt;

&lt;h1&gt;
  
  
  Notepads
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://www.notepadsapp.com/" rel="noopener noreferrer"&gt;Notepads&lt;/a&gt; is a Windows App developed by a Microsoft Employee. That being said, it is not endorsed by Microsoft. It is simply a more refined version of Notepad. It has tabs, it renders markdown, it has a dark mode and ligature support. It can't open files greater than 1MB but the point of this is to open smaller files for quick editing, anything larger than 100 lines and I'd want a more full-fledged editor with highlighting and so on. It can also be launched from the terminal, just like Notepad. I use this for when the .25s VSCode takes to launch is too long or as a persistent clipboard or as an alternative to Sticky Notes.&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%2Fstatic.wixstatic.com%2Fmedia%2F0fcd80_f13c96da960d491fa8862087ad614ce4~mv2.png%2Fv1%2Ffill%2Fw_588%2Ch_450%2Cal_c%2Cq_85%2Cusm_0.66_1.00_0.01%2F1.webp" 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%2Fstatic.wixstatic.com%2Fmedia%2F0fcd80_f13c96da960d491fa8862087ad614ce4~mv2.png%2Fv1%2Ffill%2Fw_588%2Ch_450%2Cal_c%2Cq_85%2Cusm_0.66_1.00_0.01%2F1.webp"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Image from the Notepads website&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  A good monospace font
&lt;/h1&gt;

&lt;p&gt;I am going to come out and say that &lt;a href="https://github.com/tonsky/FiraCode" rel="noopener noreferrer"&gt;Fira Code&lt;/a&gt; is the move here because it has excellent ligature support, making multi-characater operators feel like the single operator they are. I know other fonts have ligature support too but Fira's just seems to be the most natural to me. It also has excellent support for differentiation between &lt;code&gt;Il1|&lt;/code&gt;and &lt;code&gt;oO0&lt;/code&gt; which is an objective plus to the language. The font height is also good for readability at various sizes.&lt;/p&gt;

&lt;p&gt;Note that you can use any of the points I made about Fira Code and apply it to any monospace font to find the right one for you.&lt;/p&gt;

&lt;p&gt;Matej Latin has an excellent &lt;a href="https://betterwebtype.com/articles/2020/02/13/5-monospaced-fonts-with-cool-coding-ligatures/" rel="noopener noreferrer"&gt;article&lt;/a&gt; on what makes a good font for coding. He also includes diagrams with his work that illustrate what I said about character differentiation.&lt;/p&gt;

&lt;h1&gt;
  
  
  Windows Terminal
&lt;/h1&gt;

&lt;p&gt;I don't care if you have a terminal. Ditch it. &lt;a href="https://github.com/microsoft/terminal" rel="noopener noreferrer"&gt;Windows Terminal&lt;/a&gt; is very likely the future of the Windows built in terminal and it is frankly excellent. I use my terminal all day at work and I have only wanted exactly 2 features from it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clickable link support&lt;/li&gt;
&lt;li&gt;Quake-style hide and show&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I am well aware there are terminals that can do both of these things (like the terminal in VSCode, &lt;em&gt;cough cough&lt;/em&gt; Microsoft 😐) but those are minor. I like that you can set up many different shells, including WSL, Powershell, and even CMD (but why would you use CMD?). Add in launch arguments as one of the items and you could set up automatic SSHing to some other machine as a keyboard shortcut or new tab item. &lt;/p&gt;

&lt;p&gt;Speaking of shortcuts, you can customize them in any way you see fit too. I have some set up to change tabs based on keystrokes I have hooked up to three finger swipes on my track pad to change tabs in full screen mode.&lt;/p&gt;

&lt;h1&gt;
  
  
  Powerline
&lt;/h1&gt;

&lt;p&gt;Now that you have an awesome terminal and an awesome font, you can install the single greatest tool here: Powerline. Powerline takes your Powershell prompt and brings it to the 21st century.&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%2Fwww.hanselman.com%2Fblog%2Fcontent%2Fbinary%2FWindows-Live-Writer%2F63963d6f2af3_12BCC%2Fimage_e2447ddd-416e-4036-9584-e728455e6d9d.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%2Fwww.hanselman.com%2Fblog%2Fcontent%2Fbinary%2FWindows-Live-Writer%2F63963d6f2af3_12BCC%2Fimage_e2447ddd-416e-4036-9584-e728455e6d9d.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Image from Scott Hanselman&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Integrated git info, last command exit code indication, shortening directories to have Unix-style &lt;code&gt;~&lt;/code&gt; for Home, all makes it an objective improvement to stock Powershell. This tool is so good, Microsoft put up a &lt;a href="https://docs.microsoft.com/en-us/windows/terminal/tutorials/powerline-setup" rel="noopener noreferrer"&gt;guide to install&lt;/a&gt; it. &lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Developing on Windows can be so much better if you give your setup some love.  It might not be as powerful as Linux (although WSL kind-of means it is but that's another story). The point is, it sure is catching up and I am glad Microsoft has embraced their platform for &lt;a href="https://tenor.com/sR1j.gif" rel="noopener noreferrer"&gt;developers&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is your favorite tool for developing on Windows?
&lt;/h3&gt;

</description>
      <category>windows</category>
      <category>efficiency</category>
      <category>setup</category>
    </item>
  </channel>
</rss>
