Vector-Local/resources/skins.vector.styles/components/MenuTabs.less

95 lines
2.6 KiB
Plaintext
Raw Normal View History

@import '../../common/variables.less';
@import 'mediawiki.mixins.less';
/**
* Styling for namespace tabs (page, discussion) and views (read, edit, view history, watch and other actions)
*/
Refactor Vector tabs layout for reduced size & complexity Fix for iOS Safari 13 & 14 (T309223): - Replaces flex-box layout from the top-level #right-navigation and #left-navigation tab elements with floats. Then for vertical alignment, sets the child <li> elements and <a> elements to inline block. Opportunistic refactor (T308344): - Moves the font-size rules to top-level #left/right-navigation, but leaving them as-is for legacy Vector. - Removes a (seemingly) unnecessary `display:none` rule from Vector 2022, which previously applied to H3 labels in the sidebar, which are no longer targeted by the styles in MenuTabs.less. - Removes an unnecessary selector and duplicated rules from ArticleToolbar.less This change fixes a flexbox issue on iOS Safari 13 & 14, but also reduces the CSS bytesize of the skins.vector.styles module by 0.9kB (uncompressed), from 54.2kB in the previous commit to 53.3kB with this commit. Expected visual changes: * The tab underline now overlaps with the toolbar underline, and text pushed down on certain tabs * The variant tab is now equally spaced * Right navigation tabs slightly shifted to the right Unexpected visual changes: * More menu shifts to the left [see note at top of commit, will be fixed in a follow up] NOTE: this introduces a visual regression in the mobile viewport in that the more menu. Given this viewport is still experimental, after talking to Jan we agreed to address this in a follow-up. NOTE: Update addresses the reason for revert 5599cf2 and compatibility with CSS Grid layout by adding a clearfix (display:flow-root) for #right-navigation and #left-navigation elements inside toolbar. Bug: T309223 Bug: T308344 Bug: T312212 Change-Id: I1482a81d16c53e0ba1977b0d98ba8c8a21362a6c
2022-07-04 18:05:03 +00:00
/* Tab list items */
.vector-menu-tabs {
float: left;
// T316574 Override visited link styles
.mw-list-item a {
color: @color-link;
}
Refactor Vector tabs layout for reduced size & complexity Fix for iOS Safari 13 & 14 (T309223): - Replaces flex-box layout from the top-level #right-navigation and #left-navigation tab elements with floats. Then for vertical alignment, sets the child <li> elements and <a> elements to inline block. Opportunistic refactor (T308344): - Moves the font-size rules to top-level #left/right-navigation, but leaving them as-is for legacy Vector. - Removes a (seemingly) unnecessary `display:none` rule from Vector 2022, which previously applied to H3 labels in the sidebar, which are no longer targeted by the styles in MenuTabs.less. - Removes an unnecessary selector and duplicated rules from ArticleToolbar.less This change fixes a flexbox issue on iOS Safari 13 & 14, but also reduces the CSS bytesize of the skins.vector.styles module by 0.9kB (uncompressed), from 54.2kB in the previous commit to 53.3kB with this commit. Expected visual changes: * The tab underline now overlaps with the toolbar underline, and text pushed down on certain tabs * The variant tab is now equally spaced * Right navigation tabs slightly shifted to the right Unexpected visual changes: * More menu shifts to the left [see note at top of commit, will be fixed in a follow up] NOTE: this introduces a visual regression in the mobile viewport in that the more menu. Given this viewport is still experimental, after talking to Jan we agreed to address this in a follow-up. NOTE: Update addresses the reason for revert 5599cf2 and compatibility with CSS Grid layout by adding a clearfix (display:flow-root) for #right-navigation and #left-navigation elements inside toolbar. Bug: T309223 Bug: T308344 Bug: T312212 Change-Id: I1482a81d16c53e0ba1977b0d98ba8c8a21362a6c
2022-07-04 18:05:03 +00:00
/* focus and hover have outlines. Text underline interferes with bottom border */
.mw-list-item.vector-tab-noicon a:focus,
.mw-list-item.vector-tab-noicon a:hover {
Refactor Vector tabs layout for reduced size & complexity Fix for iOS Safari 13 & 14 (T309223): - Replaces flex-box layout from the top-level #right-navigation and #left-navigation tab elements with floats. Then for vertical alignment, sets the child <li> elements and <a> elements to inline block. Opportunistic refactor (T308344): - Moves the font-size rules to top-level #left/right-navigation, but leaving them as-is for legacy Vector. - Removes a (seemingly) unnecessary `display:none` rule from Vector 2022, which previously applied to H3 labels in the sidebar, which are no longer targeted by the styles in MenuTabs.less. - Removes an unnecessary selector and duplicated rules from ArticleToolbar.less This change fixes a flexbox issue on iOS Safari 13 & 14, but also reduces the CSS bytesize of the skins.vector.styles module by 0.9kB (uncompressed), from 54.2kB in the previous commit to 53.3kB with this commit. Expected visual changes: * The tab underline now overlaps with the toolbar underline, and text pushed down on certain tabs * The variant tab is now equally spaced * Right navigation tabs slightly shifted to the right Unexpected visual changes: * More menu shifts to the left [see note at top of commit, will be fixed in a follow up] NOTE: this introduces a visual regression in the mobile viewport in that the more menu. Given this viewport is still experimental, after talking to Jan we agreed to address this in a follow-up. NOTE: Update addresses the reason for revert 5599cf2 and compatibility with CSS Grid layout by adding a clearfix (display:flow-root) for #right-navigation and #left-navigation elements inside toolbar. Bug: T309223 Bug: T308344 Bug: T312212 Change-Id: I1482a81d16c53e0ba1977b0d98ba8c8a21362a6c
2022-07-04 18:05:03 +00:00
text-decoration: none;
border-bottom: @border-width-base @border-style-base;
}
.mw-list-item.new a,
.mw-list-item.new a:visited {
Refactor Vector tabs layout for reduced size & complexity Fix for iOS Safari 13 & 14 (T309223): - Replaces flex-box layout from the top-level #right-navigation and #left-navigation tab elements with floats. Then for vertical alignment, sets the child <li> elements and <a> elements to inline block. Opportunistic refactor (T308344): - Moves the font-size rules to top-level #left/right-navigation, but leaving them as-is for legacy Vector. - Removes a (seemingly) unnecessary `display:none` rule from Vector 2022, which previously applied to H3 labels in the sidebar, which are no longer targeted by the styles in MenuTabs.less. - Removes an unnecessary selector and duplicated rules from ArticleToolbar.less This change fixes a flexbox issue on iOS Safari 13 & 14, but also reduces the CSS bytesize of the skins.vector.styles module by 0.9kB (uncompressed), from 54.2kB in the previous commit to 53.3kB with this commit. Expected visual changes: * The tab underline now overlaps with the toolbar underline, and text pushed down on certain tabs * The variant tab is now equally spaced * Right navigation tabs slightly shifted to the right Unexpected visual changes: * More menu shifts to the left [see note at top of commit, will be fixed in a follow up] NOTE: this introduces a visual regression in the mobile viewport in that the more menu. Given this viewport is still experimental, after talking to Jan we agreed to address this in a follow-up. NOTE: Update addresses the reason for revert 5599cf2 and compatibility with CSS Grid layout by adding a clearfix (display:flow-root) for #right-navigation and #left-navigation elements inside toolbar. Bug: T309223 Bug: T308344 Bug: T312212 Change-Id: I1482a81d16c53e0ba1977b0d98ba8c8a21362a6c
2022-07-04 18:05:03 +00:00
color: @color-link-new;
}
.mw-list-item.selected a,
.mw-list-item.selected a:visited {
Refactor Vector tabs layout for reduced size & complexity Fix for iOS Safari 13 & 14 (T309223): - Replaces flex-box layout from the top-level #right-navigation and #left-navigation tab elements with floats. Then for vertical alignment, sets the child <li> elements and <a> elements to inline block. Opportunistic refactor (T308344): - Moves the font-size rules to top-level #left/right-navigation, but leaving them as-is for legacy Vector. - Removes a (seemingly) unnecessary `display:none` rule from Vector 2022, which previously applied to H3 labels in the sidebar, which are no longer targeted by the styles in MenuTabs.less. - Removes an unnecessary selector and duplicated rules from ArticleToolbar.less This change fixes a flexbox issue on iOS Safari 13 & 14, but also reduces the CSS bytesize of the skins.vector.styles module by 0.9kB (uncompressed), from 54.2kB in the previous commit to 53.3kB with this commit. Expected visual changes: * The tab underline now overlaps with the toolbar underline, and text pushed down on certain tabs * The variant tab is now equally spaced * Right navigation tabs slightly shifted to the right Unexpected visual changes: * More menu shifts to the left [see note at top of commit, will be fixed in a follow up] NOTE: this introduces a visual regression in the mobile viewport in that the more menu. Given this viewport is still experimental, after talking to Jan we agreed to address this in a follow-up. NOTE: Update addresses the reason for revert 5599cf2 and compatibility with CSS Grid layout by adding a clearfix (display:flow-root) for #right-navigation and #left-navigation elements inside toolbar. Bug: T309223 Bug: T308344 Bug: T312212 Change-Id: I1482a81d16c53e0ba1977b0d98ba8c8a21362a6c
2022-07-04 18:05:03 +00:00
color: @color-link-selected;
border-bottom: @border-width-base @border-style-base;
}
}
Refactor Vector tabs layout for reduced size & complexity Fix for iOS Safari 13 & 14 (T309223): - Replaces flex-box layout from the top-level #right-navigation and #left-navigation tab elements with floats. Then for vertical alignment, sets the child <li> elements and <a> elements to inline block. Opportunistic refactor (T308344): - Moves the font-size rules to top-level #left/right-navigation, but leaving them as-is for legacy Vector. - Removes a (seemingly) unnecessary `display:none` rule from Vector 2022, which previously applied to H3 labels in the sidebar, which are no longer targeted by the styles in MenuTabs.less. - Removes an unnecessary selector and duplicated rules from ArticleToolbar.less This change fixes a flexbox issue on iOS Safari 13 & 14, but also reduces the CSS bytesize of the skins.vector.styles module by 0.9kB (uncompressed), from 54.2kB in the previous commit to 53.3kB with this commit. Expected visual changes: * The tab underline now overlaps with the toolbar underline, and text pushed down on certain tabs * The variant tab is now equally spaced * Right navigation tabs slightly shifted to the right Unexpected visual changes: * More menu shifts to the left [see note at top of commit, will be fixed in a follow up] NOTE: this introduces a visual regression in the mobile viewport in that the more menu. Given this viewport is still experimental, after talking to Jan we agreed to address this in a follow-up. NOTE: Update addresses the reason for revert 5599cf2 and compatibility with CSS Grid layout by adding a clearfix (display:flow-root) for #right-navigation and #left-navigation elements inside toolbar. Bug: T309223 Bug: T308344 Bug: T312212 Change-Id: I1482a81d16c53e0ba1977b0d98ba8c8a21362a6c
2022-07-04 18:05:03 +00:00
/**
* Tab list item appearance. Applies to both <li>'s inside .vector-menu-tabs
* and dropdown menus inside the article toolbar
*/
.vector-menu-tabs .mw-list-item.vector-tab-noicon,
.mw-article-toolbar-container .vector-menu-dropdown {
margin: 0 @padding-horizontal-tabs;
}
.vector-menu-tabs .mw-list-item,
.mw-article-toolbar-container .vector-menu-dropdown {
float: left;
white-space: nowrap;
margin-bottom: 0; /* overrides default `li` styling */
// target links inside of .vector-tab-menu
// and dropdown menu headings inside the article toolbar.
// NOTE: Consider adding a single selector to define both items,
// since they both appear beside each other in the article toolbar.
& > a,
.vector-menu-heading {
display: inline-flex;
position: relative;
cursor: pointer;
// max-height & box-sizing to make link, watchstar & dropdown height consistent.
// NOTE: Was 40px instead of 41, but changed to avoid visual regressions.
max-height: unit( 41 / @font-size-tabs / @font-size-browser, em );
box-sizing: border-box;
font-weight: normal;
}
.vector-menu-heading {
// For better compatibility with gadgets (like Twinkle) that append
// <H3> elements as dropdown headings (which was the convention in legacy Vector).
font-size: inherit;
}
&.vector-tab-noicon > a,
.vector-menu-heading {
// Top & bottom padding to increase clickable area.
padding: 18px 0 7px 0;
// bottom margin to overlap border with toolbar border.
margin-bottom: -1px;
}
}
// With mw-ui-icons, expand watchstar and wikilove links it to cover full touch area
.vector-feature-visual-enhancement-next-enabled {
.vector-menu-tabs {
.mw-list-item {
.mw-ui-icon {
// Align small icons with the bottom of the tabs.
// Height of tab is 41px, and small icon is 36px,
// With 1px border, 41 - 36 + 1;
margin: 4px 0 0 0;
}
}
}
Refactor Vector tabs layout for reduced size & complexity Fix for iOS Safari 13 & 14 (T309223): - Replaces flex-box layout from the top-level #right-navigation and #left-navigation tab elements with floats. Then for vertical alignment, sets the child <li> elements and <a> elements to inline block. Opportunistic refactor (T308344): - Moves the font-size rules to top-level #left/right-navigation, but leaving them as-is for legacy Vector. - Removes a (seemingly) unnecessary `display:none` rule from Vector 2022, which previously applied to H3 labels in the sidebar, which are no longer targeted by the styles in MenuTabs.less. - Removes an unnecessary selector and duplicated rules from ArticleToolbar.less This change fixes a flexbox issue on iOS Safari 13 & 14, but also reduces the CSS bytesize of the skins.vector.styles module by 0.9kB (uncompressed), from 54.2kB in the previous commit to 53.3kB with this commit. Expected visual changes: * The tab underline now overlaps with the toolbar underline, and text pushed down on certain tabs * The variant tab is now equally spaced * Right navigation tabs slightly shifted to the right Unexpected visual changes: * More menu shifts to the left [see note at top of commit, will be fixed in a follow up] NOTE: this introduces a visual regression in the mobile viewport in that the more menu. Given this viewport is still experimental, after talking to Jan we agreed to address this in a follow-up. NOTE: Update addresses the reason for revert 5599cf2 and compatibility with CSS Grid layout by adding a clearfix (display:flow-root) for #right-navigation and #left-navigation elements inside toolbar. Bug: T309223 Bug: T308344 Bug: T312212 Change-Id: I1482a81d16c53e0ba1977b0d98ba8c8a21362a6c
2022-07-04 18:05:03 +00:00
}