| 1 |
/* |
| 2 |
* Vector's common typography rules, |
| 3 |
* including whitespace with `margin` & `padding` and list bullets |
| 4 |
* as part of typographic styles. Iconography wouldn't belong here. |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
html { |
| 9 |
font-size: @font-size-root; |
| 10 |
} |
| 11 |
|
| 12 |
html, |
| 13 |
body { |
| 14 |
font-family: @font-family-sans; |
| 15 |
} |
| 16 |
|
| 17 |
ul { |
| 18 |
// Overrides default sublist styling due to lists being used in some talk pages (i.e. russian wiki) |
| 19 |
// https://phabricator.wikimedia.org/T364865#9802562 |
| 20 |
list-style-type: disc; |
| 21 |
} |
| 22 |
|
| 23 |
pre, |
| 24 |
.mw-code { |
| 25 |
line-height: @line-height-code; |
| 26 |
} |
| 27 |
|
| 28 |
.mw-jump-link:not( :focus ) { |
| 29 |
.mixin-screen-reader-text; |
| 30 |
.user-select( none ); |
| 31 |
} |
| 32 |
|
| 33 |
/* Use unscoped selector to allow edit sections outside of .mw-body-content and .vector-body (T160269) */ |
| 34 |
.mw-editsection, |
| 35 |
.mw-editsection-like { |
| 36 |
font-family: @font-family-sans; |
| 37 |
} |
| 38 |
|
| 39 |
/* Main content area, including siteNotice, indicators, categories, firstHeading and `.vector-body`. */ |
| 40 |
.mw-body { |
| 41 |
// h1's can exist outside of `.mw-body-content` so some heading styles |
| 42 |
// therefore need to be defined in `.mw-body` as well. |
| 43 |
h1, |
| 44 |
.mw-heading1, |
| 45 |
&-content h1, |
| 46 |
&-content .mw-heading1, |
| 47 |
&-content h2, |
| 48 |
&-content .mw-heading2 { |
| 49 |
font-family: @font-family-serif; |
| 50 |
line-height: @line-height-xx-small; |
| 51 |
|
| 52 |
// Fallback heading font for scripts which render poorly in `@font-family-serif`. |
| 53 |
// See T73240 |
| 54 |
&:lang( ja ), /* See T65817 */ |
| 55 |
&:lang( he ), /* See T65843 and T65844 */ |
| 56 |
&:lang( ko ) { /* See T65827 */ |
| 57 |
font-family: @font-family-sans--fallback; |
| 58 |
} |
| 59 |
|
| 60 |
&:lang( ckb ) { /* See T306317 */ |
| 61 |
font-family: 'Scheherazade', @font-family-serif; |
| 62 |
} |
| 63 |
|
| 64 |
/* Burmese (Myanmar) language headlines would be cropped with set `line-height` */ |
| 65 |
/* See T193270 */ |
| 66 |
&:lang( my ) { |
| 67 |
line-height: normal; |
| 68 |
} |
| 69 |
} |
| 70 |
|
| 71 |
h1, |
| 72 |
.mw-heading1, |
| 73 |
&-content h1, |
| 74 |
&-content .mw-heading1 { |
| 75 |
font-size: @font-size-heading-1; |
| 76 |
} |
| 77 |
|
| 78 |
.mw-heading2, |
| 79 |
h2 { |
| 80 |
font-size: @font-size-heading-2; |
| 81 |
} |
| 82 |
|
| 83 |
.mw-heading3, |
| 84 |
h3, |
| 85 |
.mw-heading4, |
| 86 |
h4, |
| 87 |
.mw-heading5, |
| 88 |
h5, |
| 89 |
.mw-heading6, |
| 90 |
h6 { |
| 91 |
// Additional bottom padding isnt necessary because only the h2 has an underline |
| 92 |
padding-bottom: 0; |
| 93 |
line-height: @line-height-base; |
| 94 |
} |
| 95 |
|
| 96 |
.mw-heading2, |
| 97 |
h2, |
| 98 |
.mw-heading3, |
| 99 |
h3, |
| 100 |
.mw-heading4, |
| 101 |
h4, |
| 102 |
.mw-heading5, |
| 103 |
h5, |
| 104 |
.mw-heading6, |
| 105 |
h6 { |
| 106 |
// Headings should have extra spacing from its siblings, which is a |
| 107 |
// <p> element most of the time. In this case, spacing from the heading |
| 108 |
// the <p> is sufficient. However, we to account for cases |
| 109 |
// where the previous sibling element doesnt have any spacing |
| 110 |
margin: 0.25em 0 0.25em 0; |
| 111 |
} |
| 112 |
|
| 113 |
.mw-heading3, |
| 114 |
h3 { |
| 115 |
font-size: @font-size-heading-3; |
| 116 |
} |
| 117 |
|
| 118 |
.mw-heading3, |
| 119 |
h3, |
| 120 |
.mw-heading4, |
| 121 |
h4 { |
| 122 |
font-weight: bold; |
| 123 |
} |
| 124 |
|
| 125 |
.mw-heading4, |
| 126 |
h4, |
| 127 |
.mw-heading5, |
| 128 |
h5, |
| 129 |
.mw-heading6, |
| 130 |
h6 { |
| 131 |
font-size: @font-size-reset; // Reset. |
| 132 |
} |
| 133 |
|
| 134 |
// On Talk:Test?dtenable=0 h2 is inside mw-heading which results in larger than |
| 135 |
// expected font size since @font-size-heading-2 is defined in ems (T357929). |
| 136 |
// TODO: Consider switching font-sizes to rems instead of ems to remove these styles. |
| 137 |
.mw-heading1 h1, |
| 138 |
.mw-heading2 h2, |
| 139 |
.mw-heading3 h3, |
| 140 |
.mw-heading4 h4, |
| 141 |
.mw-heading5 h5, |
| 142 |
.mw-heading6 h6 { |
| 143 |
margin-top: 0; |
| 144 |
font-size: inherit; |
| 145 |
} |
| 146 |
|
| 147 |
p { |
| 148 |
margin: 0.5em 0 1em 0; |
| 149 |
} |
| 150 |
|
| 151 |
p + ul, |
| 152 |
p + ol, |
| 153 |
p + table, |
| 154 |
p + dl, |
| 155 |
p + blockquote { |
| 156 |
// Inline elements should have 0.5em total top spacing |
| 157 |
// Use negative margin to account for 1em bottom margin on paragraphs |
| 158 |
// This will not work for floated elements |
| 159 |
margin-top: -0.5em; |
| 160 |
} |
| 161 |
|
| 162 |
blockquote { |
| 163 |
border-left: @border-start-blockquote; |
| 164 |
padding: @padding-blockquote; |
| 165 |
|
| 166 |
// Ensure not to inherit whitespace mashing margins on child elements. |
| 167 |
> :first-child { |
| 168 |
margin-top: 0; |
| 169 |
} |
| 170 |
|
| 171 |
> :last-child { |
| 172 |
margin-bottom: 0; |
| 173 |
} |
| 174 |
} |
| 175 |
} |
| 176 |
|
| 177 |
// T335625 - Move siteSub into common.less to prevent it from being feature-flagged |
| 178 |
// and overriding on-wiki modifications. |
| 179 |
#siteSub { |
| 180 |
font-size: @font-size-small; // T311421 |
| 181 |
// By default the sitesub (i.e. tagline) is hidden as it was hidden in Vector legacy but site styles can reveal. |
| 182 |
display: none; |
| 183 |
} |
| 184 |
|
| 185 |
.vector-body { |
| 186 |
font-size: var( --font-size-medium ); |
| 187 |
line-height: var( --line-height-medium ); |
| 188 |
} |