mediawiki-skins-MinervaNeue/resources/skins.minerva.content.styles/main.less
Volker E 09d0feb287 Add @font-size-root var and rename @font-size-body-mobile
Following Vector and OOUI in `@font-size-root` and put it in central
file. Removing duplicated code in `html` and `body` achieving the
same thing.
Also renaming `@font-size-body-mobile` to a distinct
`@font-size-body--feature-phone` ending the confusion that it's a
variable only used at `@width-breakpoint-mobile - 1`.

Change-Id: Ie355d015d882f61c813991c3244bfcb67f161791
2019-12-12 17:34:44 -08:00

78 lines
1.9 KiB
Plaintext

@import '../../minerva.less/minerva.variables.less';
@import '../../minerva.less/minerva.mixins.less';
@import 'toc.less';
// Content formatting and typography
//
// Our content is predominately text, hence visual hierarchy must be clear.
//
// Styleguide 1.
body {
font-family: @fontFamilyBase;
line-height: 1.4;
-webkit-tap-highlight-color: rgba( 0, 0, 0, 0.2 );
overflow-y: scroll;
}
.content {
line-height: @line-height-content;
// Deal with long links (bug 60387)
word-wrap: break-word;
/* Emulate Center - from mediawiki.skinning/elements.css */
.center {
width: 100%;
text-align: center;
> *,
.thumb {
margin-left: auto;
margin-right: auto;
}
}
}
// Feature phones < 320px viewport receive smaller font.
@media all and ( max-width: @width-breakpoint-mobile - 1 ) {
html {
font-size: @font-size-root--feature-phone;
}
.content {
margin: 0 12px;
}
}
.nomobile {
// No mobile should trump any other class. e.g. .content table { display: table; }
display: none !important;
}
// Support iOS 9+ browsers: Enable Dynamic Type resizing, see
// http://www.interactiveaccessibility.com/blog/text-resizing-web-pages-ios-using-dynamic-type
// & T204807.
@supports ( font: -apple-system-body ) {
html {
font: -apple-system-body; // stylelint-disable-line font-family-no-missing-generic-family-keyword
}
// Most iOS browsers' default font size is 16px but Dynamic Type's default
// font size is 17px. We need to scale down @font-size-root and
// @font-size-root--feature-phone by this ratio in order to make them relative to these
// browsers' defaults again. By doing this, the default Dynamic Type text size
// will appear identical to the browser's default text size.
@dynamicTypeScalingFactor: 16 / 17;
body {
font-size: @font-size-root * @dynamicTypeScalingFactor;
}
@media all and ( max-width: @width-breakpoint-mobile - 1 ) {
body {
font-size: @font-size-root--feature-phone * @dynamicTypeScalingFactor;
}
}
}