Difference between Firefox Preferences and Firefox default stylesheet
I wonder if anyone can help me with this. I understand the concept of UA stylesheets. But I'm confused about the difference between a UA stylesheet and browser options/preferences. To clarify - I know I can change the font face, size and colour in Firefox but those changes do not appear in Firefox's default stylesheet. If I check my changes in Firebug, the element changes are shown in the computed tag. So, for example, if I change the font size to 20px and the colour to Maroon, and then click the <p> element in Firebug then click computed, those changes are shown. But when I open the Firefox stylesheet, they are not shown.
I may be a bit gormless on this but would welcome any help and clarification.
what is a UA stylesheet?
and why would you want a browser specific stylesheet for Firefox?
If you don't know what a UA stylesheet is, should you be responding to my question. UA means User Agent, in other words the browser. Someone visually impaired or colour blind would want to modify the text size and/or how links are displayed to override an author style with conflicting colours. The latter can be done by appending a User Stylesheet. The former can be done using Firefox's or any other browser's preferences. My question is - where are the preferences stored - they do not show up in the UA (Firefox default) stylesheet.
Does Firefox write a new stylesheet file for this? I guess I'm meaning something in addition to the default. In other words, the default doesn't get changed; that way the user can instantly go back to it if s/he wants. Never did make my own so I can't really say. Maybe experiment and see if a "custom.css" or something similar is written to the hard drive.
Still not sure what the question is, however the Firefox User Agent stylesheet can be found by typing resource://gre-resources/html.css into the URL bar.
If there is any style you want to override just place the style the way you want it in your own stylesheet.
I understand the default styleshee is accessbile at resource://gre-resources/html.css as you say. But my question, apart from the Firefox/Options dialog, are the user override styles saved as a .css file and if so, can they also be accessed. Or, are the local overrides appended to the html.css file in some way.
Does this help?
If a Firefox user wants to override styles on a permanent basis they would edit userContent-example.css and copy it as userContent.css . This file is located in your Firefox profile. It is usually located in the "application data" folder on Windows, or the "application support" folder on Macintosh. For example I'm using Windows 7 on my computer the css file is located at: (windows profile user name)/AppData (which is a hidden folder)/Roaming/Mozilla/Firefox/Profiles/nx3oq5bc.default/chrome/userContent-example.css
Originally Posted by GeorgeCB
If a user does override their styles on a permanent basis then as a developer you would have no control over the finished product (how it would look to the user).
If as a developer you want to give the user some choices (different stylesheets to choose from) try something like this:
With these three style sheets offered, the styles "Default Style", "Fancy", and "Basic" will be listed in the View >Page Style > submenu. When the user selects a style, the page will immediately be re-rendered using that style sheet.
<link href="default.css" rel="stylesheet" type="text/css" title="Default Style">
<link href="fancy.css" rel="alternate stylesheet" type="text/css" title="Fancy">
<link href="basic.css" rel="alternate stylesheet" type="text/css" title="Basic">
When style sheets are referenced with a title attribute on the <link> or <style> element, the title becomes one of the choices offered to the user. Style sheets linked with the same title are part of the same choice. Style sheets linked without a title attribute are always applied.
Use rel="stylesheet" to link to the default style, and rel="alternate stylesheet" to link to alternative style sheets. This tells Firefox which style sheet title should be selected by default, and makes that default selection apply in browsers that do not support alternate style sheets.
Hope that helps answer your question?
As you rightly say the userContent-example.css can be used to overwrite an author style. But if I don't want to go that far and just change the font size - I can do this through Tools>Options>Content. I appreciate the size will only change on text using a relative unit of measure. But that change must be stored somewhere. Does it generate a new stylesheet and if so, where is it stored.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)