MozillaZine

CSS troubles newtab

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

Post Posted October 11th, 2018, 2:07 pm

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;
}
}

RobertJ
Moderator

User avatar
 
Posts: 10745
Joined: October 15th, 2003, 7:40 pm
Location: Chicago IL/Oconomowoc WI

Post Posted October 11th, 2018, 2:31 pm

.
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/gatekeeper/there.is.only.xul");

which should be at the top and only appear once.

.
FF 64.0.2 - FF 65b11 - FF 66a - TB 60.4 - Mac OSX 10.13.6
Computers I've used: IBM 7094/UNIVAC 1108/IBM 360/DEC PDP11/DEC VAX-11 780/DEC VAXstation 8000/Sun SPARCstation 2/Mac from 1984 to 2019

jetspeedz
 
Posts: 94
Joined: January 4th, 2013, 12:11 am

Post Posted October 11th, 2018, 2:42 pm

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.

dickvl

User avatar
 
Posts: 52453
Joined: July 18th, 2005, 3:25 am

Post Posted October 11th, 2018, 8:40 pm

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: 94
Joined: January 4th, 2013, 12:11 am

Post Posted October 11th, 2018, 8:45 pm

Will test this monday when I'm back home. Thanks

jscher2000

User avatar
 
Posts: 10415
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA

Post Posted October 12th, 2018, 4:17 pm

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.

CaJazzman

User avatar
 
Posts: 326
Joined: March 5th, 2009, 2:21 pm
Location: Vacaville,California

Post Posted October 12th, 2018, 4:46 pm

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/gatekeeper/there.is.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-)

jscher2000

User avatar
 
Posts: 10415
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA

Post Posted October 13th, 2018, 2:46 pm

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?

CaJazzman

User avatar
 
Posts: 326
Joined: March 5th, 2009, 2:21 pm
Location: Vacaville,California

Post Posted October 13th, 2018, 5:42 pm

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: 94
Joined: January 4th, 2013, 12:11 am

Post Posted October 15th, 2018, 11:18 am

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.

Return to Firefox Support


Who is online

Users browsing this forum: No registered users and 10 guests