MyStudio Free demo
Refactoring legacy CSS without breaking everything - Printable Version

+- MyStudio Free demo (https://demo.mystudio.forumeze.com)
+-- Forum: Webmaster (https://demo.mystudio.forumeze.com/forum-15.html)
+--- Forum: Design & Development (https://demo.mystudio.forumeze.com/forum-17.html)
+--- Thread: Refactoring legacy CSS without breaking everything (/thread-236.html)

Pages: 1 2 3 4


Refactoring legacy CSS without breaking everything - ByteBruce - 11-27-2026

:has() finally lets me style parents without JavaScript, and support is good now.

Code:
:root { --accent: #4f7cff; }
— CSS variables made my theming life so much easier.

I design in the browser almost exclusively now; mockups only for client sign-off.

Container queries changed how I build card layouts — the component adapts to its slot, not the viewport.


- PatchPat - 11-27-2026

I still reach for Bootstrap when a client needs to maintain it afterwards.

Could not agree more.


- WidgetWill - 11-27-2026

(11-27-2026, 03:08 PM)PatchPat Wrote: I still reach for Bootstrap when a client needs to maintain it afterwards.
:has() feels like cheating compared to what we used to do.


- RetroRex - 11-27-2026

:has() feels like cheating compared to what we used to do.

Refactoring legacy CSS one component at a time is the only sane way.


- BinaryBen - 11-27-2026

CSS variables + one class toggle is my whole dark mode stack.

:has() feels like cheating compared to what we used to do.

Thanks for sharing, saved me a lot of time.


- GamerGhoul - 11-27-2026

I still reach for Bootstrap when a client needs to maintain it afterwards.

Container queries are great but I still add a media-query fallback.

Interesting — I will have to try that.


- RetroRex - 11-27-2026

I still reach for Bootstrap when a client needs to maintain it afterwards.

Refactoring legacy CSS one component at a time is the only sane way.

Good point, I had not thought of it that way.


- ZenZara - 11-27-2026

I still reach for Bootstrap when a client needs to maintain it afterwards.


- DevDan - 11-27-2026

I still reach for Bootstrap when a client needs to maintain it afterwards.


- GamerGhoul - 11-28-2026

Container queries are great but I still add a media-query fallback.

:has() feels like cheating compared to what we used to do.