2021-02-02 10:04:37 +00:00
|
|
|
@import '../../common/variables.less';
|
2020-03-30 20:07:35 +00:00
|
|
|
@import 'mediawiki.mixins.less';
|
2021-02-02 10:04:37 +00:00
|
|
|
@import '../layouts/screen.less';
|
|
|
|
@import './checkboxHack.less';
|
2020-05-26 17:38:24 +00:00
|
|
|
|
2022-04-08 22:33:59 +00:00
|
|
|
// T305069 Layout adjustments of sidebar elements:
|
|
|
|
// Vertically align the left edge of sidebar elements with the visible edge of the sidebar toggle hamburger menu.
|
|
|
|
@margin-start-sidebar-content: unit( 12px / @font-size-browser, em ); // 0.75em @ 16
|
2022-06-29 19:28:06 +00:00
|
|
|
// Spacing when the main menu is closed, aligns sidebar TOC aligns with bottom of the page title.
|
2022-04-08 22:33:59 +00:00
|
|
|
@top-margin-sidebar-toc_title_inline: 3.5em;
|
2022-06-29 19:28:06 +00:00
|
|
|
// Default spacing separating the sidebar TOC from the main menu or viewport
|
2022-04-08 22:33:59 +00:00
|
|
|
@top-margin-sidebar-toc: 1.5em;
|
|
|
|
|
2022-02-21 23:21:24 +00:00
|
|
|
.mw-sidebar {
|
2022-05-12 20:17:03 +00:00
|
|
|
box-sizing: border-box;
|
2022-05-03 21:43:34 +00:00
|
|
|
|
|
|
|
// Hide #p-navigation label
|
|
|
|
#p-navigation .vector-menu-heading {
|
|
|
|
display: none;
|
|
|
|
}
|
2022-02-21 23:21:24 +00:00
|
|
|
}
|
|
|
|
|
2022-06-29 19:28:06 +00:00
|
|
|
// FIXME: Delete this selector when .vector-toc-enabled is removed (T310527)
|
|
|
|
body:not( .vector-toc-enabled ) .mw-sidebar {
|
|
|
|
width: @width-grid-column-one;
|
|
|
|
// To avoid the white part of the gradient colliding with the sidebar links
|
|
|
|
// we apply top and bottom padding.
|
|
|
|
padding: 8px 0 40px @padding-left-sidebar;
|
|
|
|
background-image: linear-gradient( to bottom, @background-color-base 0%, @background-color-secondary--modern 10%, @background-color-secondary--modern 90%, @background-color-base 100% );
|
|
|
|
}
|
|
|
|
|
2022-02-21 23:21:24 +00:00
|
|
|
// Update styling when TOC is enabled
|
2022-04-08 22:33:59 +00:00
|
|
|
.vector-toc-enabled {
|
2022-06-29 19:28:06 +00:00
|
|
|
.mw-sidebar,
|
2022-06-30 21:49:34 +00:00
|
|
|
.sidebar-toc,
|
|
|
|
.sidebar-toc:after {
|
|
|
|
// Match styles between TOC and fade element to ensure the fade covers the correct area
|
|
|
|
width: @width-sidebar;
|
2022-06-29 19:28:06 +00:00
|
|
|
margin-left: 0;
|
|
|
|
|
|
|
|
@media ( min-width: @min-width-desktop-wide ) {
|
2022-06-30 21:49:34 +00:00
|
|
|
width: @width-sidebar-wide;
|
2022-06-29 19:28:06 +00:00
|
|
|
margin-left: @margin-start-sidebar-content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-08 22:33:59 +00:00
|
|
|
.mw-sidebar {
|
|
|
|
// Temporary magic number, will be calculated after TOC specs are finalized
|
|
|
|
padding: 12px 19px 12px 9px;
|
|
|
|
background-image: none;
|
|
|
|
background-color: @border-color-sidebar;
|
|
|
|
}
|
|
|
|
|
2022-06-30 22:37:08 +00:00
|
|
|
& .vector-layout-grid {
|
|
|
|
@media ( min-width: @min-width-desktop ) {
|
|
|
|
.mw-sidebar {
|
|
|
|
// Prevent grid row gap from affecting TOC spacing when main menu is open
|
|
|
|
margin-bottom: -@grid-row-gap;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-toc {
|
|
|
|
// Use margin-top to align TOC rather than grid row gap
|
|
|
|
// Applies when the TOC sticky and when the main menu is both open and closed.
|
|
|
|
margin-top: @top-margin-sidebar-toc;
|
|
|
|
}
|
|
|
|
}
|
2022-06-29 19:28:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// FIXME: Merge margin-top styles with above when .vector-toc-enabled is removed (T310527)
|
|
|
|
.sidebar-toc {
|
2022-06-30 22:37:08 +00:00
|
|
|
.vector-toc-enabled .vector-layout-legacy & {
|
|
|
|
// Main menu is closed
|
2022-06-29 19:28:06 +00:00
|
|
|
margin-top: @top-margin-sidebar-toc_title_inline;
|
|
|
|
}
|
|
|
|
|
2022-06-30 22:37:08 +00:00
|
|
|
.vector-toc-enabled .vector-layout-legacy @{selector-workspace-container-sidebar-open} & {
|
2022-06-29 19:28:06 +00:00
|
|
|
// Main menu is open
|
|
|
|
margin-top: @top-margin-sidebar-toc;
|
|
|
|
}
|
2022-05-12 16:29:56 +00:00
|
|
|
|
2022-06-30 22:37:08 +00:00
|
|
|
.vector-toc-enabled.vector-sticky-header-visible .vector-layout-legacy & {
|
2022-06-29 19:28:06 +00:00
|
|
|
// Sticky header is visible
|
2022-04-08 22:33:59 +00:00
|
|
|
margin-top: @top-margin-sidebar-toc;
|
|
|
|
}
|
2022-02-21 23:21:24 +00:00
|
|
|
}
|
|
|
|
|
2020-05-26 17:38:24 +00:00
|
|
|
.mw-sidebar-action {
|
|
|
|
// Align with the portal heading/links
|
|
|
|
// `.portal` + `.portal .body`
|
|
|
|
margin: 8px @margin-end-portal 8px @margin-start-portal + @margin-start-portal-body;
|
|
|
|
|
2021-12-07 20:28:58 +00:00
|
|
|
// Styles for SidebarAction template.
|
|
|
|
.mw-sidebar-action-item {
|
|
|
|
h3.mw-sidebar-action-heading {
|
|
|
|
display: block;
|
|
|
|
background-image: url( ../common/images/portal-separator.png ); // Support: IE 9, Fx 3.6-15, Safari 5.1-6, Chrome 10-25
|
|
|
|
background-image: linear-gradient( to right, @border-color-portal-heading-transparent 0, @border-color-portal-heading 33%, @border-color-portal-heading 66%, @border-color-portal-heading-transparent 100% ); // Standard (Firefox 16+, IE 10+, Safari 6.1+, Chrome 26+)
|
|
|
|
background-position: center bottom;
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-size: 100% @border-width-base;
|
|
|
|
color: @color-base--subtle;
|
|
|
|
margin: 0.75em 0;
|
|
|
|
border: 0;
|
|
|
|
padding: 0.3em 0;
|
|
|
|
font-size: @font-size-nav-main-heading;
|
|
|
|
font-weight: normal;
|
|
|
|
cursor: default;
|
|
|
|
}
|
|
|
|
|
2021-12-10 16:38:51 +00:00
|
|
|
.mw-sidebar-action-content {
|
|
|
|
> * {
|
|
|
|
font-size: @font-size-portal-list-item;
|
|
|
|
}
|
|
|
|
|
|
|
|
> a {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
2021-12-07 20:28:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// T295555 style overrides for temporary language switch alert (can be removed later ).
|
2022-01-27 22:25:30 +00:00
|
|
|
.vector-language-sidebar-alert {
|
2021-12-07 20:28:58 +00:00
|
|
|
padding: 0.75em;
|
|
|
|
}
|
|
|
|
}
|
2020-05-26 17:38:24 +00:00
|
|
|
}
|
2020-03-30 20:07:35 +00:00
|
|
|
|
2020-06-23 02:43:28 +00:00
|
|
|
#mw-sidebar-button {
|
|
|
|
&:before {
|
|
|
|
// Equals `#555`, closest to `#54595d` on background-color `#fff`.
|
|
|
|
opacity: 0.67;
|
2020-08-13 01:19:51 +00:00
|
|
|
/* @embed */
|
2020-08-18 20:43:39 +00:00
|
|
|
background-image: url( images/chevronHorizontal-ltr.svg );
|
2020-08-13 01:19:51 +00:00
|
|
|
|
|
|
|
#mw-sidebar-checkbox:not( :checked ) ~ .mw-header & {
|
|
|
|
/* @embed */
|
2020-08-18 20:43:39 +00:00
|
|
|
background-image: url( images/menu.svg );
|
2020-08-13 01:19:51 +00:00
|
|
|
}
|
2020-03-30 20:07:35 +00:00
|
|
|
}
|
|
|
|
|
2020-06-23 02:43:28 +00:00
|
|
|
&:hover {
|
2020-03-30 20:07:35 +00:00
|
|
|
&:before {
|
2020-06-23 02:43:28 +00:00
|
|
|
opacity: 1;
|
2020-05-29 21:52:36 +00:00
|
|
|
}
|
2020-03-30 20:07:35 +00:00
|
|
|
}
|
2020-06-23 02:43:28 +00:00
|
|
|
}
|
2020-03-30 20:07:35 +00:00
|
|
|
|
2020-06-23 02:43:28 +00:00
|
|
|
// Use the MediaWiki checkbox hack class from checkboxHack.less. This class exists on the
|
|
|
|
// checkbox input for the menu panel.
|
2022-06-29 19:28:06 +00:00
|
|
|
@{selector-workspace-container-sidebar-closed} .mw-sidebar {
|
2020-06-23 02:43:28 +00:00
|
|
|
// Turn off presentation so that screen readers get the same effect as visually hiding.
|
|
|
|
// Visibility and opacity can be animated. If animation is unnecessary, use `display: none`
|
|
|
|
// instead to avoid hidden rendering.
|
|
|
|
visibility: hidden;
|
|
|
|
opacity: 0;
|
2022-05-13 20:34:51 +00:00
|
|
|
transform: translateX( -100% );
|
2020-03-30 20:07:35 +00:00
|
|
|
}
|
|
|
|
|
2022-02-21 23:21:24 +00:00
|
|
|
@media ( min-width: ( @max-width-workspace-container + ( 2 * @padding-horizontal-page-container ) ) ) {
|
|
|
|
.mw-sidebar {
|
|
|
|
background: @background-color-page-container;
|
|
|
|
border-right: 1px solid @border-color-sidebar;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-28 20:19:06 +00:00
|
|
|
// Disable transitions on page load. No-JS users will unfortunately miss out. A similar pattern is
|
|
|
|
// used in Minerva's DropDownList. See enableCssAnimations() in skin.vector.js/index.js for context
|
|
|
|
// and additional details on how this class is added.
|
|
|
|
.vector-animations-ready {
|
Implement Page, Workspace, Content, and Article Toolbar Containers
This patch closely follows the desired guidelines/desired
styles Alex Hollender has put forth in his prototype, but uses
multiple containers to achieve this look since our DOM order/structure
is different than the DOM structure in the prototype. The following
containers are used, but unlike his prototype, they are sometimes used
more than once:
* Page Container: Contains every other container and limits the overall
max-width of the white part of the page.
* Workspace Container: Contains the sidebar and content container. The
sidebar is displaced ~30 pixels to the start (left) of the workspace
container at all times.
* Content Container: Contains the content. The max-width of this changes
depending on whether you are on a special page/history page vs. other
pages.
* Article Toolbar Container: Contains the article toolbar. The max-width
of this is always the same as the max-width of the article content as we
don't want the toolbar to move when going from the article page to the
history/special page.
Changes to be aware:
* To test locally, `$wgVectorLayoutMaxWidth = true;`. This design is
temporarily feature flagged and defaults to being "off".
* Note that layout-max-width.less is a temporary file made to meet the
feature flag requirement of T246420 (intended to derisk the deployment).
After the deploy, we should merge most if not all of the rules into
layout.less where the max-width design will become the default.
* Per Jon's code review comment, I have relaxed the indenting of
skin.mustache to make the diff easier to reason about. If desired, the
correct indenting can be achieved in a (much less risky) follow-up
commit.
Bug: T246420
Bug: T153043
Change-Id: Ie49f629bc705850c6996164a516957476c034048
2020-06-23 18:02:32 +00:00
|
|
|
// Enable transition on all widths by default.
|
2020-05-28 20:19:06 +00:00
|
|
|
.mw-sidebar {
|
2022-05-13 19:41:15 +00:00
|
|
|
transition-property: transform, opacity, visibility;
|
|
|
|
transition-duration: @transition-duration-base;
|
|
|
|
transition-timing-function: ease-out;
|
2020-05-28 20:19:06 +00:00
|
|
|
}
|
|
|
|
|
2022-06-23 21:33:47 +00:00
|
|
|
@media ( max-width: @max-width-mobile ) {
|
2020-10-01 22:55:52 +00:00
|
|
|
.mw-sidebar {
|
|
|
|
transition: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-28 20:19:06 +00:00
|
|
|
// Enable sidebar button transitions.
|
2020-06-23 02:43:28 +00:00
|
|
|
#mw-sidebar-button {
|
2022-05-13 19:41:15 +00:00
|
|
|
transition-property: background-color, border-color, box-shadow;
|
|
|
|
transition-duration: @transition-duration-base;
|
2020-03-30 20:07:35 +00:00
|
|
|
}
|
|
|
|
}
|