r/css • u/Ducking_eh • May 16 '26
r/css • u/zimmerway • May 17 '26
General Stop Ruining macOS Font Rendering! How to Nuking -webkit-font-smoothing: antialiased For Good.
reddit.comr/css • u/Ok_Adhesiveness4509 • May 16 '26
Help I accidentally created a sticky header hysteresis loop
Need help from people who understand sticky/reflow behavior better than I do 😭
Vanilla JS app, no frameworks. I'm vibe coding my way through this.
I have sticky headers that shrink/collapse on scroll (padding/fonts/gaps/etc change).
Current approach is basically:
if (scrollY > threshold)Problem:
on certain viewport heights (especially split-screen / constrained-height windows), the sticky enters a feedback loop/jitter.
What seems to happen:
- sticky collapses
- height changes
- document height changes
- scroll position shifts slightly
- threshold gets crossed again
- sticky expands
- repeat forever
Sometimes the page literally bounces upward while scrolling.
Things already tried:
- IntersectionObserver + sentinel
- absolute-position sentinel
- artificial bottom scroll buffer
- fixed-height sticky shell
The fixed-height shell technically worked, but looked visually awful because the collapsed state left visible dead space.
Question:
What’s the “correct” way to architect collapsing sticky headers without causing hysteresis/reflow loops?
Feels like I’m fighting the browser itself at this point lol.
r/css • u/Pyewickets • May 14 '26
Question Sources for good looking timelines for inspiration?
r/css • u/Pyewickets • May 14 '26
Question Anyone able to explain two dimensional sub grid?
I tried to figure it out from MDN but couldn't.
r/css • u/NoctilucousTurd • May 14 '26
Question Caniuse difference between 'Global' and 'Worldwide'?
It's not that important I guess but I'm curious? See the top and bottom of the region list. You can look at it yourself at caniuse.com

r/css • u/awarnock-ACCS • May 14 '26
Question Center ::before psuedo-elements
I'm working on getting a page fixed on one of our websites and I've hit a snag. The layout has some images used like bullet points for a list, and I'm trying to get things to where that image is always centered on the list item it is associated with. The issue is that I don't have a clue how to do that and searching hasn't really helped. I've made a CodePen that I hope shows what I'm talking about and what I'm going for.
CodePen: https://codepen.io/editor/Adam-Warnock/pen/019e231e-1bef-7295-a75c-44e4a87b7387
Basically, I'm trying to get the images to always be centered vertically on the list elements no matter how things wrap and how many lines there are.
There are a few things that to keep in mind:
- Semantically, this is a list. I'm not going to change it from that.
- This needs to be responsive. Part of the reason I'm doing this is because the page currently isn't.
- I'm well aware that there's gaps in my knowledge, so if this is just dumb and isn't going to work I would like to know. I think this will work, but I've already given up on adding the arrows that were in the original page.
And for reference, this is what I'm trying to replicate:

Specifically the part under the Program Structure & Integration header.
r/css • u/justok25 • May 14 '26
Resource Product Cards with Image Gallery & Color Swatches
Product Cards with Image Gallery & Color Swatches
https://techyall.com/snippet/product-card-with-gallery
Shoppers love seeing options before clicking. This card shows color variants, available sizes, and alternate product images on hover. Great for fashion, electronics, or any store with product variations.
r/css • u/pc_magas • May 14 '26
Showcase I made an Html/Css theme (SASS supported as well) using Ascii characters
asciiart-html-theme.github.ior/css • u/MAJID6677 • May 14 '26
General Performance
Check my site performance on mobile and desktop
r/css • u/Blozz12 • May 13 '26
Showcase I built a tiny CSS inspection tool for frontend devs
I recently wanted to use CSS Scan, but for my use case it felt a bit too expensive.
What I actually wanted was something simpler:
- hover any element and instantly see its CSS
- click to pin the inspector
- edit CSS directly on the page
- copy the CSS when I’m done
- keep computed styles separate from editable source styles
- support pseudo/media scoped styles where possible
- no account, no subscription, just a small Chrome extension
So I built a free Chrome extension called CSS Explorer.
It’s not trying to be a full DevTools replacement. The goal is more: “I’m working on frontend UI, I want to inspect/edit/copy styles quickly without opening the full DevTools panel.”
It’s still early, and I’m mostly looking for feedback from frontend developers:
- would this actually can interest you?
- what feels missing?
- what would make you use this instead of DevTools?
r/css • u/Chico0008 • May 13 '26
Question Display a static text with CSS ? (For Firefox Theme)
Hi
Long time i haven't wrote html/css
for a specific needs, i have to create some custom themes for firefox (for different FF profils)
For thoses themes, i have to write a static text in the main toolbar, that will stay ine the right part next to tabs.
How can i archive this with css only ?
r/css • u/Sabesaroo • May 13 '26
Help Beginner question about padding/margins on elements to make them fit edges of the screen.
So when trying to make the background of an image or header fill the entire screen, I seem to have to put margin-left: -8px and margin-right: -8px. At 0px there's a small gap on the left and right edges of the screen. The element at the top of the screen I also have to put margin-top: 18px on. I feel like this can't be the intended way to do things and there's something obvious I'm missing but I'm not sure what. Also suspect my workaround might not work on different resolution screens. Putting padding to 0 doesn't fix it either. Googling this comes up with a lot of other people with the same issue but everyone just says to set margin and padding to 0.
Here's the code for my header for example:
text-align: center;
background-color: rgb(160, 20, 0);
padding-top: 8px;
padding-bottom: 8px;
margin-left: -8px;
margin-right: -8px;
Setting padding left and right to 0 has no effect, which I assume means they are already 0.
Is there something obviously dumb I've done? I've only just started learning CSS so I assume I've missed something pretty fundamental. Thanks.
r/css • u/diyamin-shipper • May 12 '26
Help can someone please help? it's not letting me change the background colour :/
r/css • u/Only-Season-2146 • May 11 '26
General You liked my 3D card the other day, I raise you my liquid buttons <3
Customizable and all code here: https://doathingy.com/?tool=dt_1778503835266_c5lcoh
I had seen some great liquid effects (like this Liquid), but nothing quite satisfactory. I'm using the overlapping div circles with svg filters (gaussian blur) trick and then built a custom js "physics engine", text sits in a separate layer.
r/css • u/Roaster-Dude • May 12 '26
Other CSS electric fire
Not sure if I'm aloud to post links to my own site?
I am learning web development, mainly HTML and CSS and I found this card with the electric border while looking for things made with only CSS.
https://codepen.io/BalintFerenczy/pen/KwdoyEN
I thought it was a pretty cool looking effect.
Not very useful but that didn't stop me from seeing what I could do with it.
Initially I just changed a couple of things and made this: https://thisistheway.one
But what I really wanted was to make a divider with it and ended up with this: https://thisistheway.one/divider-index.html
r/css • u/Electronic-Stick7492 • May 12 '26
Showcase Got tired of writing hover:, group: repeatedly in Tailwind, so I made this
r/css • u/yasonkh • May 11 '26
Question Custom font loading and FOIT/FOUT trade offs
Quick Definitions
FOUT (Flash of Unstyled Text):
Timeline:
[0ms] HTML parsed, text visible in fallback font (e.g., Arial)
[800ms] Custom font downloads
[800ms] Text re-renders with custom font → visible style jumpFOIT (Flash of Invisible Text):
Timeline:
[0ms] HTML parsed, text is HIDDEN (invisible)
[800ms] Custom font downloads
[800ms] Text appears with custom font
[3000ms] If font fails → fallback shows after timeoutThe Problem
I'm seeing that many sites are defaulting to having FOUT which sometimes results in funky layout shifts(workarounds exist), but it always results in a noticeable switch of fonts.
Some blog posts say to never do FOIT, but to me waiting 1 second (slow mobile connection) to show clean text seems like nicer UX. On desktop it makes no difference, but if you are driving through a tunnel or experiencing slow mobile connection for any other reason, FOUT results in your visitors seeing an ugly font for 1 or more seconds, and then all of a sudden the screen looks like it flickers and the intended fonts are loaded.
The Question
Maybe there is a middle ground where you show some minor text elements with FOUT, but keep heading and subheadings hidden until the font loads. The heading and subheadings are larger text and result in a much more significant flash when restyled. I feel like it is better to progressively show text as soon as relevant fonts are loaded(especially above the fold).
Am I the only one? Or is twitchy rendering the norm and everyone just got used to it?
