CSS troubles newtab

User Help for Mozilla Firefox
Post Reply
jetspeedz
Posts: 200
Joined: January 4th, 2013, 12:11 am

CSS troubles newtab

Post by jetspeedz »

I don't know if there is an answer for this but a simple change to new tab background color appears to proliferate on to webpages as well that are forums.

For example the code below works well and i've been using it for a long time, but I noticed today that on the https://www.tivocommunity.com/community ... -forums.29 forum for example the "reply to thread box" is also black so your text is not visible at all. This happens only on some forums but I was playing around with the code and found no solution to keep the Black background for new tabs and not affecting websites with forum reply boxes. Any ideas is greatly appreciated.


@-moz-document url("about:blank"), url("about:home"), url("about:newtab") {
body {
background-color:#000000;
}
}
User avatar
RobertJ
Moderator
Posts: 10880
Joined: October 15th, 2003, 7:40 pm
Location: Chicago IL/Oconomowoc WI

Re: CSS troubles newtab

Post by RobertJ »

.
This works to color the active tab, color is up to you.

Code: Select all

.tab-content[selected="true"] {
  background: rgba(65, 85, 145, 0.4) !important;
}
This goes in the userChrome.css file under the line

@namespace url("http://www.mozilla.org/keymaster/gateke ... s.only.xul");

which should be at the top and only appear once.

.
FF 92.0 - TB 78.13 - Mac OSX 10.13.6
jetspeedz
Posts: 200
Joined: January 4th, 2013, 12:11 am

Re: CSS troubles newtab

Post by jetspeedz »

Thanks Robert but this does not fix the problem, in fact it just changed the color of the Tab itself which is not an issue. It is the forum text box that is affected which this does not change.
User avatar
dickvl
Posts: 54145
Joined: July 18th, 2005, 3:25 am

Re: CSS troubles newtab

Post by dickvl »

I see white text on a black background on the login page (css.php line 13).
https://www.tivocommunity.com/community/index.php
If that isn't working for you then you may have code to change/set the text color as well with the !important flag that makes it impossible for a website to override this color or you are otherwise blocking website colors.

Code: Select all

#loginBar .textCtrl {
	color: rgb(249, 249, 249);
	background-color: rgb(27, 27, 27);
	border-color: rgb(52, 52, 52);
}
jetspeedz
Posts: 200
Joined: January 4th, 2013, 12:11 am

Re: CSS troubles newtab

Post by jetspeedz »

Will test this monday when I'm back home. Thanks
User avatar
jscher2000
Posts: 11742
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: CSS troubles newtab

Post by jscher2000 »

If a site has a "rich text" editor, it may be an about:blank frame. You could try to discover that by right-clicking the black area, expanding the This Frame submenu, then clicking View Frame Info. The address should be listed there.

Unfortunately, I don't think CSS has the concept of a top level document, to avoid applying to framed pages.

How about adding a rule for color? If you want a black background, do you want white text? It is a good practice in CSS to set color and background-color together to avoid such problems.
User avatar
CaJazzman
Posts: 370
Joined: March 5th, 2009, 2:21 pm
Location: Vacaville,California

Re: CSS troubles newtab

Post by CaJazzman »

RobertJ wrote:.
This works to color the active tab, color is up to you.

Code: Select all

.tab-content[selected="true"] {
  background: rgba(65, 85, 145, 0.4) !important;
}
This goes in the userChrome.css file under the line

@namespace url("http://www.mozilla.org/keymaster/gateke ... s.only.xul");

which should be at the top and only appear once.

.
RobertJ, I took your code a little further and added this,

Code: Select all

.tab-content[selected="true"] {
  background: rgba(139, 0, 0, 1.5) !important;
}
and it makes it appear more of a solid color then a transparent color. I really like this, just wish I could make it so, that each tab would have a random color. I'm not a coder, but I'll bet someone could figure this out. 8-)
User avatar
jscher2000
Posts: 11742
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: CSS troubles newtab

Post by jscher2000 »

CaJazzman wrote:RobertJ, I took your code a little further and added this,

Code: Select all

.tab-content[selected="true"] {
  background: rgba(139, 0, 0, 1.5) !important;
}
and it makes it appear more of a solid color then a transparent color.
I think the 4th parameter of rgba only has meaning between 0 and 1 -- 0% opacity (100% transparent) to 100% opacity (0% transparent). Do you see a difference between 1 and 1.5?
User avatar
CaJazzman
Posts: 370
Joined: March 5th, 2009, 2:21 pm
Location: Vacaville,California

Re: CSS troubles newtab

Post by CaJazzman »

jscher2000 wrote:
CaJazzman wrote:RobertJ, I took your code a little further and added this,

Code: Select all

.tab-content[selected="true"] {
  background: rgba(139, 0, 0, 1.5) !important;
}
and it makes it appear more of a solid color then a transparent color.
I think the 4th parameter of rgba only has meaning between 0 and 1 -- 0% opacity (100% transparent) to 100% opacity (0% transparent). Do you see a difference between 1 and 1.5?
What I saw was the difference between .4 and 1.5, that’s why I said what I did. But, am not sure otherwise, since coding isn’t my thing. 8-)
jetspeedz
Posts: 200
Joined: January 4th, 2013, 12:11 am

Re: CSS troubles newtab

Post by jetspeedz »

jscher2000 wrote:If a site has a "rich text" editor, it may be an about:blank frame. You could try to discover that by right-clicking the black area, expanding the This Frame submenu, then clicking View Frame Info. The address should be listed there.

Unfortunately, I don't think CSS has the concept of a top level document, to avoid applying to framed pages.

How about adding a rule for color? If you want a black background, do you want white text? It is a good practice in CSS to set color and background-color together to avoid such problems.

I believe you are correct, i can live with this for this single page, not a deal breaker. It's the way the developer of that site chose to code that editor.
Post Reply