Търсене в помощните статии

Избягвайте измамите при поддръжката. Никога няма да ви помолим да се обадите или изпратите SMS на телефонен номер или да споделите лична информация. Моля, докладвайте подозрителна активност на "Докладване за злоупотреба".

Научете повече

url filter doesn't work in userContent.css

  • 23 отговора
  • 8 имат този проблем
  • 1 изглед
  • Последен отговор от nimnull22

more options

Linux x86_64, Firefox 28

In my userContent.css I have:

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain(www.utro.ru)
{
  * {
    font-family: "Arial" !important;
    font-size:   10px !important;
    }
}


  * {
    font-family: "Verdana" !important;
    font-size:   15px    !important;
    line-height: 1.3em   !important;
  }
  h1, h2, h3, h4, h5, h6 {
    font-family: Verdana !important;
    font-size: 13px !important;
    font-weight: bold !important;
  }

What I expected is to see "www.utro.ru" with Arial font and 10 px size Other pages - with Verdana font and 15px size. But in reality Firefox draws every page with Verdana 15px.


If I remove every other conditions:

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain(www.utro.ru)
{
  * {
    font-family: "Arial" !important;
    font-size:   10px !important;
    }
}

Firefox starts to draw is expected - Arial 10px. Other pages with default font from configuration.

Is it another bug or I did something wrong? Firefox ignores more then one url filter condition!

Linux x86_64, Firefox 28 In my userContent.css I have: <pre><nowiki>@namespace url(http://www.w3.org/1999/xhtml); @-moz-document domain(www.utro.ru) { * { font-family: "Arial" !important; font-size: 10px !important; } } * { font-family: "Verdana" !important; font-size: 15px !important; line-height: 1.3em !important; } h1, h2, h3, h4, h5, h6 { font-family: Verdana !important; font-size: 13px !important; font-weight: bold !important; }</nowiki></pre> What I expected is to see "www.utro.ru" with Arial font and 10 px size Other pages - with Verdana font and 15px size. But in reality Firefox draws every page with Verdana 15px. If I remove every other conditions: <pre><nowiki>@namespace url(http://www.w3.org/1999/xhtml); @-moz-document domain(www.utro.ru) { * { font-family: "Arial" !important; font-size: 10px !important; } }</nowiki></pre> Firefox starts to draw is expected - Arial 10px. Other pages with default font from configuration. Is it another bug or I did something wrong? Firefox ignores more then one url filter condition!

Променено на от cor-el

Избрано решение

nimnull22 wrote:

Thank you. Your solution works as expected.

You're welcome.

nimnull22 wrote:

How to exclude one site.

Here's an example of a global style with an exception. Just replace the placeholders with actual domain names. Add another | symbol followed by the domain name to add another exception.


@-moz-document regexp("https?://(?!(utro.ru|example-of-an-exception.com|www.placeholder.site-exception.net)).*") {

/* The following is for all sites except Utro.ru */
* { font-family: "Comic Sans MS" !important; }

}

/* The following is just for support.mozilla.org
It will override the global declaration above */
@-moz-document domain("support.mozilla.org") {

* { font-family: "Times New Roman" !important; }

}

Прочетете този отговор в контекста 👍 0

Всички отговори (3)

more options

OK.

Everything works except for one problem.

I need one domain uses its own font and font-size.

How to exclude one site. For example I need it to uses Verdana for sans-serif and Courier New for monospace?

more options

Избрано решение

nimnull22 wrote:

Thank you. Your solution works as expected.

You're welcome.

nimnull22 wrote:

How to exclude one site.

Here's an example of a global style with an exception. Just replace the placeholders with actual domain names. Add another | symbol followed by the domain name to add another exception.


@-moz-document regexp("https?://(?!(utro.ru|example-of-an-exception.com|www.placeholder.site-exception.net)).*") {

/* The following is for all sites except Utro.ru */
* { font-family: "Comic Sans MS" !important; }

}

/* The following is just for support.mozilla.org
It will override the global declaration above */
@-moz-document domain("support.mozilla.org") {

* { font-family: "Times New Roman" !important; }

}

more options

@ Gingerbread Man

Thanks a lot for your examples. Now all works as I expected.

  1. 1
  2. 2