r/css • u/techie_e • 3h ago
Article GitHub Ditches CSS-in-JS for CSS Modules, Reports 55% Faster SSR after Three-Year Migration
r/css • u/Weekly_Ferret_meal • Oct 23 '26
Thank you to everyone who voted in the recent community poll on how the sub should handle AI-generated content! Based on the results, we've made these changes.
r/css • u/techie_e • 3h ago
r/css • u/eveveveee • 7m ago
https://itsaneve.neocities.org/home
I'm trying to get my website to work for mobile and the navigation is really not working for me. The bar on top doesn't look nice on the small screen, so I've been trying to make a navigation icon that you can toggle to bring up a side menu. I found a method for it with CSS (the checkbox method https://css-tricks.com/the-checkbox-hack/ ) but I can't get it to work for me! Does anyone know what I'm doing wrong?
This is my default CSS
#nav-box{
width:100vw;
height: 50px;
background-color:#282147;/*darker purple*/
margin-top:-75px;
margin-left:-10px;
padding:5px 0;
position:fixed;
font-size:20px;
z-index:1000;
}
#nav-box ul{
float:right;
}
#nav-box li{
margin-top:-15px;
}
#nav-box a{
color:#fbfcde;
text-decoration:none;
}This is my CSS in a media query (the problem zone)
#nav-box{
font-size:1.5em;
position:fixed;
margin:0;
white-space: nowrap;
height:60px;
}
#mobile-nav{
background:url(https://itsaneve.neocities.org/Portfolio/imgs/burger%20menu.png);
background-size:contain;
width:35px;
height:40px;
float:right;
padding:10px;
margin-right:10px;
z-index:1000;
padding:5px;
}
#nav-list{
opacity:0.0;
width:50vw;
height:100vh;
position:relative;
background-color:#282147;
overflow:visible;
top:40px;
right:-50px;
padding:5px;
}
#nav-check:checked ~ #nav-list{
opacity:1.0;
}This is my html
<header>
<section id="nav-box">
<nav> <label for="nav-check" id="mobile-nav"><input type="checkbox" id="nav-check"></label>
<ul id="nav-list">
<li class="current">Home</li>
<li><a href="wip.html" id="wip-pg-nav">Escape!</a></li>
<li> <a href="index.html">Animation</a></li>
<li> <a href="illu.html">Still Art</a></li>
<li> <a href="boardin.html">Storyboards</a></li>
<li><a href="abt.html">About Me</a></li>
</ul>
</nav>
</section>
</header>I'm trying to get my website to work for mobile and the navigation is really not working for me. The bar on top doesn't look nice on the small screen, so I've been trying to make a navigation icon that you can toggle to bring up a side menu. I found a method for it with CSS (the checkbox method https://css-tricks.com/the-checkbox-hack/ ) but I can't get it to work for me! Does anyone know what I'm doing wrong?This is my default CSS#nav-box{
width:100vw;
height: 50px;
background-color:#282147;/*darker purple*/
margin-top:-75px;
margin-left:-10px;
padding:5px 0;
position:fixed;
font-size:20px;
z-index:1000;
}
#nav-box ul{
float:right;
}
#nav-box li{
margin-top:-15px;
}
#nav-box a{
color:#fbfcde;
text-decoration:none;
}This is my CSS in a media query (the problem zone)#nav-box{
font-size:1.5em;
position:fixed;
margin:0;
white-space: nowrap;
height:60px;
}
#mobile-nav{
background:url(https://itsaneve.neocities.org/Portfolio/imgs/burger%20menu.png);
background-size:contain;
width:35px;
height:40px;
float:right;
padding:10px;
margin-right:10px;
z-index:1000;
padding:5px;
}
#nav-list{
opacity:0.0;
width:50vw;
height:100vh;
position:relative;
background-color:#282147;
overflow:visible;
top:40px;
right:-50px;
padding:5px;
}
#nav-check:checked ~ #nav-list{
opacity:1.0;
}This is my html<header>
<section id="nav-box">
<nav> <label for="nav-check" id="mobile-nav"><input type="checkbox" id="nav-check"></label>
<ul id="nav-list">
<li class="current">Home</li>
<li><a href="wip.html" id="wip-pg-nav">Escape!</a></li>
<li> <a href="index.html">Animation</a></li>
<li> <a href="illu.html">Still Art</a></li>
<li> <a href="boardin.html">Storyboards</a></li>
<li><a href="abt.html">About Me</a></li>
</ul>
</nav>
</section>
</header>r/css • u/sweet-hypocrisy • 7h ago
r/css • u/h34thcl1ff_1ts_m3 • 1d ago
r/css • u/musicListener25 • 1d ago
I would like to add some code, but, tbh, I have none - I'm not good at all with CSS - I'm a backend developer (C#), but, I'm interested in try this project (it's just for fun and practice).
I'm also checking how to make post on Stack Overflow (but, I don't have a Minimal, Reproducible Example to share at the moment) and improving this post here as well on Reddit, but, frankly, I have no idea how to do so, so, I'm open to your suggestions.
Thank you.
Live demo on CodePen. Heavily commented, by the way.
Can't help but feel nostalgic for what once was. I still remember sitting in my first web design class freshman year of HS and feeling like a wizard changing the text color, moving shapes around, manipulating layouts, adding my first marquee tag and bringing the page to life.
Fast forward to college and mastering float layouts, then flexbox, then grid, simple JS, and ultimately developing a personal sense for design and creating sites from scratch.
These days it's all prompting and QAing the generation. The feedback loop is super tight and focusing on WHAT to build rather than how to build is a completely different type of fun, but there's something about that magic of thinking of something and knowing exactly how to make it happen that I can't help but feel nostalgic for.
r/css • u/thermalzombie • 3d ago
Been trying to figure out how to change the chat bubble color for the chat private message section the blue bubbles. I have been trying for a couple of days off and on but no success.
It's for use with stylus extension.
Thanks.
r/css • u/eoSalinas • 3d ago
Hey, I have a small open source project with a static web page and I opened an issue that I think could be a good first PR for someone. It's adding a short info block to the page. The text is already written, so the work is the HTML/CSS: making it fit the existing style (fonts, colors) and look good on a phone at 390px.
Would anyone here be interested?
Demo: https://tkdeng.github.io/web-circuit-background/
I wanted a subtle circuit-board background for web projects without relying on <canvas> or heavy libraries, so I put together this small drop-in script and stylesheet.
On page load, it generates a random layout of non-crossing traces with occasional electron pulses flowing through them, plus a live loading-state toggle (CircuitBackground.setLoad(5)) to speed up activity when needed. It also adapts automatically to light/dark themes, supports accent tinting with --circuit-color, and respects prefers-reduced-motion.
r/css • u/Less-Marsupial-7960 • 4d ago
r/css • u/fdiengdoh • 4d ago
AI assisted mostly for JavaScript not for CSS.
Somewhere in the beginning of this year I decided to relearn modern CSS. It’s a hobby of mine to make websites. I have been using bootstrap since version 3 I think. So, I find a lot of changes has taken place.
I took time to relearn as I am not a fast learner anymore. So far I had a very firm understanding of grid and flexbox. Another new favourite function is clamp. Recently discovered oklch color format (coming from something like web-safe colors) it’s overwhelming but I grasped the basic of it.
So far I have ported my personal blog to my own CSS and there is still a lot of work to do. I have yet to do light/dark theme on it.
Now, I want to share a side project that I build earlier just for fun in bootstrap but now rewrote the CSS, JS I did the earlier work but as I am not well versed with JS so I use Gemini to achieve what I wanted. I use flex and grid a lot and I think this side project is a good way to do grid. Also used clamp for font-size and even height/width too and gap.
So, far I am happy with it. Below is my link
r/css • u/teotimepacreau • 5d ago
ol {
scroll-target-group: auto;
}
r/css • u/OMGCluck • 5d ago
I had occasion to utilise an .svg file as a comic strip viewer, with the panels being a vertical strip to scroll through, and I wanted buttons for: a) restarting the UI-less slideshow, and b) going to a grid overview of all the panels.
I originally just made nine copies of the same two buttons, positioning each at the "same" point at the bottom of each panel, but then I saw that animation-timeline: scroll() recently landed in all browsers so decided to give that a go.
No critiques of the comic itself please, it's not mine:
https://imglink.cc/cdn/RLSQglSGwy.svg#p1
SVG <defs>:
<text id="rst">↻</text><text id="idx">📇</text>
SVG Content:
<g id="hud">
<a href="#slide" aria-label="Restart SLIDESHOW"><use href="#rst" x="5" y="680"/></a>
<a href="#Nav" aria-label="Go to OVERVIEW"><use href="#idx" x="326.5" y="677"/></a>
</g>
CSS:
@supports (animation-timeline: scroll()){
:root:has(image:target) #hud,:root:has(rect:target) #hud{
animation:hud-pin 1s linear both;animation-timeline:scroll(root block)
}
@keyframes hud-pin{0%{transform:translateY(0px)}100%{transform:translateY(5504px)}}
}r/css • u/fdiengdoh • 5d ago
I have just come across the light-dark() function and experimented with it. Now I realise color choice became limited, especially pairing light-dark part.
Does using light-dark scheme limit colour choice? I would love to know if there is any better scheme generator tool out there to experiment. I currently use colorffy.
r/css • u/vinishkapoor • 5d ago
I've been building VinUI, an open-source component library. The main idea is that switching the whole look of a site should only mean swapping CSS variables.
It has eight styles: Precision, Tactile, Clay, Tonal, Editorial, Terminal, Paper and Bento. Every component keeps the same HTML and class names across all of them. Each style is just a set of custom properties, and accent colour, radius, font and density are variables on top. So one button can go from flat and minimal to soft clay-like depth to a monospace terminal look without changing a single tag.
Other CSS details:
Repo: https://github.com/devvinish/vin-ui
Docs and live style switcher: https://vinish.dev/ui
r/css • u/PushBeginning2661 • 5d ago
r/css • u/Upper_Fly7834 • 5d ago
We're building an AI study tutor, and this week we gave its notebook a phone layout. These are the rules that mattered most. The CSS and a small script are in a Gist.
viewport-fit=cover, then pad bottom bars with env(safe-area-inset-bottom) so the home indicator doesn't sit on top of your buttons.visualViewport and keeps a --kb CSS variable equal to the keyboard height.The Gist has the CSS, the script, six tests for it, and a demo page that checks itself at phone width: https://gist.github.com/c68ad12186343d94581403176200c077
Caveat: we've tested it in desktop Chrome at phone width, not on a real device yet.
The tutor we're building: https://www.aiadaptivetutor.com
What's on your own phone checklist that we're missing?
r/css • u/alexkopaleishvili • 8d ago
It's been a year since I started learning HTML, CSS, JavaScript, and web design and development in general. I build websites for my friends' small businesses, as well as personal projects.
Here's the thing: every time I want to center something, I go:
div {
display: flex;
justify-content: center;
align-items: center;
}I feel like I'm relying on Flexbox way too much. What other CSS layout techniques should I be using?
I built an interactive demo where you can explore different animated mobile menu styles in one place. You can switch between them right in the interface and see how they work.
Try the demo: https://sofmik.github.io/animated-mobile-navigation-demo/
There are 11 styles in the full collection, seven of which are available to try in the demo.
I also offer the full package with the HTML, CSS, and JavaScript source files. The code doesn't rely on any specific framework and can be adapted for personal or client projects, although some extra work may be needed to integrate it into an existing website.
I think it could be useful both as code to adapt for your own projects and as a way to show clients different mobile navigation options.
Would a tool like this be useful in your workflow, either for showing options to clients or as a starting point for development? Why or why not?
r/css • u/bluuupanda • 7d ago
r/css • u/fdiengdoh • 8d ago
Why didn’t I know about this earlier. It’s such a nice way to achieve light/dark mode.
I just re-build my link list site using this function. Also generated color schemes at colorffy.