Deth

Fitness and everything else

Working On Simplifying My CSS

For a while now, I have been wanting to simplify my CSS. I’ve had a good amount of cruft left over from changes that I’ve made for a while now. Some of it was testing, and other stuff I just left in there. When I used Hugo, PostCSS would clean it up, but I’ve not used that in a year now. Hugo always worked, but PostCSS just had so many dependencies, including JavaScript, which I don’t use for anything else.

realized I could consolidate some classes in the SCSS files. Nesting helps with that. It isn’t and wasn’t necessary to have classes for some things that were almost the same. I moved that all into nested selectors. I can always switch certain things to classes, but I’d only have to do that if I needed to change something on a specific page or section.

There are most definitely places where the classes make a lot of sense. Take, for example, my weather calendar page. I want that to be laid out like a colander and not a normal article. That’s unique, so it needed to be somehow specified. For the most part, though, the classes were just mostly repeating themselves.

I just wanted to do it for fun. It will make things easier to maintain over the long run, but that’s just an added bonus. In the past, there were plenty of cases where, when I wanted to tweak something, I’d have to figure out the right class to edit. I had them nested and too similarly named. In many ways, this website is like a toy for me.

The other thing is that I still had a lot of cruft left in my SCSS files from past edits. I’d just comment stuff out. Zola didn’t transfer the commend-out rules, so it didn’t really make the final CSS files bigger. What it did do is make it a pain in the ass at times to find the section I was looking for to edit. There was a lot of unnecessary scrolling.