From d5e5889c6cbab313ab7d59bb213bb18c2c39b774 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sat, 22 Sep 2018 15:46:56 +0300 Subject: [PATCH] Remove a few duplicate selectors. --- less/navbar.less | 120 +++++++++++++++++++++------------------------ less/popovers.less | 30 +++++------- less/tooltip.less | 43 ++++++++-------- 3 files changed, 90 insertions(+), 103 deletions(-) diff --git a/less/navbar.less b/less/navbar.less index cd1a1aaec0..da95e37a30 100644 --- a/less/navbar.less +++ b/less/navbar.less @@ -1,4 +1,4 @@ -// stylelint-disable selector-max-type, selector-max-compound-selectors, selector-max-combinators, selector-max-class, declaration-no-important, selector-no-qualifying-type, no-duplicate-selectors +// stylelint-disable selector-max-type, selector-max-compound-selectors, selector-max-combinators, selector-max-class, declaration-no-important, selector-no-qualifying-type // // Navbars @@ -98,6 +98,27 @@ max-height: 200px; } } + + // Fix the top/bottom navbars when screen real estate supports it + position: fixed; + right: 0; + left: 0; + z-index: @zindex-navbar-fixed; + + // Undo the rounded corners + @media (min-width: @grid-float-breakpoint) { + border-radius: 0; + } +} + +.navbar-fixed-top { + top: 0; + border-width: 0 0 1px; +} +.navbar-fixed-bottom { + bottom: 0; + margin-bottom: 0; // override .navbar defaults + border-width: 1px 0 0; } @@ -136,29 +157,6 @@ } } -// Fix the top/bottom navbars when screen real estate supports it -.navbar-fixed-top, -.navbar-fixed-bottom { - position: fixed; - right: 0; - left: 0; - z-index: @zindex-navbar-fixed; - - // Undo the rounded corners - @media (min-width: @grid-float-breakpoint) { - border-radius: 0; - } -} -.navbar-fixed-top { - top: 0; - border-width: 0 0 1px; -} -.navbar-fixed-bottom { - bottom: 0; - margin-bottom: 0; // override .navbar defaults - border-width: 1px 0 0; -} - // Brand/project name @@ -437,26 +435,8 @@ background-color: @navbar-default-link-disabled-bg; } } - } - .navbar-toggle { - border-color: @navbar-default-toggle-border-color; - &:hover, - &:focus { - background-color: @navbar-default-toggle-hover-bg; - } - .icon-bar { - background-color: @navbar-default-toggle-icon-bar-bg; - } - } - - .navbar-collapse, - .navbar-form { - border-color: @navbar-default-border; - } - - // Dropdown menu items - .navbar-nav { + // Dropdown menu items // Remove background color from open dropdown > .open > a { &, @@ -498,6 +478,22 @@ } } + .navbar-toggle { + border-color: @navbar-default-toggle-border-color; + &:hover, + &:focus { + background-color: @navbar-default-toggle-hover-bg; + } + .icon-bar { + background-color: @navbar-default-toggle-icon-bar-bg; + } + } + + .navbar-collapse, + .navbar-form { + border-color: @navbar-default-border; + } + // Links in navbars // @@ -571,27 +567,8 @@ background-color: @navbar-inverse-link-disabled-bg; } } - } - // Darken the responsive nav toggle - .navbar-toggle { - border-color: @navbar-inverse-toggle-border-color; - &:hover, - &:focus { - background-color: @navbar-inverse-toggle-hover-bg; - } - .icon-bar { - background-color: @navbar-inverse-toggle-icon-bar-bg; - } - } - - .navbar-collapse, - .navbar-form { - border-color: darken(@navbar-inverse-bg, 7%); - } - - // Dropdowns - .navbar-nav { + // Dropdowns > .open > a { &, &:hover, @@ -638,6 +615,23 @@ } } + // Darken the responsive nav toggle + .navbar-toggle { + border-color: @navbar-inverse-toggle-border-color; + &:hover, + &:focus { + background-color: @navbar-inverse-toggle-hover-bg; + } + .icon-bar { + background-color: @navbar-inverse-toggle-icon-bar-bg; + } + } + + .navbar-collapse, + .navbar-form { + border-color: darken(@navbar-inverse-bg, 7%); + } + .navbar-link { color: @navbar-inverse-link-color; &:hover { diff --git a/less/popovers.less b/less/popovers.less index 92f17e7cb9..3920eb5b0a 100644 --- a/less/popovers.less +++ b/less/popovers.less @@ -1,5 +1,3 @@ -// stylelint-disable no-duplicate-selectors - // // Popovers // -------------------------------------------------- @@ -50,22 +48,7 @@ border-width: @popover-arrow-width; } } -} -.popover-title { - padding: 8px 14px; - margin: 0; // reset heading margin - font-size: @font-size-base; - background-color: @popover-title-bg; - border-bottom: 1px solid darken(@popover-title-bg, 5%); - border-radius: (@border-radius-large - 1) (@border-radius-large - 1) 0 0; -} - -.popover-content { - padding: 9px 14px; -} - -.popover { &.top > .arrow { bottom: -@popover-arrow-outer-width; left: 50%; @@ -128,3 +111,16 @@ } } } + +.popover-title { + padding: 8px 14px; + margin: 0; // reset heading margin + font-size: @font-size-base; + background-color: @popover-title-bg; + border-bottom: 1px solid darken(@popover-title-bg, 5%); + border-radius: (@border-radius-large - 1) (@border-radius-large - 1) 0 0; +} + +.popover-content { + padding: 9px 14px; +} diff --git a/less/tooltip.less b/less/tooltip.less index 11b9be835b..650ab424d3 100644 --- a/less/tooltip.less +++ b/less/tooltip.less @@ -1,5 +1,3 @@ -// stylelint-disable no-duplicate-selectors - // // Tooltips // -------------------------------------------------- @@ -34,28 +32,8 @@ padding: 0 @tooltip-arrow-width; margin-left: -3px; } -} -// Wrapper for the tooltip content -.tooltip-inner { - max-width: @tooltip-max-width; - padding: 3px 8px; - color: @tooltip-color; - text-align: center; - background-color: @tooltip-bg; - border-radius: @border-radius-base; -} - -// Arrows -.tooltip-arrow { - position: absolute; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; -} -// Note: Deprecated .top-left, .top-right, .bottom-left, and .bottom-right as of v3.3.1 -.tooltip { + // Note: Deprecated .top-left, .top-right, .bottom-left, and .bottom-right as of v3.3.1 &.top .tooltip-arrow { bottom: 0; left: 50%; @@ -113,3 +91,22 @@ border-bottom-color: @tooltip-arrow-color; } } + +// Wrapper for the tooltip content +.tooltip-inner { + max-width: @tooltip-max-width; + padding: 3px 8px; + color: @tooltip-color; + text-align: center; + background-color: @tooltip-bg; + border-radius: @border-radius-base; +} + +// Arrows +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +}