X
Tap here to go to the mobile version of the site.

Support Forum

Does userChrome.css really require the @namespace url... line?

Posted

RE: @namespace url("https://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */

I edited some of the appearance of Thunderbird by creating a userChrome.css file. Since I couldn't find a clear explanation of why the above referenced line needed to be included, I left it out, to no apparent ill-effect.

Now I'm wanting to customize the Bookmarks menu in Firefox, and I run into the same advice to include it, so I'm curious enough to want to find out if it's truly necessary or just some programmer's cute obsession with Ghost Busters.

RE: @namespace url("https://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */ I edited some of the appearance of Thunderbird by creating a userChrome.css file. Since I couldn't find a clear explanation of why the above referenced line needed to be included, I left it out, to no apparent ill-effect. Now I'm wanting to customize the Bookmarks menu in Firefox, and I run into the same advice to include it, so I'm curious enough to want to find out if it's truly necessary or just some programmer's cute obsession with Ghost Busters.
Quote

Additional System Details

Installed Plug-ins

  • Shockwave Flash 27.0 r0

Application

  • User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0

More Information

cor-el
  • Top 10 Contributor
  • Moderator
15975 solutions 144417 answers

Yes, you need this line to avoid possible namespace issues and for safety reasons.

Yes, you need this line to avoid possible namespace issues and for safety reasons. *https://developer.mozilla.org/Web/CSS/At-rule *https://developer.mozilla.org/Web/CSS/@namespace
Was this helpful to you? 0
Quote
ender21 6 solutions 41 answers

Does this rule still apply when using Firefox 57? If so, what is the correct form to use since (presumably) XUL no longer applies?

Does this rule still apply when using Firefox 57? If so, what is the correct form to use since (presumably) XUL no longer applies?

Modified by ender21

Was this helpful to you?
Quote
jscher2000
  • Top 10 Contributor
7038 solutions 57402 answers

Firefox's interface is a mix of XUL elements and HTML elements. When you use ONLY the XUL namespace, your userChrome.css file cannot style the HTML elements.

That's mostly fine, but occasionally it's an issue. Since I got stung by it once, I no longer use a namespace. If you are worried about your rules bleeding over into areas you hadn't intended to style, there are other workarounds. I have brief discussion of this issue here: https://www.userchrome.org/adding-style-recipes-userchrome-css.html#namespaces

Firefox's interface is a mix of XUL elements and HTML elements. When you use '''ONLY''' the XUL namespace, your userChrome.css file cannot style the HTML elements. That's mostly fine, but occasionally it's an issue. Since I got stung by it once, I no longer use a namespace. If you are worried about your rules bleeding over into areas you hadn't intended to style, there are other workarounds. I have brief discussion of this issue here: https://www.userchrome.org/adding-style-recipes-userchrome-css.html#namespaces
Was this helpful to you? 1
Quote
Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.