Community Feed

Your story Log in to post
Tagged CSS Show all
K

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.

S

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...

N

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...

O

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...

Run
M ✓

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. ...

B

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...

Run
A

Pricing Hover

Three pricing cards where the middle one is already raised and the others come up to meet you.

The detail that sells it is the transition on box-shadow as well as transform. Without it the lift looks flat.

Run
K

Theme Switch

A dark and light switch that remembers nothing and still works, because the colours are custom properties and the toggle only flips one attribute on the root.

If you add localStorage later, you change one line. ...

Run
G

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...

Run
B

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.

E

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...

Run
M

Flexbox for one dimension. Grid for two. If you are fighting one of them, you probably picked the wrong one.

O

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.

Run
D

Flip Card

A card that flips on hover with no JavaScript at all. The whole trick is transform-style: preserve-3d on the parent and backface-visibility: hidden on both faces.

Hit Run and hover it.

Run
N

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.

Run
S

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...

Run
S

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. 🃏

O

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.

Run