From 61332d727e6e1d67def803b2f8d61047d79db0cc Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 7 Sep 2012 11:34:05 -0700 Subject: fixes #5020: submenu support in dropup --- less/dropdowns.less | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'less/dropdowns.less') diff --git a/less/dropdowns.less b/less/dropdowns.less index 390c37497..bed158612 100644 --- a/less/dropdowns.less +++ b/less/dropdowns.less @@ -163,6 +163,8 @@ .dropdown-submenu { position: relative; } + +// Default dropdowns .dropdown-submenu > .dropdown-menu { top: 0; left: 100%; @@ -176,6 +178,18 @@ display: block; } +// Dropups +.dropup .dropdown-submenu > .dropdown-menu { + top: auto; + bottom: 0; + margin-top: 0; + margin-bottom: -2px; + -webkit-border-radius: 5px 5px 5px 0; + -moz-border-radius: 5px 5px 5px 0; + border-radius: 5px 5px 5px 0; +} + +// Caret to indicate there is a submenu .dropdown-submenu > a:after { display: block; content: " "; -- cgit v1.2.3 From 6aa15eb01f2e50e394ae172ff41e5bc0583de6da Mon Sep 17 00:00:00 2001 From: Robert McLaws Date: Sun, 16 Sep 2012 03:02:31 -0400 Subject: Support for left-opening dropdown submenus Adds a new class called .dropdown-submenu-left. It is useful when you have a .pull-right DropDown that has submenus. Without this, the menu opens left past the page boundary, which can trigger the scrollbars and cause other nastiness. --- less/dropdowns.less | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'less/dropdowns.less') diff --git a/less/dropdowns.less b/less/dropdowns.less index bed158612..9622d2d46 100644 --- a/less/dropdowns.less +++ b/less/dropdowns.less @@ -163,7 +163,6 @@ .dropdown-submenu { position: relative; } - // Default dropdowns .dropdown-submenu > .dropdown-menu { top: 0; @@ -207,6 +206,40 @@ border-left-color: @dropdownLinkColorHover; } +// Left-opening Sub menus +// --------------------------- +.dropdown-submenu-left { + position: relative; +} +.dropdown-submenu-left > .dropdown-menu { + top: 0; + left: -100%; + margin-top: -6px; + margin-left: -1px; + -webkit-border-radius: 6px 0px 6px 6px; + -moz-border-radius: 6px 0px 6px 6px; + border-radius: 6px 0px 6px 6px; +} +.dropdown-submenu-left:hover > .dropdown-menu { + display: block; +} + +.dropdown-submenu-left > a:before { + display: block; + content: " "; + float: left; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 5px 5px 0px; + border-right-color: darken(@dropdownBackground, 20%); + margin-top: 5px; + margin-left: -10px; +} +.dropdown-submenu-left:hover > a:after { + border-right-color: @dropdownLinkColorHover; +} // Tweak nav headers // ----------------- -- cgit v1.2.3 From 1b814458c9476c32a92390e9e5cd989a51d04f05 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 1 Oct 2012 16:41:13 -0700 Subject: improve dropdown submenu docs; add docs for left submenu; remove all dupe css for left submenu --- less/dropdowns.less | 47 ++++++++++++++--------------------------------- 1 file changed, 14 insertions(+), 33 deletions(-) (limited to 'less/dropdowns.less') diff --git a/less/dropdowns.less b/less/dropdowns.less index 9622d2d46..5ed279167 100644 --- a/less/dropdowns.less +++ b/less/dropdowns.less @@ -206,39 +206,20 @@ border-left-color: @dropdownLinkColorHover; } -// Left-opening Sub menus -// --------------------------- -.dropdown-submenu-left { - position: relative; -} -.dropdown-submenu-left > .dropdown-menu { - top: 0; - left: -100%; - margin-top: -6px; - margin-left: -1px; - -webkit-border-radius: 6px 0px 6px 6px; - -moz-border-radius: 6px 0px 6px 6px; - border-radius: 6px 0px 6px 6px; -} -.dropdown-submenu-left:hover > .dropdown-menu { - display: block; -} - -.dropdown-submenu-left > a:before { - display: block; - content: " "; - float: left; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - border-width: 5px 5px 5px 0px; - border-right-color: darken(@dropdownBackground, 20%); - margin-top: 5px; - margin-left: -10px; -} -.dropdown-submenu-left:hover > a:after { - border-right-color: @dropdownLinkColorHover; +// Left aligned submenus +.dropdown-submenu.pull-left { + // Undo the float + // Yes, this is awkward since .pull-left adds a float, but it sticks to our conventions elsewhere. + float: none; + + // Positioning the submenu + > .dropdown-menu { + left: -100%; + margin-left: 10px; + -webkit-border-radius: 6px 0 6px 6px; + -moz-border-radius: 6px 0 6px 6px; + border-radius: 6px 0 6px 6px; + } } // Tweak nav headers -- cgit v1.2.3 From dd8b745b883a900aa637a7b8142be5691ebc3913 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 3 Oct 2012 09:26:52 -0700 Subject: use border-radius vars where possible --- less/dropdowns.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'less/dropdowns.less') diff --git a/less/dropdowns.less b/less/dropdowns.less index 5ed279167..359f0e228 100644 --- a/less/dropdowns.less +++ b/less/dropdowns.less @@ -234,5 +234,5 @@ // --------- .typeahead { margin-top: 2px; // give it some space to breathe - .border-radius(4px); + .border-radius(@baseBorderRadius); } -- cgit v1.2.3 From 7d649c9d4a0c504ca29e6efa7fcb42af5d8996dd Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 5 Oct 2012 11:13:21 -0700 Subject: fixes #5430: scope link styles in .dropdown-menu to .dropdown-menu li > a --- less/dropdowns.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'less/dropdowns.less') diff --git a/less/dropdowns.less b/less/dropdowns.less index 359f0e228..a33fe71e2 100644 --- a/less/dropdowns.less +++ b/less/dropdowns.less @@ -72,7 +72,7 @@ } // Links within the dropdown menu - a { + li > a { display: block; padding: 3px 20px; clear: both; -- cgit v1.2.3 From 7e534ce98acf03229e09b8ae478cb3598d3882cd Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 7 Oct 2012 21:45:16 -0700 Subject: fixes #5443: reset background gradient on disabled dropdown links --- less/dropdowns.less | 1 + 1 file changed, 1 insertion(+) (limited to 'less/dropdowns.less') diff --git a/less/dropdowns.less b/less/dropdowns.less index a33fe71e2..03efd6abf 100644 --- a/less/dropdowns.less +++ b/less/dropdowns.less @@ -116,6 +116,7 @@ .dropdown-menu .disabled > a:hover { text-decoration: none; background-color: transparent; + background-image: none; // Remove CSS gradient cursor: default; } -- cgit v1.2.3 From 31007c01d8e5a3ad87597e56e2240693347a2a2c Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 10 Oct 2012 09:51:13 -0700 Subject: fixes #5478: remove double background color on dropdown links --- less/dropdowns.less | 2 -- 1 file changed, 2 deletions(-) (limited to 'less/dropdowns.less') diff --git a/less/dropdowns.less b/less/dropdowns.less index 03efd6abf..d4fdab47f 100644 --- a/less/dropdowns.less +++ b/less/dropdowns.less @@ -90,7 +90,6 @@ .dropdown-submenu:hover > a { text-decoration: none; color: @dropdownLinkColorHover; - background-color: @dropdownLinkBackgroundHover; #gradient > .vertical(@dropdownLinkBackgroundHover, darken(@dropdownLinkBackgroundHover, 5%)); } @@ -101,7 +100,6 @@ color: @dropdownLinkColorHover; text-decoration: none; outline: 0; - background-color: @dropdownLinkBackgroundActive; #gradient > .vertical(@dropdownLinkBackgroundActive, darken(@dropdownLinkBackgroundActive, 5%)); } -- cgit v1.2.3 From 709870aa3e5edab74e9644273df092258569b449 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 16 Oct 2012 20:34:42 -0700 Subject: fixes #5496: use correct var for dropdown active link text --- less/dropdowns.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'less/dropdowns.less') diff --git a/less/dropdowns.less b/less/dropdowns.less index d4fdab47f..26ca0f9ea 100644 --- a/less/dropdowns.less +++ b/less/dropdowns.less @@ -97,7 +97,7 @@ // ------------ .dropdown-menu .active > a, .dropdown-menu .active > a:hover { - color: @dropdownLinkColorHover; + color: @dropdownLinkColorActive; text-decoration: none; outline: 0; #gradient > .vertical(@dropdownLinkBackgroundActive, darken(@dropdownLinkBackgroundActive, 5%)); -- cgit v1.2.3