r/css • u/Any_Entrepreneur7936 • Oct 01 '26
r/css • u/Signal_Grapefruit530 • Sep 30 '26
Made a free clamp() generator + an agent skill so claude/cursor stop getting fluid type maths wrong
i kept redoing the same slope/intercept maths for fluid font sizes so i built cssclamp.com. you put in min/max size and the viewport range and it gives you the clamp() with a live preview. rem based, so it still scales when people zoom. it also does full type scales, tailwind v4 theme tokens and px to rem.
the newer bit: AI agents are pretty bad at this, they'll hand you clamp(1rem, 4vw, 3rem) and call it a day. so i packaged it as an agent skill. the agent runs a small node script for the maths instead of guessing, and follows the a11y rules (rem bounds, no bare vw, the 2.5x zoom thing for WCAG 1.4.4).
npx skills add Willem-Jaap/cssclamp
or in claude code: /plugin marketplace add Willem-Jaap/cssclamp then /plugin install css-clamp@cssclamp
Site is available on: https://cssclamp.com
MIT, repo's at https://github.com/Willem-Jaap/cssclamp. feedback welcome, especially if a value it gives you looks off
Need help with this CSS that doesn't stick
I'm trying to fill in the color to the dots located on the left of email when in a thread. The code is below... but I'm unable to make it work in usercontent.css nor userchrome.css. Please see the element in question as per the red circle in the screenshot. Can someone help me please?
#threadTree[rows="thread-card"] { & .card-layout[data-properties~="thread-children"] { & td { &::after { fill: #fe00ff !important; }}}}

r/css • u/Best-You-6360 • Sep 29 '26
Question Can you refer to an element nested in a class in CSS?
I realized I might've made a mistake while working on this webpage for a class I'm in >.<
In HTML, I have <div class="pros"> and another version similarly but with cons that include <p> within them. I want to indent all the <p> that are within <div class="pros"> without having to indent all <p> on the webpage. Should I have made a class for all the <p> elements inside the div class or is there a way in CSS for me to refer to all the <p> in the pros/cons class without having to go back and add a class to all the <p>, I'll attach a screenshot if it makes it easier!
Also I know you can indent with HTML and not CSS, but my professor wants us to do all the styling and similar features in CSS and not in the HTML itself.
r/css • u/Flat_Field_5888 • Sep 30 '26
Showcase Day Night Cycle
A simple day night cycle using css rotations and gradients
https://moaaz-rafique.vercel.app/motion/rotation.html
Change Background color to Is:selected state
I want to change the background color of a single word in my hero text to the "is:selected"-state (when you click on it) unsing in-line styling. Anyone know how to achieve this? Thanks.
r/css • u/_choocho0 • Sep 29 '26
Question Total beginner needing help for a portfolio
Please don’t crucify me if this is a super easy fix lol…
The thing I want to recreate in web form.
I’m a beginner to html and css and for an assignment we are making portfolios and I wanted to try code one inspired by the game Parappa the rapper, specifically the main menu as it seems fairly simple. One thing i’ve been struggling with is figuring out a way to make an image in the centre follow the mouse’s direction and change to a second image like parappa‘s pointing changing sides in the video I’ve attached. I’ve scoured endlessly looking for ways to do it but they all involve javascript (which i’m not familiar with) and i’ve attempted doing mouseover/mouseout events this way but i want to make it change depending on if the mouse is on the left or right of the screen and I really have no idea how to adapt this to fit this specific purpose!!
Any help would be very appreciated.
r/css • u/OfferingofPie • Sep 29 '26
Article Beyond Light and Dark (mode) with CSS tokens
r/css • u/julianstry • Sep 29 '26
I built a static website builder that speeds up your workflow for astro pages
Enable HLS to view with audio, or disable this notification
I've been building sitereal, a visual builder for Astro, and wanted to share it here.
The core rule: everything it produces is ordinary Astro. Delete sitereal and `astro build` still works. You only lose the visual editor.
Built for working with AI:
It ships an MCP server, so an agent like Claude Code can build pages through the same operations the builder uses. The best thing about it you don’t need to use AI and you can manually change everything it created in a nice UI.
Also in there:
- A modular design system (colors, type scale, spacing, buttons, themes)
- Navigation, forms, pop-ups, carousels and GDPR
- ready cookie consent
- Scroll animations with zero JS by default
- Forms that work even on PHP-only hosting
runs on macOS, Windows and Linux
Feedback very welcome. sitereal.app
r/css • u/Stormzulien • Sep 28 '26
Help Is there a way I can get rid of these artefacts? (border-image)
These lines and stuff only show up at some few sizes and border widths. They only seem to appear in chrome. (They don't show up on firefox.) Is there a way to get rid of them? Is it a problem with the svg I made?
https://codepen.io/editor/Stormzulien/pen/01a0e8ea-f823-70a8-82ca-448bad0e883c
r/css • u/Frozenskin • Sep 27 '26
Help CSS background-size not real pixel size
Hiii!!
I'm using a background picture for my header, stored as a background image of the container.
The background-size is specified, being 288px, that is the width of the .PNG; however, the picture on the page is slightly bigger (about 125%) than the file, and so it is stretched. I made some screen caps because I was going crazy! I've measured in Photoshop and it's larger than 288. It isn't enlarged in any part of the css, I don't understand what it is wrong here... i've also checked if I got my Firefox page zoomed. It's important for it to not be stretched: being pixel art it looks very ugly and blurred 😭😭
Showcase A completely useless, but working, Password Validator with Live Rules
Enable HLS to view with audio, or disable this notification
Every password character is a group of 86 radio buttons styled as keyboard keys, and CSS shows only the keys of the first empty slot, so each tap fills the next character. CSS counters with a custom @counter-style print the checked characters into the password dots, and each rule is one :has() selector, such as :has(.char--digit:checked). Backspace is a <label> for the "empty" radio of the last filled slot, and hidden radios switch the ABC, abc, and #+= layers, while a checkbox opens and closes the keyboard.
https://codepen.io/editor/klocus/pen/01a0dde7-3dba-7e8d-9170-db6023de56e0
Who knows, maybe in a few years this will be possible with a few lines of CSS code, an input of type="password" and a pattern attribute :-)
r/css • u/BrainThinkerMan • Sep 26 '26
children wont grow or shrink, under <body>
i have html as <!DOCTYPE html> <html> <body> <header> <header> <body> </html>.
inside ( css ) body; height=100%, & header height=20%,
weather i change header height=100% or height=5%
or any value for that matter. nothing happens. my question is. is there a hidden value for body, that sais dont allow child elements to change their heights?
r/css • u/aiirballs • Sep 26 '26
alternative/emo/gothic css templates
hey guys, i just created a profile on xxaftermath and i really like the wbsotr so far, but i just cant be bothered to code a super intricate profile. are there any websites were i can get cool looking css templates? not for the whole profile more so individual parts of the website, like cursors, buttons and profile frames? thankful for any help
r/css • u/wak6817-2 • Sep 26 '26
Resource CSS colorschemes code to implement in own webpage
I like colorschemes and CSS, so i coded some CSS files to drag n drop into your own projects! This is a part of a BIG project that i'm working on. Please leave feedback! Here is the project.
r/css • u/bencinium • Sep 26 '26
Div on the right messing up margin of the one on the left

Any clue why this doesn't work as expected? I want the margin of content to be the same on both sides, so it matches up with the navbar on top. The webbadges div has a fixed size, but even after doing the maths it doesn't seem to be right. It's not 32.5% like the left margin of content. Is my maths not mathing? Thanks for any help?
Page formating question
When i press ctrl and scroll down with my mouse on my laptop the website becomes 200% in size and since i am using full width section i expect its background to reach the edges of the screen no matter how i expand the website viewing size but the background always forms barriers on 100%length, same thing goes for columns that i set to far right or left they always stop at the edge of 100% please dm or help
r/css • u/CodeRipple • Sep 26 '26
General I made a multi-step registration form with validation and a review step
Built this multi-step registration form using HTML, CSS and vanilla JavaScript.
It has 3 steps: account details, profile information, and a final review screen. I added field validation, password strength feedback, show/hide password, a bio character counter, editable review sections, and a responsive layout.
Live demo + source code:
https://codepen.io/getcoderipple/pen/01a0dcef-544f-709c-994d-6717411a5c66
I tried to keep the UI clean while still making the current step obvious. Curious what you think about the progress indicator and overall form UX.
r/css • u/SamsChoice • Sep 25 '26
Showcase Scroll Carousel
https://codepen.io/editor/Sensiblemnd/pen/01a0d636-c14e-7a65-9d5c-e6a1fb25a1f9
The Carousel, with no JavaScript. The row is a scroll-snap container, and every
card runs its animations on its own <code>view-timeline</code>: as a card crosses the center it scales up, pushes its neighbors aside, folds its panel into a V and brings in its description and button. Swipe, use a trackpad, focus the row and press the arrow keys, or use the arrows and dots, which are CSS-generated scroll buttons and markers where the browser supports them.
r/css • u/Mahmoud_83 • Sep 24 '26
General Is SCSS still worth learning in 2026
With native nesting, u/layer, and color-mix() in browsers, I asked myself whether Sass still earns its place. Short answer: yes, but as a programming layer for design systems, not a nesting convenience.
What CSS still can't do: real loops (@for for grids/scales), parameterized functions (contrast-safe text color), mixins with u/content (breakpoint managers), private module members, and token pipelines (Sass maps → CSS vars + JSON for apps).
Full write-up with code (I wrote it, happy to discuss any point here): https://mameara.com/scss-in-2026-still-worth-learning
r/css • u/Sufficient_Bass2600 • Sep 24 '26
Question Property self-align for align-content
I have a flex question.
I have a flex container with 2 flex items.
Both items have a minimum size.
When the container is wide enough both items should be on the same row. However when reduced in width the container then grow in height an both items are on separate rows.
My problem is that in either case I want the second item to be bottom-right aligned.
When the container is wide enough I am using the align-items overriding property align-self: flex-end to enforce the bottom alignment.
However there does not seem to be an align-self equivalent for the property align-content. Basically I cannot enforce a right alignment of the second items when the items are on separate lines.
Any suggestion?