[SOLVED] Importing other style sheets into userChrome.css

User Help for Mozilla Firefox
User avatar
MarkRH
Posts: 1358
Joined: September 12th, 2007, 2:30 am
Location: Edmond, OK
Contact:

Re: Importing other style sheets into userChrome.css

Post by MarkRH »

Someone sent me feedback that since the XUL stuff has been going since v54 or something, don't even need that @namespace line now. I took mine out and all my userChrome.css code still works fine. After reading Adding Style Recipes to userChrome.css it seems to depend on exactly what you want done.
User avatar
xanthon
Posts: 405
Joined: December 17th, 2005, 11:55 pm

Re: Importing other style sheets into userChrome.css

Post by xanthon »

@dickvl Thanks. I have added the @namespace line to all three files and will report back after I have run Firefox quantum again.

@MarkRH Thank you also. I have read that page also. The author is the same contributor to the support.mozilla.org page to which I referred earlier.
User avatar
Frank Lion
Posts: 21173
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom
Contact:

Re: Importing other style sheets into userChrome.css

Post by Frank Lion »

MarkRH wrote:Someone sent me feedback that since the XUL stuff has been going since v54 or something, don't even need that @namespace line now. I took mine out and all my userChrome.css code still works fine.
Yeah, I know, it's always been like that and 95% of the time you'll get away with it. Sometimes the same is true with the use of !important, trailing braces on wrapped @ stuff, semi-colons in the code, etc. etc. In other words, you have discovered nothing new -
Frank Lion wrote:Yes, I know. (that's me answering in advance the usual 'actually, you can actually use display: none !important there, actually' stuff)
http://forums.mozillazine.org/viewtopic ... #p13441517

I get it, people want to feel special and think they have discovered some secret that everyone else is too stupid to have ever seen. They haven't.

Meantime, I have to quickly write thousands of lines of original bomb-proof code that will not break across 100 Linux distros, Windows XP, Win7 and Win10 and Mac. I learnt years ago that the way to do that is to not get clever, keep the code simple and also stick to best practice.

On this thread, I replicated the code just as it was written here and it worked for me, but not for the OP....is that because I'm on a Linux OS and they are not? Who knows? It's not me with the problem.

https://developer.mozilla.org/en-US/doc ... Namespaces
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)
.
User avatar
xanthon
Posts: 405
Joined: December 17th, 2005, 11:55 pm

Re: Importing other style sheets into userChrome.css

Post by xanthon »

Frank Lion » 29 Jan 2018 02:25 am wrote:On this thread, I replicated the code just as it was written here and it worked for me, but not for the OP....is that because I'm on a Linux OS and they are not? Who knows? It's not me with the problem.
I am also using a Linux system.

The file searchbar.css is now imported following the insertion of the namespace line in that file, in tabbar.css and in userChrome.css.
User avatar
the-edmeister
Posts: 32249
Joined: February 25th, 2003, 12:51 am
Location: Chicago, IL, USA

Re: [SOLVED] Importing other style sheets into userChrome.cs

Post by the-edmeister »

This is how my userChrome.css looks. The "scraps" of code which (probably) need that gatekeeper code line are added at the end of the file where they will be read last.

Code: Select all

/* userChrome.css for Quantum Fx 57 */

@import url("search-bar-names-std.css");
@import url("selected-and-not-tabs.css");
@import url("bookmarks-sidebar.css");
 
/* ------------------------------ */

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 

/* Tab while loading */
.tabbrowser-tab[busy] {
  color: red !important;}
.tabbrowser-tab[unread] {font-style: italic;}


A mind is a terrible thing to waste. Mine has wandered off and I'm out looking for it.
User avatar
Frank Lion
Posts: 21173
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom
Contact:

Re: Importing other style sheets into userChrome.css

Post by Frank Lion »

xanthon wrote:I am also using a Linux system.
Yeah, I know, it's written across the bottom of every one of your posts here. It's almost as though I was drawing attention to the fact of how different Linux distros can behave, isn't it?
...bomb-proof code that will not break across 100 Linux distros
xanthon wrote:The file searchbar.css is now imported following the insertion of the namespace line in that file, in tabbar.css and in userChrome.css.
No comment.
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)
.
User avatar
xanthon
Posts: 405
Joined: December 17th, 2005, 11:55 pm

Re: [SOLVED] Importing other style sheets into userChrome.cs

Post by xanthon »

dickvl Posted 28 Jan 2018 04:26 pm wrote:Each file you import in userChrome.css needs to have the @namespace line at the start of the file.
userChrome.css needs this line as well, but all @import rules need to be before the @namespace line in userChrome.css.
Post Reply