Sadly, it doesn’t work in combination with my favourite Firefox trick: putting stylesheets in HTTP Link headers. Why do that? because you can style non-html content, like so:
nc -l 8080 <<EOF
HTTP/1.1 200 Meh, it's OK, I guess
link: <https://email@example.com/css/sakura-dark.css>; rel="stylesheet"
I didn’t knew you could do that…
Does that work for other browsers? Is this a way to syntax highlight without HTML?
(sorry for the late reply, i’m not usually logged in and only look at the front page)
the blog post i read about this mentioned that the old opera (w/ presto engine) supported this as well. there are open bugs for webkit and blink, but neither are interested.
when you open a plain text document with firefox, it gets wrapped in a <pre> element, so that’s the only tag you get to interact with. css doesn’t have a feature to access individual words/characters (with the exception of :first-letter and :first-line), so that doesn’t (sadly) work. but you can at least give it some sensible margins, text size and a dark theme ;)
As a firefox user, I had no idea that the alternate styles came from the site itself! I’m also surprised that FF still supports this feature. I might add this to my site just for fun.
That’s the spirit. I decided to post this because it is a feature that has been there since forever and I noticed most people don’t know about it. It is quite fun. I can see people who are better with CSS than I am doing some crazy stuff, CSS Zen Garden style, with this feature. Even if only for fun.
This is cool, but let’s keep quiet about it to preserve it!
If Firefox devs see this it will get removed, because Chrome doesn’t do it.
On my website I’ve had alternative style sheet for years, but this feature is really half baked because Firefox doesn’t remember your choice and like with most useful stuff you can put on your website (feeds…) makes absolutely no effort to notify visitors of their existence.