mediawiki-skins-Vector/components/tabs.less
Timo Tijhof feca6b276b Remove unused margin/padding override for '#mw-head h3'
Matches the following 6 elements:

1. h3#p-personal-label
   Hidden per `#p-personal h3`.

2. h3#p-namespaces-label
3. h3#p-views-label
   Hidden per `div.vectorTabs h3`.

4. #p-search h3
   Already has its own margin and padding that override
   this override.

5. h3#p-variants-label
6. h3#p-cactions-label
   Margin overriden by `div#mw-head div.vectorMenu h3`.
   Moved padding there as well.

This last one is the one the styles were originally intended for,
because the tabs that the menus align with also don't have padding.

The other instances of an 'h3' within mw-head, however, were not
vector menus and even if they didn't have their own padding
already or weren't display-none, then it's unlikely they would
want to align with the unrelated vectorMenu styles, e.g. the
p-personal area is quite different and just happens to be in
the same parent element as an h3.

Change-Id: Id127ead7a50fcd64821442afd0e781f97756502f
2018-05-31 10:23:30 +00:00

259 lines
5.1 KiB
Plaintext

/**
* Styling for namespace tabs (page, discussion) and views (read, edit, view history, watch and other actions)
*/
/* Navigation Labels */
.vectorTabs h3 {
display: none;
}
/* Namespaces and Views */
.vectorTabs {
float: left;
height: 2.5em;
.background-image('images/tab-break.png');
background-position: bottom left;
background-repeat: no-repeat;
padding-left: 1px;
ul {
float: left;
height: 100%;
list-style-type: none;
list-style-image: none;
margin: 0;
padding: 0;
.background-image('images/tab-break.png');
background-position: right bottom;
background-repeat: no-repeat;
li {
float: left;
line-height: 1.125em;
display: block;
height: 100%;
margin: 0;
padding: 0;
.background-image('images/tab-normal-fade.png');
background-position: bottom left;
background-repeat: repeat-x;
white-space: nowrap;
}
}
li {
&.new {
a,
a:visited {
color: #a55858;
}
}
&.selected {
.background-image('images/tab-current-fade.png');
a,
a:visited {
color: #222;
text-decoration: none;
}
}
&.icon {
a {
background-position: bottom right;
background-repeat: no-repeat;
}
}
a {
display: block;
height: 1.9em;
padding-left: 0.615em; // equals `8px` at computed `font-size` of `13px` below
padding-right: 0.615em;
color: @menu-link-color;
cursor: pointer;
font-size: 0.8125em; // equals `13px` at browser default of `16px`
}
}
span {
display: inline-block;
.background-image('images/tab-break.png');
background-position: bottom right;
background-repeat: no-repeat;
height: 100%;
a {
float: left;
display: block;
padding-top: 1.25em;
}
}
}
/* Variants and Actions */
.vectorMenu {
direction: ltr;
float: left;
cursor: pointer;
position: relative;
line-height: 1.125em;
}
#mw-head .vectorMenu h3 {
float: left;
.background-image('images/tab-break.png');
background-repeat: no-repeat;
background-position: bottom right;
font-size: 1em;
height: 2.5em;
// `padding-right` >= `1px` effectively moves the "background border" outside of the element to
// act like a real border. It is necessary for `.vectorMenu .menu` dropdown to align well.
// 0.5em equals `8px` at computed `font-size` of `14px` as visually harmonically with
// `padding-left` in `.vectorMenu h3 span`
padding: 0 0.5em 0 0;
margin: 0 -1px 0 0;
}
.vectorMenu h3 {
span {
position: relative;
display: block;
font-size: 0.8125em;
padding-left: 0.615em;
padding-top: 1.25em;
padding-right: 16px;
font-weight: normal;
color: #444;
&:after {
content: '';
position: absolute;
top: 1.25em;
right: 0;
bottom: 0;
left: 0;
.background-image-svg('images/arrow-down.svg', 'images/arrow-down.png');
background-position: 100% 50%;
background-repeat: no-repeat;
// Modify the color of the image from the default #222 to approx. #444 to match the text.
opacity: 0.85;
}
}
&:hover span,
&:focus span {
color: @content-font-color;
&:after {
opacity: 1;
}
}
}
.vectorMenu .vectorMenuCheckbox:checked + h3 span:after {
transform: scaleY( -1 );
}
.vectorMenu .vectorMenuCheckbox:focus + h3 {
// Simulate browser focus ring
outline: dotted 1px; // Firefox style
outline: auto -webkit-focus-ring-color; // Webkit style
}
.vectorMenu .menu {
// Match the width of the dropdown "heading" (the tab)
min-width: 100%;
position: absolute;
top: 2.5em;
left: -1px;
background-color: @body-background-color;
border: 1px solid #a2a9b1;
border-top-width: 0;
clear: both;
box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
text-align: left;
display: none;
// Menus must overlap indicators (z-index: 1) and VisualEditor toolbar (z-index: 2)
z-index: 2;
}
.vectorMenu:hover .menu {
display: block;
}
// This is in a separate block, so that browsers supporting :hover but not :checked still apply the rule above
// Support: IE8
.vectorMenu .vectorMenuCheckbox:checked ~ .menu {
display: block;
}
.vectorMenu ul {
list-style-type: none;
list-style-image: none;
padding: 0;
margin: 0;
text-align: left;
}
// stylelint-disable selector-no-vendor-prefix, selector-type-no-unknown
/* Fixes old versions of FireFox */
.vectorMenu ul,
x:-moz-any-link {
min-width: 5em;
}
/* Returns things back to normal in modern versions of FireFox */
.vectorMenu ul,
x:-moz-any-link,
x:default {
min-width: 0;
}
// stylelint-enable selector-no-vendor-prefix, selector-type-no-unknown
.vectorMenu li {
padding: 0;
margin: 0;
text-align: left;
line-height: 1em;
}
.vectorMenu li a {
display: block;
padding: 0.625em;
white-space: nowrap;
color: @menu-link-color;
cursor: pointer;
font-size: 0.8125em;
}
.vectorMenu li.selected a,
.vectorMenu li.selected a:visited {
color: #222;
text-decoration: none;
}
// Invisible checkbox covering the dropdown menu handle
.vectorMenuCheckbox {
cursor: pointer;
position: absolute;
top: 0;
left: 0;
z-index: 1;
opacity: 0;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
// Hide the checkbox completely in browsers that don't support :checked
display: none;
}
:not( :checked ) > .vectorMenuCheckbox {
// When the browser supports :checked, display it
display: block;
}
@import 'watchstar.less';