Topic on Project:Support desk

How to edit CSS for customized font

12
Asdaricus (talkcontribs)

I asked a while back how to have a custom font in my wiki. I was told that I need to edit the CCS. I am using the 'vector' style. I was not able to find the css for it. How does that work. Thank you.

MarkAHershberger (talkcontribs)

You can make the change in your wiki's [[MediaWiki:Common.css]] page.

Asdaricus (talkcontribs)

Thanks for your reply. What's the expected path? I don't see a common.css file or a vector.css in my wiki? Is it a file I have to create to override the default?

Ciencia Al Poder (talkcontribs)
Asdaricus (talkcontribs)

Hi Ciencia Al Poder. Thank you for the link. I looked at it and checked the link (MediaWiki:Common.css) for a global common css which is I need. The page that it links to has been deleted. I'm not sure where to put the common.css file. Thank you.

MarkAHershberger (talkcontribs)
Asdaricus (talkcontribs)
MarkAHershberger (talkcontribs)
Asdaricus (talkcontribs)
Asdaricus (talkcontribs)

Thanks again.

Is this all the code I need in the CSS (with the appropriate substitutions)?

@font-face {

  [ font-family: <family-name>; ] ||

  [ src: [ <url> [ format(<string>#) ]? | <font-face-name> ]#; ] ||

  [ unicode-range: <urange>#; ] ||

  [ font-variant: <font-variant>; ] ||

  [ font-feature-settings: normal | <feature-tag-value>#; ] ||

  [ font-stretch: <font-stretch>; ] ||

  [ font-weight: <weight>; ] ||

  [ font-style: <style>; ]

}

where 

<family-name> = <string> | <IDENT>+

<feature-tag-value> = <string> [ <integer> | on | off ]?

Asdaricus (talkcontribs)

My intention is not to have the text of the entire wiki changed arbitrarily to another font or even of specific formatted sections (header, index, etc.). I want to be able to specify within a page that such and such text is in this font and have the rest of the text in the same given page be the standard font.

Ciencia Al Poder (talkcontribs)

Once you've defined the @font-face, you can create your own CSS class like .specificfont { font-family: <family-name> } and then use that class where you want, like in <span class="specificfont>text</span>.

That's more a general CSS question than a MediaWiki-specific question, though. You can find more information about CSS fonts out there

Reply to "How to edit CSS for customized font"