I would suggest using classes, and the cascading effect of CSS.
.button {
background-color: grey;
color: black;
font-size: 16px;
padding: 4px;
}
.button-sm {
width: 20px;
}
.button-md {
width: 40px;
}
Hey,
I’m working on a small project built on WordPress, but instead of using a proper theme structure I ended up building most of the UI using custom HTML + CSS blocks.
It worked fine early on, but now I’m starting to hit a wall.
Main issues I’m running into:
styles are duplicated across multiple sections I’ve relied too much on !important to override things no real global system for spacing / typography layout is inconsistent (mix of flex/grid depending on what worked at the time) small changes tend to break something else
At this point it feels like I’m constantly patching instead of improving anything.
So I’m trying to figure out the right move here from a dev perspective:
Do you usually refactor incrementally (cleaning styles section by section)? Or is this one of those cases where it’s better to scrap and rebuild properly with a structured system?
Curious how others approach this when a project reaches this stage.
Please or to participate in this conversation.