User-configurable CSS

Tags:

Added: 2025-01-05T00:00

User-configurable CSS

This site has had the same styling for probably over a decade now, ever since I managed to convince a friend who knows front-end stuff to knock me up a quick CSS (thanks Mathieu!).

Recently though, I've been seeing some sites with very nice, clean CSS, and wondering what my site would look like with said CSS.

Rather than update the CSS, and redeploy the site each time, or play around with it in Developer Tools, I thought that I'd try a different approach.
At first, I toyed with the idea of allowing people to upload CSS, but that was more complicated.
So what I have settled on is modifying the site that it can take the CSS from a cookie. I have added a little page to allow the setting of the cookie.
The address is /css. Use the parameter ?set= to point to the CSS file.

This means that it's really easy to temporarily "try on" someone else's CSS.
It doesn't mean however that this site will look exactly like the site you supply the CSS from. Often the HTML will have specific classes in it, and ways of building the site.
This is more for just applying formatting to a standard HTML 5 page. Which is what I want, as I don't want to have to modify the HTML if I can help it.
Basically, I want to just write plain HTML 5, and it all work, scale nicely, be easy to read, and support mobile devices.

Here are some examples. After you click the link, a 1-year cookie will be set. This will only affect you. If you upload some crazy CSS, with weird images in it, you're the only person who will be seeing it.

Some example CSSes:
The original one
Hacker News
benjojo.co.uk
Bruce Perens
Robert Heaton 1
Robert Heaton 2
Pierre Kim
Simple CSS
The NHS
gov.uk
From https://www.tomspencer.dev/blog/

I'm thinking that Tom Spencer's and benjojo's CSS is quite clean, nice, and seems to work well with the current HTML.

Some sites use multiple CSS files, some have inline CSS, some make heavy use of CSS classes.

But you get the idea.
If you find one that makes this site look amazing, please add a comment.

Posted by Calum on 2025-01-05T00:00 under:
Add a comment

Your IP:
Please enter 5609527 here: