Browse Source

Dropdown: adds compact variation, fixes for specificity on text selector, and better formatting for sub-menus

pull/1177/head
jlukic 10 years ago
parent
commit
80d1c4dbce
2 changed files with 26 additions and 12 deletions
  1. 32
      src/definitions/modules/dropdown.less
  2. 6
      src/themes/packages/default/modules/dropdown.variables

32
src/definitions/modules/dropdown.less

@ -163,8 +163,8 @@
Item Image Item Image
---------------*/ ---------------*/
.ui.dropdown .text > img,
.ui.dropdown .text > .image,
.ui.dropdown > .text > img,
.ui.dropdown > .text > .image,
.ui.dropdown .menu > .item > .image, .ui.dropdown .menu > .item > .image,
.ui.dropdown .menu > .item > img { .ui.dropdown .menu > .item > img {
display: inline-block; display: inline-block;
@ -199,17 +199,21 @@
/* Icons / Flags / Labels */ /* Icons / Flags / Labels */
.ui.dropdown > .text > .icon, .ui.dropdown > .text > .icon,
.ui.dropdown .menu > .item .icon {
.ui.dropdown .menu > .item > .icon {
margin: @itemIconMargin; margin: @itemIconMargin;
} }
.ui.dropdown > .text > .label, .ui.dropdown > .text > .label,
.ui.dropdown .menu > .item .label {
.ui.dropdown .menu > .item > .label {
margin: @itemLabelMargin; margin: @itemLabelMargin;
} }
.ui.dropdown > .text > .flag, .ui.dropdown > .text > .flag,
.ui.dropdown .menu > .item .flag {
.ui.dropdown .menu > .item > .flag {
margin: @itemFlagMargin; margin: @itemFlagMargin;
} }
.ui.dropdown .menu > .item > .icon + .text {
display: block;
margin-right: @dropdownSubMenuIconDistance;
}
/* Remove Menu Item Divider */ /* Remove Menu Item Divider */
@ -227,6 +231,11 @@
.ui.dropdown.icon.button > .dropdown.icon { .ui.dropdown.icon.button > .dropdown.icon {
margin: 0em; margin: 0em;
} }
.ui.dropdown.button:not(.pointing):not(.floating).active,
.ui.dropdown.button:not(.pointing):not(.floating).visible {
border-bottom-left-radius: 0em;
border-bottom-right-radius: 0em;
}
/* Automatically float dropdown menu right on last menu item */ /* Automatically float dropdown menu right on last menu item */
.ui.menu .right.menu .dropdown:last-child .menu, .ui.menu .right.menu .dropdown:last-child .menu,
@ -289,6 +298,11 @@ select.ui.dropdown {
transition: @selectionIconTransition; transition: @selectionIconTransition;
} }
/* Compact */
.ui.compact.selection.dropdown {
min-width: 0px;
}
/* Remove Selection */ /* Remove Selection */
.ui.selection.dropdown > .delete.icon { .ui.selection.dropdown > .delete.icon {
opacity: 0.6; opacity: 0.6;
@ -397,8 +411,8 @@ select.ui.dropdown {
} }
/* Active Item */ /* Active Item */
.ui.selection.active.dropdown .text:not(.default),
.ui.selection.visible.dropdown .text:not(.default) {
.ui.selection.active.dropdown > .text:not(.default),
.ui.selection.visible.dropdown > .text:not(.default) {
font-weight: @selectionVisibleTextFontWeight; font-weight: @selectionVisibleTextFontWeight;
color: @selectionVisibleTextColor; color: @selectionVisibleTextColor;
} }
@ -424,7 +438,7 @@ select.ui.dropdown {
margin: @inlineIconMargin; margin: @inlineIconMargin;
vertical-align: top; vertical-align: top;
} }
.ui.inline.dropdown .text {
.ui.inline.dropdown > .text {
font-weight: @inlineTextFontWeight; font-weight: @inlineTextFontWeight;
} }
.ui.inline.dropdown .menu { .ui.inline.dropdown .menu {
@ -494,7 +508,7 @@ select.ui.dropdown {
----------------------*/ ----------------------*/
/* Filtered Item */ /* Filtered Item */
.ui.dropdown .filtered.text {
.ui.dropdown > .filtered.text {
visibility: hidden; visibility: hidden;
} }
.ui.dropdown .filtered.item { .ui.dropdown .filtered.item {

6
src/themes/packages/default/modules/dropdown.variables

@ -76,8 +76,8 @@
/* Sub Menu Pointer Icon */ /* Sub Menu Pointer Icon */
@dropdownSubMenuIconFloat: right; @dropdownSubMenuIconFloat: right;
@dropdownSubMenuIconMargin: (@itemLineHeight - 1em) 0em 0em 0.5em;
@dropdownSubMenuIconMargin: (@itemLineHeight - 1em) 0em 0em;
@dropdownSubMenuIconDistance: 1em;
/* Menu Item Icon */ /* Menu Item Icon */
@itemIconMargin: 0em 0.75em 0em 0em; @itemIconMargin: 0em 0.75em 0em 0em;
@ -115,7 +115,7 @@ b Types
@selectionBorderRadius: @borderRadius; @selectionBorderRadius: @borderRadius;
@selectionIconOpacity: 0.8; @selectionIconOpacity: 0.8;
@selectionIconTransition: opacity 0.2s ease; @selectionIconTransition: opacity 0.2s ease;
@selectionMenuBoxShadow: 0px 4px 6px 0px rgba(0, 0, 0, 0.08);
@selectionMenuBoxShadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.08);
@selectionMenuItemBoxShadow: none; @selectionMenuItemBoxShadow: none;
@selectionTransition: @selectionTransition:

Loading…
Cancel
Save