Custom stylesheet for .xhtml pages

Discuss application theming and theme development.
Post Reply
User avatar
seleznev
Posts: 3
Joined: November 9th, 2013, 6:24 pm
Location: Barnaul, Russian Federation

Custom stylesheet for .xhtml pages

Post by seleznev »

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:
User avatar
Aris
Posts: 3248
Joined: February 27th, 2011, 10:14 am

Re: Custom stylesheet for .xhtml pages

Post by Aris »

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

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

Re: Custom stylesheet for .xhtml pages

Post by seleznev »

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.
User avatar
patrickjdempsey
Posts: 23686
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC
Contact:

Re: Custom stylesheet for .xhtml pages

Post by patrickjdempsey »

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/
User avatar
seleznev
Posts: 3
Joined: November 9th, 2013, 6:24 pm
Location: Barnaul, Russian Federation

Re: Custom stylesheet for .xhtml pages

Post by seleznev »

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.
Post Reply