MozillaZine

Custom stylesheet for .xhtml pages

Discuss application theming and theme development.
seleznev

User avatar
 
Posts: 3
Joined: November 9th, 2013, 6:24 pm
Location: Barnaul, Russian Federation

Post Posted November 9th, 2013, 6:57 pm

Hello!

How I can apply custom stylesheet for the about:certerror (chrome://browser/content/certerror/aboutCertError.xhtml) page without lines like "skin browser anystr chrome/browser/"?

I tried add line like here in chrome.manifest, and it doesn't work for about:certerror (but work fine with about:newtab):

Code: Select all
style about:newtab chrome://test/skin/custom.css
style about:certerror chrome://test/skin/custom.css

In custom.css (just for test, of cource):
Code: Select all
* {
  background: #f0f !important;
}

Question looks simple, but I can't find answer without assistance. :cry:

Aris

User avatar
 
Posts: 3055
Joined: February 27th, 2011, 10:14 am

Post Posted November 10th, 2013, 8:58 am

Use only css code for this, no manifest tweaks.

Code: Select all
@-moz-document url("about:certerror") {

  /* background color of every page element */
  * {
    background: red !important;
  }

  /* just page background */
  :root {
    background: blue !important;
  }

}
Customize Firefox 57+ UI || Classic Theme Restorer (Fx 29-56) || Classic Toolbar Buttons || CustomizeMyBird

How to use legacy add-ons after Firefox 57 release? Switch to Firefox 52 ESR or move to Waterfox browser.

seleznev

User avatar
 
Posts: 3
Joined: November 9th, 2013, 6:24 pm
Location: Barnaul, Russian Federation

Post Posted November 10th, 2013, 5:37 pm

Aris wrote:Use only css code for this, no manifest tweaks.

Thanks for answer, but where I should paste this code? I know about nsIStyleSheetService, "override" in manifest (for extensions), Stylish or userChrome.css for some users, but it doesn't work in themes. :( If way to apply the .css for all documents is exist, please tell me.
Last edited by seleznev on November 10th, 2013, 8:41 pm, edited 1 time in total.
# Sorry for my English.

patrickjdempsey

User avatar
 
Posts: 23734
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC

Post Posted November 10th, 2013, 7:43 pm

In a proper Theme, you just style aboutCertError.css in the /browser/ skin. No special manifest needed as long as you are loading the entire skin.
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/

seleznev

User avatar
 
Posts: 3
Joined: November 9th, 2013, 6:24 pm
Location: Barnaul, Russian Federation

Post Posted November 10th, 2013, 8:39 pm

patrickjdempsey wrote:just style aboutCertError.css in the /browser/ skin


I use this way now, but copy-paste all css, images, etc from the original theme looks as overhead for my tasks. And I try to find another solution.
# Sorry for my English.

Return to Theme Development


Who is online

Users browsing this forum: No registered users and 1 guest