From 5e15edb9a2d05f775e3c11d7059639cd9182368e Mon Sep 17 00:00:00 2001 From: bwang Date: Mon, 2 Oct 2023 12:52:33 -0500 Subject: [PATCH] Remove unnecessary imports in component stylesheets, make variable and mixin imports consistent Bug: T345766 Change-Id: I2ae1d1668849a04520b73ac04fe16e1ff7f22fa6 --- resources/common/common.less | 2 +- resources/common/components/Footer.less | 2 -- resources/common/components/Indicators.less | 2 -- resources/common/components/SidebarLogo.less | 2 -- resources/common/components/SiteNotice.less | 2 -- resources/common/mixins.less | 2 +- .../skins.vector.styles.legacy/components/LegacySidebar.less | 3 --- .../skins.vector.styles.legacy/components/MenuDropdown.less | 4 ---- .../skins.vector.styles.legacy/components/MenuTabs.less | 3 --- .../skins.vector.styles.legacy/components/SearchBox.less | 2 -- .../components/TabWatchstarLink.less | 2 -- .../skins.vector.styles.legacy/components/UserLinks.less | 2 -- resources/skins.vector.styles.legacy/skin-legacy.less | 2 ++ resources/skins.vector.styles/components/BottomDock.less | 2 -- resources/skins.vector.styles/components/Button.less | 4 ---- resources/skins.vector.styles/components/Dropdown.less | 4 ---- resources/skins.vector.styles/components/Header.less | 4 ---- resources/skins.vector.styles/components/Icon.less | 3 --- .../skins.vector.styles/components/LanguageDropdown.less | 5 ----- resources/skins.vector.styles/components/Logo.less | 3 --- resources/skins.vector.styles/components/MainMenu.less | 4 ---- resources/skins.vector.styles/components/MenuTabs.less | 3 --- resources/skins.vector.styles/components/PageTitlebar.less | 2 -- resources/skins.vector.styles/components/PageToolbar.less | 3 --- resources/skins.vector.styles/components/PageTools.less | 3 --- .../skins.vector.styles/components/PinnableElement.less | 2 -- resources/skins.vector.styles/components/SearchBox.less | 2 -- resources/skins.vector.styles/components/StickyHeader.less | 4 ---- .../skins.vector.styles/components/TableOfContents.less | 2 -- resources/skins.vector.styles/components/UserLinks.less | 4 ---- resources/skins.vector.styles/components/Watchstar.less | 2 -- resources/skins.vector.styles/layouts/preZebra.less | 2 -- resources/skins.vector.styles/skin.less | 2 -- resources/skins.vector.zebra.styles/mixins.less | 1 + resources/skins.vector.zebra.styles/skin.less | 1 - 35 files changed, 5 insertions(+), 87 deletions(-) diff --git a/resources/common/common.less b/resources/common/common.less index 781868a9d..e1e683ce0 100644 --- a/resources/common/common.less +++ b/resources/common/common.less @@ -4,7 +4,7 @@ */ @import './variables.less'; -@import 'mediawiki.mixins.less'; +@import './mixins.less'; @media screen { // Common styles diff --git a/resources/common/components/Footer.less b/resources/common/components/Footer.less index 1002111f9..7fc4cdbfb 100644 --- a/resources/common/components/Footer.less +++ b/resources/common/components/Footer.less @@ -1,5 +1,3 @@ -@import '../variables.less'; - /* Footer */ .mw-footer { direction: ltr; diff --git a/resources/common/components/Indicators.less b/resources/common/components/Indicators.less index ed85f9d63..9f093ada9 100644 --- a/resources/common/components/Indicators.less +++ b/resources/common/components/Indicators.less @@ -1,5 +1,3 @@ -@import '../variables.less'; - .mw-indicators { font-size: @font-size-base; line-height: @line-height-base; diff --git a/resources/common/components/SidebarLogo.less b/resources/common/components/SidebarLogo.less index 98a04db8e..45b5d10cf 100644 --- a/resources/common/components/SidebarLogo.less +++ b/resources/common/components/SidebarLogo.less @@ -1,5 +1,3 @@ -@import '../variables.less'; - /* Logo */ #p-logo { width: 10em; diff --git a/resources/common/components/SiteNotice.less b/resources/common/components/SiteNotice.less index 428556a81..3edac1270 100644 --- a/resources/common/components/SiteNotice.less +++ b/resources/common/components/SiteNotice.less @@ -1,5 +1,3 @@ -@import '../variables.less'; - /** element that wraps a notice that comes from wiki page */ #localNotice { margin-bottom: 0.9em; diff --git a/resources/common/mixins.less b/resources/common/mixins.less index 2058e3217..d30c6b154 100644 --- a/resources/common/mixins.less +++ b/resources/common/mixins.less @@ -2,7 +2,7 @@ * Less mixins shared between both legacy and Vector 2022. */ -@import '../common/variables.less'; +@import 'mediawiki.mixins.less'; .mixin-vector-menu-heading() { align-self: center; diff --git a/resources/skins.vector.styles.legacy/components/LegacySidebar.less b/resources/skins.vector.styles.legacy/components/LegacySidebar.less index b75985e96..db36275af 100644 --- a/resources/skins.vector.styles.legacy/components/LegacySidebar.less +++ b/resources/skins.vector.styles.legacy/components/LegacySidebar.less @@ -1,6 +1,3 @@ -@import '../../common/variables.less'; -@import 'mediawiki.mixins.less'; - // Navigation: Main @font-size-nav-main: inherit; @font-size-nav-main-heading: unit( 12 / @font-size-browser, em ); // Equals `0.75em`. diff --git a/resources/skins.vector.styles.legacy/components/MenuDropdown.less b/resources/skins.vector.styles.legacy/components/MenuDropdown.less index c89378ea4..cc8e29ead 100644 --- a/resources/skins.vector.styles.legacy/components/MenuDropdown.less +++ b/resources/skins.vector.styles.legacy/components/MenuDropdown.less @@ -1,7 +1,3 @@ -@import '../../common/variables.less'; -@import 'mediawiki.mixins.less'; -@import '../../common/mixins.less'; - // Flips the chevron so it points up when the dropdown is open. .vector-menu-checkbox:checked + .vector-menu-heading::after { transform: scaleY( -1 ); diff --git a/resources/skins.vector.styles.legacy/components/MenuTabs.less b/resources/skins.vector.styles.legacy/components/MenuTabs.less index f779de6d5..d1a8f31ef 100644 --- a/resources/skins.vector.styles.legacy/components/MenuTabs.less +++ b/resources/skins.vector.styles.legacy/components/MenuTabs.less @@ -1,6 +1,3 @@ -@import '../../common/variables.less'; -@import 'mediawiki.mixins.less'; - /** * Styling for namespace tabs (page, discussion) and views (read, edit, view history, watch and other actions) */ diff --git a/resources/skins.vector.styles.legacy/components/SearchBox.less b/resources/skins.vector.styles.legacy/components/SearchBox.less index e12fa1354..c2296e490 100644 --- a/resources/skins.vector.styles.legacy/components/SearchBox.less +++ b/resources/skins.vector.styles.legacy/components/SearchBox.less @@ -1,5 +1,3 @@ -@import 'mediawiki.mixins.less'; - // Defined as `div`. // Provide extra element for gadgets due to `form` already carrying an `id`. .vector-search-box-inner { diff --git a/resources/skins.vector.styles.legacy/components/TabWatchstarLink.less b/resources/skins.vector.styles.legacy/components/TabWatchstarLink.less index 8efcdd10c..76caf3565 100644 --- a/resources/skins.vector.styles.legacy/components/TabWatchstarLink.less +++ b/resources/skins.vector.styles.legacy/components/TabWatchstarLink.less @@ -1,5 +1,3 @@ -@import '../../common/variables.less'; -@import 'mediawiki.mixins.less'; @import 'mediawiki.mixins.rotation.less'; /* Watch/Unwatch Icon Styling */ diff --git a/resources/skins.vector.styles.legacy/components/UserLinks.less b/resources/skins.vector.styles.legacy/components/UserLinks.less index af5a6a59d..24aa784d2 100644 --- a/resources/skins.vector.styles.legacy/components/UserLinks.less +++ b/resources/skins.vector.styles.legacy/components/UserLinks.less @@ -1,5 +1,3 @@ -@import '../../common/variables.less'; - /* Personal Menu */ .vector-user-menu-legacy { li { diff --git a/resources/skins.vector.styles.legacy/skin-legacy.less b/resources/skins.vector.styles.legacy/skin-legacy.less index 3427a753a..1539bc455 100644 --- a/resources/skins.vector.styles.legacy/skin-legacy.less +++ b/resources/skins.vector.styles.legacy/skin-legacy.less @@ -2,6 +2,8 @@ * Vector legacy stylesheets * See '../common/common.less' for common screen and print Vector stylesheets. */ +@import '../common/variables.less'; +@import '../common/mixins.less'; @media screen { // Layouts diff --git a/resources/skins.vector.styles/components/BottomDock.less b/resources/skins.vector.styles/components/BottomDock.less index 31c8c396a..5f0bbdd86 100644 --- a/resources/skins.vector.styles/components/BottomDock.less +++ b/resources/skins.vector.styles/components/BottomDock.less @@ -1,5 +1,3 @@ -@import '../../common/variables.less'; - .client-nojs .vector-settings { display: none; } diff --git a/resources/skins.vector.styles/components/Button.less b/resources/skins.vector.styles/components/Button.less index c6b053823..4df971b10 100644 --- a/resources/skins.vector.styles/components/Button.less +++ b/resources/skins.vector.styles/components/Button.less @@ -1,7 +1,3 @@ -@import '../../common/variables.less'; -@import 'mediawiki.mixins.less'; -@import 'mediawiki.skin.variables.less'; - .cdx-button:not( .cdx-button--icon-only ) .vector-icon { // Add spacing between icon and text margin-right: @spacing-35; diff --git a/resources/skins.vector.styles/components/Dropdown.less b/resources/skins.vector.styles/components/Dropdown.less index a5fc4959c..ceaff6d09 100644 --- a/resources/skins.vector.styles/components/Dropdown.less +++ b/resources/skins.vector.styles/components/Dropdown.less @@ -1,7 +1,3 @@ -@import '../../common/variables.less'; -@import '../../common/mixins.less'; -@import 'mediawiki.mixins.less'; - /** * Dropdown container */ diff --git a/resources/skins.vector.styles/components/Header.less b/resources/skins.vector.styles/components/Header.less index 014d11eae..785e973de 100644 --- a/resources/skins.vector.styles/components/Header.less +++ b/resources/skins.vector.styles/components/Header.less @@ -1,7 +1,3 @@ -@import '../../common/variables.less'; -@import '../../common/mixins.less'; -@import 'mediawiki.mixins.less'; - .mw-header { // Vertical centering of header elements (IE>=11), requires Flexbox. .flex-display(); diff --git a/resources/skins.vector.styles/components/Icon.less b/resources/skins.vector.styles/components/Icon.less index 9689169be..d35f3918a 100644 --- a/resources/skins.vector.styles/components/Icon.less +++ b/resources/skins.vector.styles/components/Icon.less @@ -1,6 +1,3 @@ -@import '../../common/variables.less'; -@import 'mediawiki.mixins.less'; - .vector-icon { .cdx-mixin-css-icon-background( ); .cdx-mixin-css-icon-size( ); diff --git a/resources/skins.vector.styles/components/LanguageDropdown.less b/resources/skins.vector.styles/components/LanguageDropdown.less index 5a3730bc1..e3e04a758 100644 --- a/resources/skins.vector.styles/components/LanguageDropdown.less +++ b/resources/skins.vector.styles/components/LanguageDropdown.less @@ -1,8 +1,3 @@ -// The use of mixins.buttons requires @font-size-base to be defined for this to work in Storybook -@import '../../common/variables.less'; -@import '../../common/mixins.less'; -@import 'mediawiki.mixins.less'; - // Note vector-feature-language-in-header-enabled class is not used here as that class // only applies to main page. // This must be limited to vector-page-titlebar as the mw-portlet-lang class is shared with diff --git a/resources/skins.vector.styles/components/Logo.less b/resources/skins.vector.styles/components/Logo.less index 6314bba60..b21f9534c 100644 --- a/resources/skins.vector.styles/components/Logo.less +++ b/resources/skins.vector.styles/components/Logo.less @@ -1,6 +1,3 @@ -@import '../../common/variables.less'; -@import 'mediawiki.mixins.less'; - .mw-logo { .flex-display(); // If icon is not configured, ensure that the logo still takes up available diff --git a/resources/skins.vector.styles/components/MainMenu.less b/resources/skins.vector.styles/components/MainMenu.less index 0f073496b..e1102a7a0 100644 --- a/resources/skins.vector.styles/components/MainMenu.less +++ b/resources/skins.vector.styles/components/MainMenu.less @@ -1,7 +1,3 @@ -@import '../../common/variables.less'; -@import '../../common/mixins.less'; -@import 'mediawiki.mixins.less'; - // Ensure there is only 1 main menu landmark at anytime &.vector-feature-main-menu-pinned-enabled .vector-header-start .vector-main-menu-landmark, &.vector-feature-main-menu-pinned-disabled .vector-main-menu-container .vector-main-menu-landmark { diff --git a/resources/skins.vector.styles/components/MenuTabs.less b/resources/skins.vector.styles/components/MenuTabs.less index 8ed3f3f3f..95bbaaad1 100644 --- a/resources/skins.vector.styles/components/MenuTabs.less +++ b/resources/skins.vector.styles/components/MenuTabs.less @@ -1,6 +1,3 @@ -@import '../../common/variables.less'; -@import 'mediawiki.mixins.less'; - /** * Styling for namespace tabs (page, discussion) and views (read, edit, view history, watch and other actions) */ diff --git a/resources/skins.vector.styles/components/PageTitlebar.less b/resources/skins.vector.styles/components/PageTitlebar.less index aca32fac4..400e8c6a4 100644 --- a/resources/skins.vector.styles/components/PageTitlebar.less +++ b/resources/skins.vector.styles/components/PageTitlebar.less @@ -1,5 +1,3 @@ -@import '../../common/variables.less'; - .vector-page-titlebar { position: relative; display: flex; diff --git a/resources/skins.vector.styles/components/PageToolbar.less b/resources/skins.vector.styles/components/PageToolbar.less index 33a753a8c..635a56af2 100644 --- a/resources/skins.vector.styles/components/PageToolbar.less +++ b/resources/skins.vector.styles/components/PageToolbar.less @@ -1,6 +1,3 @@ -@import '../../common/variables.less'; -@import '../../common/mixins.less'; - @border-base-ems: unit( @border-width-base / @font-size-browser / @font-size-base, em ); .vector-page-toolbar-container { diff --git a/resources/skins.vector.styles/components/PageTools.less b/resources/skins.vector.styles/components/PageTools.less index b0b01bbea..1522108e4 100644 --- a/resources/skins.vector.styles/components/PageTools.less +++ b/resources/skins.vector.styles/components/PageTools.less @@ -1,6 +1,3 @@ -@import '../../common/variables.less'; -@import '../../common/mixins.less'; - // Ensure there is only 1 page tools landmark at anytime &.vector-feature-page-tools-pinned-enabled .vector-page-toolbar-container .vector-page-tools-landmark, &.vector-feature-page-tools-pinned-disabled .vector-column-end .vector-page-tools-landmark { diff --git a/resources/skins.vector.styles/components/PinnableElement.less b/resources/skins.vector.styles/components/PinnableElement.less index 654527ccc..94466bcee 100644 --- a/resources/skins.vector.styles/components/PinnableElement.less +++ b/resources/skins.vector.styles/components/PinnableElement.less @@ -1,5 +1,3 @@ -@import '../../common/variables.less'; - .vector-pinned-container .vector-pinnable-element { // Make the heading border line up with the edge of the text // (Whereas in a dropdown, the border lines up with the edge of the dropdown container). diff --git a/resources/skins.vector.styles/components/SearchBox.less b/resources/skins.vector.styles/components/SearchBox.less index d34d30ccf..d6ce0a602 100644 --- a/resources/skins.vector.styles/components/SearchBox.less +++ b/resources/skins.vector.styles/components/SearchBox.less @@ -1,5 +1,3 @@ -@import '../../common/variables.less'; - // Search container // We have to put those styles outside `.skin-vector-search-vue`, // as we can't address no-JS modern and Vue enhanced otherwise. diff --git a/resources/skins.vector.styles/components/StickyHeader.less b/resources/skins.vector.styles/components/StickyHeader.less index a035a770f..57ce5885e 100644 --- a/resources/skins.vector.styles/components/StickyHeader.less +++ b/resources/skins.vector.styles/components/StickyHeader.less @@ -1,7 +1,3 @@ -@import '../../common/variables.less'; -@import '../../common/mixins.less'; -@import 'mediawiki.mixins.less'; - @spacing-search-title-divider: 30px; @font-size-sticky-header-links: unit( 14 / @font-size-browser, em ); // Equals `0.875em`. diff --git a/resources/skins.vector.styles/components/TableOfContents.less b/resources/skins.vector.styles/components/TableOfContents.less index 0ac5804d2..95aa0c11e 100644 --- a/resources/skins.vector.styles/components/TableOfContents.less +++ b/resources/skins.vector.styles/components/TableOfContents.less @@ -1,5 +1,3 @@ -@import '../../common/variables.less'; - /** * Checkbox hack used by collapsed TOC on narrow viewports for no JS users. * Although it's display:none, the :checked state is still affected when clicking diff --git a/resources/skins.vector.styles/components/UserLinks.less b/resources/skins.vector.styles/components/UserLinks.less index 8ecd7261f..40b84c445 100644 --- a/resources/skins.vector.styles/components/UserLinks.less +++ b/resources/skins.vector.styles/components/UserLinks.less @@ -1,7 +1,3 @@ -@import '../../common/variables.less'; -@import '../../common/mixins.less'; -@import 'mediawiki.mixins.less'; - @font-size-user-links: unit( 14 / @font-size-browser, em ); // Equals `0.875em`. // Applies to links in the overflow menu that do not have the .cdx-button class. @overflow-link-margin: 0 8px; diff --git a/resources/skins.vector.styles/components/Watchstar.less b/resources/skins.vector.styles/components/Watchstar.less index 5a72e96df..71b8f1e30 100644 --- a/resources/skins.vector.styles/components/Watchstar.less +++ b/resources/skins.vector.styles/components/Watchstar.less @@ -1,5 +1,3 @@ -@import '../../common/variables.less'; -@import 'mediawiki.mixins.less'; @import 'mediawiki.mixins.rotation.less'; /* Watch/Unwatch Icon Styling */ diff --git a/resources/skins.vector.styles/layouts/preZebra.less b/resources/skins.vector.styles/layouts/preZebra.less index 119123db5..0c2bbeb42 100644 --- a/resources/skins.vector.styles/layouts/preZebra.less +++ b/resources/skins.vector.styles/layouts/preZebra.less @@ -1,5 +1,3 @@ -@import '../../common/mixins.less'; - .vector-header-container { .mixin-page-container(); } diff --git a/resources/skins.vector.styles/skin.less b/resources/skins.vector.styles/skin.less index 88afcd7cf..333cfc819 100644 --- a/resources/skins.vector.styles/skin.less +++ b/resources/skins.vector.styles/skin.less @@ -2,8 +2,6 @@ * Vector modern stylesheets * See '../common/common.less' for common screen and print Vector stylesheets. */ - -@import 'mediawiki.mixins.less'; @import '../common/variables.less'; @import '../common/mixins.less'; diff --git a/resources/skins.vector.zebra.styles/mixins.less b/resources/skins.vector.zebra.styles/mixins.less index dcc769d28..78fc1d612 100644 --- a/resources/skins.vector.zebra.styles/mixins.less +++ b/resources/skins.vector.zebra.styles/mixins.less @@ -1,6 +1,7 @@ /** * Less mixins. */ +@import 'mediawiki.mixins.less'; .mixin-vector-page-container-sizing() { // Set a min-width to make explicit we do not support anything below this threshold. diff --git a/resources/skins.vector.zebra.styles/skin.less b/resources/skins.vector.zebra.styles/skin.less index bebaac0fc..ddf5f6ad0 100644 --- a/resources/skins.vector.zebra.styles/skin.less +++ b/resources/skins.vector.zebra.styles/skin.less @@ -6,7 +6,6 @@ * the feature flag as been removed. */ -@import 'mediawiki.mixins.less'; @import './variables.less'; @import './mixins.less';