Is this JavaScript watching the size and inserting burgers?
NOPE! It's CSS's `background-repeat: round;` repeating as it has the space to.
Cool demo,
@TheWizardJS
For all the end-of-year lists coming... before you give up and do:
<p>10. </p>
<p>9. </p>
Remember you can do:
<ol reversed>
<li>Highest number in list</li>
<li>Second highest</li>
<li>etc...
23 Minutes of Work for Better Font Loading.
1) nuke your old @font-face blocks
2) generate new font files with glyphhanger
3) update new @font-face blocks with new font files
4) use font-display
5) use preload
6) use serviceworker
If you've ever needed to code a chat-room like UI, you've probably needed to pin the scroll position of an area to the _bottom_, even as you append new content.
Used to be JavaScript territory mostly, now it's doable with `overflow-anchor` in CSS!
Jumping through hoops to get some fancy JavaScript-based smooth scrolling in place?
Reminder you can get Chrome/Firefox entirely natively in CSS with a one-liner:
html {
scroll-behavior: smooth;
}
"Use the palette chooser to create a series of colors that are visually equidistant. This is useful for many data visualizations, like pie charts, grouped bar charts, and maps."
Classic trick... need to quickly visually see the rectangles that make up all the elements on a page? Toss:
```
* { outline: 1px solid red; }
```
Into the styles for a look.
Responsive tables...
When you need to compare data up and down columns, it's probably best to largely leave the table structure alone and allow scrolling.
If each row can be broken apart and still be useful, collapsing them to avoid scrolling is nice.
> This is demo of a CSS powered 3D environment. Geometry is created with HTML elements and CSS transforms. Textures and lightmaps are composed by layering multiple background-images and colour is applied using CSS blend-modes.
A little horizontal scrolling section is so easy these days!
A little momentum scrolling might not hurt:
Scroll snapping is nice too:
Stretch goal: active nav and jump links ;)
✨ Need to make a horizontal scrolling section? Are you unsure how many items will be in it or what their widths are going to be? No worries! Flexbox to the rescue! 🥰
This is a 💯 DevTools trick. In Sources > Overrides you "select overrides folder" and then "enable local overrides". Then you can make changes to CSS in DevTools and they persist. Great when you need to play with styles but also need to refresh the page.
Think you need JavaScript to "pin" the scroll position of an area to the bottom? (Like a chat app would do.) It's actually doable with CSS and the `scroll-anchor` property and placing a non-zero-height element to anchor to. (via Ryan Hunt's blog!)
Open-Source Full-Stack solution for fast PWA development.
bento-starter:
(Looks like an awfully opinionated stack, but popular stuff, like Vue, Firebase, Jest...)
Very clear explanation (in a single GIF) of a situation you should definitely use monospace numbers (or `font-variant-numeric: tabular-nums;` if your font supports it).
A single centered column that doesn't get too wide.
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}
"58 bytes of css to look great nearly everywhere"
'he ain't wrong.
> Leon Sans is a geometric sans-serif typeface made with code in 2019 by Jongmin Kim. It allows to change font weight dynamically and to create custom animations, effects or shapes in the Canvas element of HTML5.
lol
> Ever use one of those fancy color palette generators? The ones where you pick a starting color, tweak some options that probably include some musical jargon like "triad" or "major fourth", and are then bestowed the five perfect color swatches?
Building a design system in Web Components does feel pretty smart.
<brand-slider>
<brand-tabs>
<brand-figure>
If nothing else, for the longevity of building "on the platform", as they say.
A CSS Grid tutorial that goes beyond the basics and does some really interesting stuff! By
@anarafaelaferro
min-max, auto-fill, object-fit, auto-flow...
Contextual styling with custom properties by
@simurai
::
Give a section something like `data-theme="dark"` then...
[data-theme="dark"] {
--adjust-all-the-variables...
}
I've heard Moment.js called "a necessary evil" in some apps (it's large).
Here's a 2KB alternative with the same API for dealing with dates/times.
(I can't speak to the differences, but surely there are some.)