mediawiki-skins-MinervaNeue/resources/skins.minerva.base.styles/pageactions.less
Jan Drewniak d153d78f46 Ensure page-actions icons are display:block
The technique used to hide the text in the .wm-ui-icon-element
(i.e. negative text-indent) depends on the icon container being
display block. This ensures that it is.

Bug: T218182
Change-Id: If68099c63023f878128dcedda38963f617a5c717
2019-03-13 22:09:39 +00:00

176 lines
3.9 KiB
Plaintext

@import '../../minerva.less/minerva.variables';
@import '../../minerva.less/minerva.mixins';
.heading-holder {
padding: @titleSectionSpacingTop 0 0;
position: relative;
.tagline {
color: @colorGray5;
font-size: @taglineFontSize;
}
}
.page-heading {
margin-bottom: 12px;
}
// used to disable the languages icon.
.mw-ui-icon-element.disabled {
cursor: default;
opacity: 0.25;
}
.page-actions-menu {
box-sizing: border-box;
border-top: 1px solid @colorGray14;
border-bottom: 1px solid @colorGray12;
}
.page-actions-menu__list {
display: flex;
justify-content: space-between;
height: 44px; // total height is 46px. 2px added by border on .page-actions-menu
}
.page-actions-menu__list-item {
position: relative;
display: flex;
flex-basis: 4em;
justify-content: flex-end;
align-items: center;
// overriding default icon styles
.mw-ui-icon-element {
// The page actions menu icons are ever so slightly larger
// than standard icons.
@pageActionsIconSize: @iconSize + 0.15;
// explicitly added to ensure this element (which is an anchor) receives width/height
// when it's viewed in services that manipulate DOM such as Google Translate.
display: block;
position: relative;
min-width: @pageActionsIconSize;
width: @pageActionsIconSize;
height: @pageActionsIconSize;
&:hover {
box-shadow: none;
}
&:before {
margin: 0;
// `.mw-ui-icon` absolutely positions this pseudo-element but only
// positions right & left. This ensures icon stretches 100% height and
// stretches the entire height of its parent element.
top: 0;
bottom: 0;
}
}
}
// Layout for less than 5 items - one item at the beginning, rest at the end.
// |1-----2--3--4|
.page-actions-menu__list-item:first-child {
flex-grow: 1;
justify-content: flex-start;
}
// overriding common.less `display:inherit` (which causes `display: flex;` in this instance).
.client-js .jsonly#ca-watch {
display: list-item;
}
// TODO: T213352 Delete this nested block after varnish cache has cleared and selectors
// no longer apply.
#page-actions:not( .page-actions-menu__list ) {
font-size: @pageActionFontSize;
float: none;
border: 0;
overflow: hidden;
width: 100%;
margin-top: -2px;
border-top: @pageActionBorder solid @colorGray14;
border-bottom: @pageActionBorder solid @colorGray12;
padding: 0.5em 0;
li {
display: inline-block;
// Needed for non-JavaScript users
position: relative;
cursor: pointer;
// Override .hlist rule.
margin-right: 0;
margin-bottom: 0;
float: right;
// edit, language and watchstar
a {
// Needed for non-JavaScript users
position: absolute;
display: block;
width: 100%;
height: 100%;
// needed for ContentOverlay pointer arrow
margin: 0 0 8px;
cursor: pointer;
}
&:first-child {
margin-top: 0;
}
}
.language-selector {
float: left;
margin-left: -@iconGutterWidth;
&.disabled {
cursor: default;
opacity: 0.25;
}
}
#ca-edit {
margin-right: -@iconGutterWidth;
}
}
// FIXME: cached HTML. Can be removed when work on T212216
// has been deployed and varnish cache cleared.
.heading-holder #page-actions:not( .page-actions-menu__list ):first-child {
position: absolute;
bottom: 0;
}
// Watchstar is hidden for anonymous no-js users
// While we could link the icon to the login/signup form, this is not
// a perfect experience and could be confusing.
// In JavaScript this icon will be converted to a watch icon and will point
// to a Call to action to sign up/login and explain why that's a good idea.
// Thus, anonymous users without JS will never see this icon.
// This is a small % of our users, so deemed okay.
.client-nojs {
.watch-this-article {
visibility: hidden;
}
.is-authenticated {
.watch-this-article {
visibility: visible;
}
}
}
// On small devices that don't support Javascript, hide the page actions bar
@media all and ( max-width: @width-breakpoint-mobile - 1 ) {
.client-nojs {
#page-actions {
display: none;
}
#section_0 {
border: 0;
}
}
}