mediawiki-skins-MinervaNeue/resources/skins.minerva.base.styles/ui.less
jdlrobson c0f08790ea Remove the mw-ui-icon hacks and overrides
Note: this agitates T230232 again - when merging this please
make sure a merge for I929090848f3e04647a97f4979ec78682623fa070
is pending.

In various places we try to override the default mw-ui-icon behaviours
The hacks need to be removed as part of addressing the core problem.

Changes:
* Wherever we use mw-ui-icon-before in PHP - wrap the label with a span
so that label font-size is altered where needed - not the icon
* Where a small icon is needed us isSmall parameter for the Icon component
* Apply font-size to labels of mw-ui-icon-before elements
* The browser tests need a slight update to access the span element inside
a menu item - in the case of the logout button the label is always hidden,
so we need to check the visibility of the parent element (secondary_action)

Bug: T229440
Depends-On:  I3f803ec4c9068b30aa93b803391aa4d65d8310ff
Change-Id: I07e4ae233979636b739f1117dd7703571e0a9366
2019-09-10 10:53:20 -07:00

326 lines
6.7 KiB
Plaintext

@import '../../minerva.less/minerva.variables.less';
@import '../../minerva.less/minerva.mixins.less';
@import 'mediawiki.mixins.less';
/* stylelint-disable no-descending-specificity */
html,
body {
// Ensure overlays take up full screen
height: 100%;
}
html {
// FIXME: Still from Eric Meyer's reset, that should be better fine-grained.
font-size: 100%;
// Support Safari: Prevent font scaling in landscape
-webkit-text-size-adjust: none;
}
body {
background-color: @skinContentBgColor;
color: @colorGray2;
// Support All Browsers: Remove `margin` (normalized)
margin: 0;
// FIXME: Still from Eric Meyer's reset, that should be good to go.
line-height: 1;
}
main {
// Support IE 9-11: Apply correct `display` (normalized), see T207618.
display: block;
}
// FIXME: should we use .mw-body here instead?
#content {
// avoid margin collapsing (see T147956)
border-top: 1px solid transparent;
padding-bottom: 32px;
}
.overlay-enabled,
#content {
background-color: @skinContentBgColor;
}
.header-container {
border-bottom: 1px solid @colorGray12;
&.header-chrome {
background-color: @chromeColor;
border: 0;
box-shadow: inset 0 -1px 3px rgba( 0, 0, 0, 0.08 );
}
}
// if footer has last modified line hide it (T173545)
#footer-info-lastmod {
display: none;
}
.last-modified-bar {
a,
a:visited {
color: @colorGray5;
// If browser supports
&:nth-child( 2 ) {
font-weight: bold;
}
}
}
.header {
display: table;
width: 100%;
border-spacing: 0;
border-collapse: collapse;
height: @headerHeight;
white-space: nowrap;
// When banners are present we want to easily distinguish between them and the header so add border
border-top: 1px solid @colorGray12;
margin-top: @headerMarginTop;
> div {
width: @headerHeight;
position: relative;
vertical-align: middle;
display: table-cell;
}
// Menu and notifications button
> div a {
display: block;
}
.branding-box {
width: auto;
// TODO: Remove `h1` after T198947 HTML changes expire from cache.
h1,
a {
margin-left: 5px;
font-size: 1em;
text-decoration: none;
color: @colorGray2;
span {
line-height: 1;
font-size: inherit;
}
img {
vertical-align: middle;
}
> * {
float: left;
}
sup {
color: @colorGray5;
display: none;
.beta & {
display: initial;
}
}
}
}
> .header-title {
vertical-align: middle;
}
}
#searchInput {
cursor: text;
}
.search-box,
/* `.header .search-box` is needed to override table-cell rules */
.header .search-box {
display: none;
width: auto;
}
/* Search */
.search-box .search {
@border-width-base: 1px;
@searchIconSize: 18px;
@searchIconGutter: 6px;
@padding-vertical-search: 8px - @border-width-base;
@padding-start-search-icon: @searchIconSize + ( 2 * @searchIconGutter ) - @border-width-base;
background-color: #fff; // Support Fennec, Opera Mini: Remove default background, see T38490.
background-position: left @searchIconGutter center;
background-repeat: no-repeat;
background-size: @searchIconSize;
// Support Safari: Get rid of rounded corners.
-webkit-appearance: none;
width: 100%;
margin-top: 0;
border: @border-width-base solid #fff;
border-radius: @borderRadius;
padding: @padding-vertical-search 0 @padding-vertical-search @padding-start-search-icon;
box-shadow: 0 1px 1px rgba( 0, 0, 0, 0.05 );
// Keyboard focus is taken care of below at `.search-box .search:focus`.
outline: 0;
.transition( ~'border-color 250ms, box-shadow 250ms' );
}
// Provide focus styles only in non-JS and overlay to prevent double transition.
.client-nojs .search-box .search:focus,
.search-overlay .search-box .search:focus {
border-color: @colorProgressive;
box-shadow: inset 0 0 0 1px @colorProgressive, 0 1px 1px rgba( 0, 0, 0, 0.05 );
}
input.search {
// [T139928] Hide all pseudo-elements added to search inputs in WebKit.
&::-webkit-search-decoration,
&::-webkit-search-cancel-button,
&::-webkit-search-results-button,
&::-webkit-search-results-decoration {
display: none;
}
}
.content {
h2 {
// Clear table of contents and any other floated elements in desktop Minerva.
clear: left;
}
.edit-page {
display: block;
font-size: initial;
}
.collapsible-heading .edit-page {
visibility: hidden;
}
.collapsible-heading.open-block {
// Restrict to child so that child section edit links do not get revealed.
.edit-page {
visibility: visible;
}
}
.mw-parser-output > h2,
.section-heading {
border-bottom: 1px solid @colorGray14;
margin-bottom: @headingMargin;
.indicator {
font-size: initial;
margin-left: -@iconGutterWidth;
}
}
.mw-parser-output > h1,
.mw-parser-output > h2,
.mw-parser-output > h3,
.mw-parser-output > h4,
.mw-parser-output > h5,
.section-heading,
.in-block {
// Safari needs this. @see T106347
display: table;
.mw-headline {
width: 100%;
}
> span {
display: table-cell;
vertical-align: middle;
}
}
}
// Toggling indicators are unusable without JavaScript
.client-nojs {
.section-heading .indicator {
display: none;
}
}
#page-secondary-actions {
// Clears floating on table of contents on stub pages.
clear: both;
a {
margin: 10px 2px 2px 0;
}
}
.transparent-shield {
position: absolute;
background: @semiTransparent;
z-index: @z-indexAboveContent;
// don't use display: none because it's not animatable
visibility: hidden;
.transition( opacity 0.25s ease-in-out );
}
// It may be better to express these in a single class
// or think about using extend or a mixin to stay with semantic selectors
// https://css-tricks.com/the-extend-concept/
#bodyContent .panel .content,
.overlay .content-header,
.overlay .panel,
.page-list.side-list .list-thumb,
.page-list li,
.topic-title-list li,
.site-link-list li,
.previewnote p,
.pointer-overlay,
.drawer,
.successbox,
.errorbox,
.list-header,
.warningbox,
.mw-revision {
padding-left: @contentPadding;
padding-right: @contentPadding;
}
.talk-overlay .comment .comment-content,
.backtotop,
.image-list,
.pre-content,
/* Form only pages e.g Special:MobileOptions */
#mw-content-text > form > .oo-ui-fieldLayout > .oo-ui-fieldLayout-body,
/* Save button on Special:MobileOptions */
#mw-content-text > form > .oo-ui-widget,
.content,
.post-content {
margin: 0 @contentMargin;
}
// T217197
.minerva__subtitle {
margin-top: 10px;
margin-bottom: 10px;
&:empty {
margin: 0;
}
}
@media all and ( min-width: @width-breakpoint-tablet ) {
/* FIXME: this should be one generic class name */
/* SpecialMobileEditWatchlist */
.page-summary-list,
/* Talk overlay */
.topic-title-list,
/* structured languages, mobile pagelists */
.site-link-list,
/* overlays */
.overlay .panel,
/* language overlay / MobileSpecialPageFeed */
.list-header {
padding-left: @contentPaddingTablet;
padding-right: @contentPaddingTablet;
}
}