In WordPress, themes have allowed the user to write additional CSS to override the design imposed by the theme and plugins’ design, and to create new styles where none existed before. This site has made use of this feature. However, I noticed the other day that the lists of posts in the footer were smushed together when I looked at it on my phone. I wondered if it was a quirk of that browser, so I checked other browsers on my phone: all the same. I checked on my desktop: the same.
When I checked the theme’s custom CSS, I discovered it was completely empty, blank, devoid of all the CSS code I’d spent so long writing and researching and tweaking to get the appearance of my website just so. I couldn’t remember having changed themes, which I know empties the additional CSS file of all content, recently, so I don’t know what happened.
Not to worry: I have UpdraftPlus make automatic backups; I’d just copy and paste the last good custom.css file. The most recent one was blank. I knew I didn’t have to go (much) further back than 5 December 2021 because I documented the fixing of weird colour effects on that date, and all was well when I left it. However, the backups were all blank up that date and earlier.
That meant I was back to square one: I’d have to redo all of the code from scratch. I have done most of it, but I can’t remember if there was anything else in particular that needs to be added. Still, it looks good enough for now, so I’ll leave it at that – until I spot something I’ve missed, of course.
I’ve saved it in an off-site file, which I will now have to remember to update with every big change and little tweak I make in the future. Perhaps I should go back to using a custom CSS plugin, which will retain all CSS regardless of theme. I think I stopped using one because not all custom CSS code works with all themes. I’d need a plugin that switches which code it uses depending on which theme is active at the time. Sounds overcomplicated to me.