In this post I’ll cover how to add Dark Mode to a JavaScript App. All major frameworks (React, Angular, Vue, etc.) are covered!
Tag Archives: css
Emulate Dark Mode using Chrome DevTools
“Hold to confirm” Button
Single div CSS Tesla Cybertruck
Of course it had to be done: What I found most peculiar is that only the front lights are generated content, all the rest is gradients. Only detail that’s missing are the smashed windows 😜 Oh, Here’s another nice version (no single div though): See the Pen Pure CSS CYBRTRK 🚙 by Jhey (@jh3y) on …
Change the marker of a list to any character with list-style-type: <string>
Since CSS Level 2, CSS list-style-type has supported keywords like disc or decimal to define the appearance of the list item marker. Landing in Chrome 79, and also available in Firefox ever since version 39, is the ability to set it to an arbitrary string. Here’s a pen that demonstrates its behavior / usage: Let’s …
Continue reading “Change the marker of a list to any character with list-style-type: <string>
“
Pure CSS Scroll Shadows (Vertical + Horizontal)
A long time ago (2012!), Lea Verou shared a way on how to add scrolling shadows to containers that needs scrolling. Using those shadows in a scroll container is a great UX thing, as they visually tell the user that the content is scrollable. Her code however, only worked with containers that scroll vertically. Based …
Continue reading “Pure CSS Scroll Shadows (Vertical + Horizontal)”
Ship legacy JavaScript and CSS files in a Webpack Project with webpack-merge-and-include-globally
One of the projects that I’m working on is quite reliant on jQuery and Bootstrap. As we’re introducing new features (such as a few React-based components, and Stylus for CSS) in said project, we’ve also introduced Webpack into it. Now, we don’t want to run jQuery nor Bootstrap through Babel (using Webpack), but we want …
Implementing Dark Mode on adactio.com
Jeremy recently implemented “Dark Mode” on his site. Tanks to CSS Custom Properties the implementation is pretty straightforward (also see my writeup here). But of course, Jeremy added some extra details that make the difference: In Dark Mode images are toned down to make ‘m blend in better, as detailed by Melanie Richards: @media (prefers-color-scheme: …
Simple Scroll Snapping Carousel (Flexbox Layout / Grid Layout)
Here are two small scroll-snapping carousels that I made. In the top one the items are laid out using CSS Flexbox, whereas the second one uses CSS Grid. The code also works fine with arbitrarily sized .scroll-items elements, they don’t need to have the same width. ℹ️ Want to now more about scroll snapping? Check …
Continue reading “Simple Scroll Snapping Carousel (Flexbox Layout / Grid Layout)”
Building Better Interfaces, a talk by Hakim El Hattab
At CSS Day 2019, I was fortunate to see Hakim El Hattab bring his talk Building Better Interfaces. A recording of his talk – and all other talks – are available on YouTube: This session is a deep-dive into the areas of interface design that Hakim has specialized in for over a decade—interactivity and animation. …
Continue reading “Building Better Interfaces, a talk by Hakim El Hattab”