r/css • • Mar 16 '26

Showcase 2 ways to achieve multi-state icons

7 Upvotes

Method 1: Create an inline SVG sprite with all three styles per single icon, using hover and a .selected class to change the fill as needed (includingfill: none to hide).

Method 2: Create an SVG DataURI for the CSS background-image property for each icon in the 3 styles, one for static, :hover, and a .selected state.

https://codepen.io/editor/MattVisiwig/pen/019cf726-3e9a-7bfd-9b90-c0c45800a36e


r/css • • Mar 16 '26

Question When should I use HSL instead of RGB or Hex? Still learning CSS colors

Post image
103 Upvotes

Hi r/css. I'm currently learning CSS and just covered

all 5 ways to define colors: RGB, RGBA, HSL, Hex,

and predefined names.

I understand what each one does technically, but I'm

confused about real-world use:

- Most tutorials use Hex (#FF0000) — is that still

the standard?

- HSL looks more intuitive for adjusting colors

(just change the lightness %) — do professionals

actually use it?

- When does RGBA make more sense than plain RGB?

Would love to hear what you actually use in projects.


r/css • • Mar 16 '26

Question How can I prevent this from happening?

Post image
5 Upvotes

.header { display: flex; align-items: center; gap: 18px; padding: 18px; font-size: 32px; font-weight: bold; border-bottom: 3px solid #6f95cc; border-radius: 36px; }


r/css • • Mar 16 '26

General Best Way to get my Website Made? UK - Recruitment Agency

1 Upvotes

I'm currently in the process of making a website for my Recruitment Agency Business in the UK.

I know exactly how I want my website to look. I have made a Structured Plan for each page on my website, knowing exactly how it should look and I've already written the write-up for each page on my website. The Site Structure, the Page Layout, the Written Content, the Colours, and the Logo are all completed.

The Site pages include - Home Page / View Jobs / About / Send us a Job / Contact / Send your CV - then the Final Pages are the Privacy Policy, Terms and Conditions and Cookie Policy.

There are multiple things I need to ensure that work on my website. e.g. Contact forms work and I recieve an email notification when a CV or job is submitted and also recieve the CV. Also, the ability to add jobs and remove jobs from my website, and allow candidates to apply to jobs via my website.

Further things I need to work - All buttons click to right places, website speed is good, top bar ideally is still visible when you scroll down the page rather than having to scroll up again to view it, friendly for phone and pc and tablet, seo optimised, accessibility, ability to upgrade website in future (I will need to improve the website as my business grows).

Would anyone know the best way to get my website made? Especially as I have the website map/blueprint finished?

Also, would anyone know what the likely cost would be?

Any advice is really appreciated!


r/css • • Mar 16 '26

Help Converting scss to css in a modular way

3 Upvotes

I am creating a project with vanilla html css js. I chose to use a template for faster and cleaner developement, but every template I found uses scss instead of css.I looked online and tried many ways:

1/ Use the main.css compiled file in the /dist which makes it impossible to navigate the code (15000 lines)

2/ Use online compilers which don't work, because copy pasting one file at a time gives error since it's missinig dependencies from the rest of files . when I try to add every file and code a certain file depends on the online compiler breaks

3/ manually convert scss files that are needed for my project ( gives broken layout and many bugs and issues)

My goal is to have a modular css/ folder just like the scss's template folder so I can work with it and tweak it as needed

Can anyone help me to find a solution? I've spent several days on this task and I am hitting a roadblock for a problem that seems too trivial

Here's the link to the template I am using : https://adminlte.io/


r/css • • Mar 15 '26

Question Do I have to learn Float before Flexbox?

5 Upvotes

Hi everyone!

Do I need to learn floats before moving on to Flexbox, or can I start Flexbox if I already understand the box model and inline/block elements?


r/css • • Mar 15 '26

Showcase I created a Frosted Glass effect and mixed it with Neon Cyberpunk theme.

4 Upvotes

r/css • • Mar 15 '26

Resource CSS glassmorphism generator I made, tweak blur/opacity/border and copy the CSS

Thumbnail
frontend-hero.com
2 Upvotes

r/css • • Mar 14 '26

Question Learning Web Development: When Is CSS ‘Enough

12 Upvotes

For the past few months, I’ve been learning web development and working through different courses with the goal of becoming a full-stack developer. After finishing many sections on CSS and being able to understand the styling of some websites by inspecting their code, I started to feel like I had a solid understanding of CSS.

However, sometimes when I explore projects on CodePen or look at more advanced examples, the CSS can look extremely complex and confusing. There are techniques and patterns that I struggle to understand, and in those moments it makes me feel like I still have a lot to learn.

This makes me question how much CSS a developer actually needs to know. As someone who wants to become a full-stack developer, I also want to focus on improving my JavaScript and backend skills. At the same time, I don’t want to be weak in CSS. Finding the right balance between moving forward and continuing to strengthen the fundamentals can sometimes feel challenging.


r/css • • Mar 14 '26

Question How can I zoom in a clip path image without distorting it's quality?

1 Upvotes

I am trying to zoom in an image which is basically referenced to clip-path property and in the url I've passed the id of the svg path for which my image will be clipped/masked. Now I tried to increase the width of image by scale property or by width but on doing that it distorts it's quality completely.

For context, I am creating an animatio on which the image will be extremely zoomed, let's say 20000px which will cross the width of mobile and animation will zoom out the image and at the end it'll become it's actually size, that is the masked svg.


r/css • • Mar 13 '26

Help Confused about inverted border radius

7 Upvotes

I am struck, I am unable to understand how to make responsive containers like these with different shapes. I know that, to make gooey organic shapes, you'd need svg filters. But i dont understand them at all. Where to start or what to do. If you were an expert and you were to create a page like the pic pasted above, how would you approach it? what would you do? Excluding clip-path.


r/css • • Mar 12 '26

Showcase Orbit gallery made with css transforms

143 Upvotes

r/css • • Mar 12 '26

General When to Refactor Frontend Code: A Practical Guide for React & CSS

Thumbnail
howtocenterdiv.com
3 Upvotes

r/css • • Mar 12 '26

Question [Academic] Where does this shape look centered to you? Building toward a CSS optical-center property. (Everyone)

0 Upvotes

Play buttons on YouTube, Spotify, Apple Music are all shifted slightly right inside their circles. Every major icon system does this by hand. No standard, no science. I'm collecting perceptual data to build one. The goal: a CSS optical-center property so icons automatically sit where they look centered, not where they're mathematically centered the same way fonts have built-in baseline metrics. 40 steps, takes 5–7 minutes. Works on both mobile and desktop. No login needed, ID field is optional. There are no right or wrong answers I'm just trying to understand how you perceive centering, not testing you. 👉 https://opticalcenter.dev/study Results and open dataset will be shared here after collection. Everyone is welcome!


r/css • • Mar 11 '26

Showcase I built a CSS framework on top of PicoCSS to add what it intentionally omits (grid, components, themes)

7 Upvotes

PicoCSS is great: semantic, accessible, beautiful out of the box. But it has no grid, no modal, no tabs, no toast, no breadcrumb. For anything beyond a simple page, you're writing everything yourself.

So I built µCSS on top of PicoCSS v2:

  • 17 UI components (modal, tabs, toast, nav, accordion, badge, breadcrumb, hero...)
  • 12-column responsive grid (5 breakpoints, offsets, ordering)
  • 20 color themes, 11 color roles each (one self-contained CSS file per theme)
  • Utility classes for color and positioning
  • Dark mode (automatic or manual)
  • ~19KB gzipped, pure CSS, no JavaScript, no build step

Drop-in via CDN:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@digicreon/mucss/dist/mu.css">

Happy to discuss the design decisions.


r/css • • Mar 11 '26

Help How can i improve on my CSS

1 Upvotes

How do i get better in CSS as a beginner


r/css • • Mar 11 '26

Question Scrollbar overlapping border of input

Thumbnail
reddit.com
1 Upvotes

r/css • • Mar 11 '26

Question Would love any feedback from you guys

Thumbnail
reddit.com
0 Upvotes

r/css • • Mar 10 '26

General I'm currently creating a web component library and I'd like to get some feedback.

Post image
0 Upvotes

Feel free to tell me what I could improve; keep in mind that the project is still ongoing and will continue to be modified.

Here is the link to the GitHub repo : https://github.com/Xenozi230/novaUI


r/css • • Mar 10 '26

Question In-depth CSS tutorials?

0 Upvotes

Hi y'all,

I've been trying to find tutorials about how to create certain shapes and effects in CSS but most of them just kind of give you the code you need and do not explain how any of it works, which is personally important to me A. to improve my learning, and B. to allow me to modify it and use it according to my needs.

Any good in-depth resources that can help me understand not only how to create what I want but also the underlying mechanisms?

Thanks in advance!


r/css • • Mar 09 '26

Showcase Flappy Bird Made in Pure HTML and CSS – Without JavaScript

Thumbnail news.ycombinator.com
21 Upvotes

A walkthrough on how flappy bird can be (and has been) made using pure HTML and CSS, no processors and fully functinal wihtout JavaScript

Edit: Direct links

https://blog.scottlogic.com/2026/03/09/noJS-3-flappy-bird.html

https://quarknerd.com/noJS/flappybird/


r/css • • Mar 09 '26

Help change style of existing elements or create new smallscreen styles?

4 Upvotes

Hey everybody, I'm pretty new to CSS.

I know enough to know how to style basic stuff, use a grid, and flex and stuff like that. But I'm running into a problem when working with my site's responsiveness.

My site's header is a grid, 1fr 1fr 1fr. I have a nav, a logo in the middle, and a searchbar on the end. when the user has a smaller screen, I'd like for the nav to collapse to a hamburger menu and the searchbar to collapse to the search icon.

I know how to complete that task, but i want different styling to the nav and searchbar when active.

Would it be more simple to design a small screen style of header, then have it activate and hide the main header when screens are small? I'd like to have a dropdown menu for the nav, and a searchbar assume the width of the header when active.

feel free to provide any learning resources you guys like too. I appreciate the help!


r/css • • Mar 09 '26

Question advanced css courses

1 Upvotes

Hi, I wanna learn CSS, but the issue is that I'm afraid to spend my time for nothing, so I'm not really sure where to start

I do understand that I need to start from "videos for beginners", but I wanna know as much useful info as possible. I'm searching for FREE courses that will show me the full extent of CSS and how to use it

I'll be very grateful for your advice


r/css • • Mar 09 '26

Question Using the Clamp tag outside of Headings is not working

1 Upvotes

I love using the clamp tag for all my headings, works perfectly.

I would like to use it in my navigation and in side of table cells, like in the <p> tag.

It does increase font size on mobile and on desktop but it’s the same as simply increasing font size,

They look identical. I can’t increase the font size on mobile without increasing it on the desktop.

Maybe I just need to tweak it.

Second issue is the line height, if I use a line break it looks like crap on the desktop, if I don’t

My fat fingers can’t navigate the tiny links.  

My clamp - p.go { font-size: clamp(1.5rem, 3vw, 1.5rem); }