diff options
| author | Mark Otto <[email protected]> | 2014-07-08 14:23:34 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2014-07-08 14:23:34 -0700 |
| commit | 8582659d5ced017aa50c03cf59594daccdf7073d (patch) | |
| tree | ed4ea1dabfeede75d3a0ed2fe3a3b27d9b8f4fba /less/dropdowns.less | |
| parent | b33b208ce1398752fc8342ce995d504419942c18 (diff) | |
| download | bootstrap-8582659d5ced017aa50c03cf59594daccdf7073d.tar.xz bootstrap-8582659d5ced017aa50c03cf59594daccdf7073d.zip | |
Refactor: drop .dropdown .caret for a generated caret using .dropdown-toggle:after
Diffstat (limited to 'less/dropdowns.less')
| -rw-r--r-- | less/dropdowns.less | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/less/dropdowns.less b/less/dropdowns.less index c71a618ff..cfe19cb20 100644 --- a/less/dropdowns.less +++ b/less/dropdowns.less @@ -2,27 +2,29 @@ // Dropdown menus // -------------------------------------------------- - -// Dropdown arrow/caret -.caret { - display: inline-block; - width: 0; - height: 0; - margin-left: 2px; - vertical-align: middle; - border-top: @caret-width-base solid; - border-right: @caret-width-base solid transparent; - border-left: @caret-width-base solid transparent; -} - // The dropdown wrapper (div) .dropdown { position: relative; } -// Prevent the focus on the dropdown toggle when closing dropdowns -.dropdown-toggle:focus { - outline: 0; +.dropdown-toggle { + // Generate the caret automatically + &:after { + display: inline-block; + width: 0; + height: 0; + content: ""; + margin-left: .25rem; + vertical-align: middle; + border-top: @caret-width-base solid; + border-right: @caret-width-base solid transparent; + border-left: @caret-width-base solid transparent; + } + + // Prevent the focus on the dropdown toggle when closing dropdowns + &:focus { + outline: 0; + } } // The dropdown menu (ul) |
