Dark mode is not inverting the colours. Pure white on pure black is harder to read than either, and your shadows all disappear. Soften both ends. #css
Community Feed
TIL you can do scroll-triggered animations in pure CSS now, no JS needed. What's the coolest CSS feature you've found recently? 👇
Just built a glassmorphism login card in the Playground. Feedback welcome: should I add...
CSS specificity in one line: inline beats id beats class beats tag, and a rule inside a media query carries no extra weight at all.
That last part catches people constantly. Your phone styles are not losing because of t...
Live Theme Builder
Three sliders writing straight into CSS custom properties, so the whole card restyles as you move them.
Nothing re-renders. The browser recalculates what depends on the variable and nothing else, which is why it stays s...
Tidy Horizon
CSS tip nobody told me early enough: min-width on a flex item defaults to auto, not zero. That is why your text refuses to shrink and pushes the whole row off the screen.
Set min-width: 0 and watch the layout behave. #c...
Masonry, No JS
A masonry layout in six lines of CSS using columns. Items of different heights pack together with no gaps and no library.
The catch worth knowing: columns read top to bottom, not left to right, so the order is different...
Pricing Hover
Theme Switch
Glass Login
Glassmorphism login card. backdrop-filter does all the work, the rest is a border with a bit of white in it.
Works best over something with colour behind it, which is why the background is a gradient and not a flat grey...
CSS has container queries now. You can style a component by how much room IT has, not how wide the window is. That is the thing we were faking with JavaScript for ten years. #css
Endless Marquee
A logo ticker that loops with no gap and no JavaScript. The list is duplicated once and the track slides exactly half its width, so the seam never shows.
It pauses on hover, because a moving thing you cannot read is jus...
Flexbox for one dimension. Grid for two. If you are fighting one of them, you probably picked the wrong one. #css #design
Tooltip, CSS Only
Tooltips with no JavaScript, positioned with one pseudo element and a transform. They read their text from a data attribute, so adding one is adding an attribute.
Hover any of the four. #css
Flip Card
Before And After
An image comparison slider. Drag the handle and the top image clips to follow it.
The whole trick is clip-path on the top layer driven by one custom property. No canvas, no library. #css #javascript
Accordion, No JS
An accordion built on details and summary. Open one and the others close, which normally needs JavaScript, except the name attribute on details does it natively now.
Keyboard works out of the box because the browser wro...
Spinner Six Ways
Six loading spinners, all pure CSS, all under ten lines each. Nobody needs a library for this.
The last one is my favourite. #css
Make a card that flips on hover using only CSS. Use transform: rotateY(180deg) and backface-visibility: hidden. Post your Run link and I'll comment on every one. 🃏 #CodePenChallenge #CSS
Skeleton Shimmer
The loading skeleton every app uses, in about twelve lines of CSS. One gradient, moved across with background-position.
It swaps to real content after two seconds so you can see both states. #css
Loading comments...
Sign in to comment.