Hacker News new | past | comments | ask | show | jobs | submit login

I just tried Stylish add-on for Firefox. Works great except I can't seem to figure out a way to make custom styles work for only a specific page. Maybe I'm missing something but there doesn't seem to be a way.

For example if you have .margin-width CSS class defined it will work on any page that has .margin-width CSS class, not just desired page (like Facebook).




You can use @-moz-document, I’m using this with dotjs for Firefox https://github.com/rlr/dotjs-addon#css


As bpierre said @-moz-document rule, which I just discovered has actually been unprefixed since Fx6.

Here's the MDN page detailing it and the various functions:

https://developer.mozilla.org/en-US/docs/CSS/@document


So @document means you can bypass the addon and just use the user stylesheet to implement the same thing. Didn't know about @document.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: