Browse Source

Fixes #1226, makes variables simpler for label/image/icon/flag inside item. Fixes lineheight offset

pull/1243/head
jlukic 10 years ago
parent
commit
5f20be59fb
2 changed files with 63 additions and 51 deletions
  1. 92
      src/definitions/modules/dropdown.less
  2. 22
      src/themes/default/modules/dropdown.variables

92
src/definitions/modules/dropdown.less

@ -27,11 +27,11 @@
cursor: pointer; cursor: pointer;
position: relative; position: relative;
display: inline-block; display: inline-block;
line-height: @lineHeight;
transition: @transition;
line-height: 1em;
tap-highlight-color: rgba(0, 0, 0, 0); tap-highlight-color: rgba(0, 0, 0, 0);
outline: none; outline: none;
text-align: left; text-align: left;
transition: @transition;
} }
@ -184,21 +184,6 @@
padding: @menuInputPadding; padding: @menuInputPadding;
} }
/*--------------
Item Image
---------------*/
.ui.dropdown > .text > img,
.ui.dropdown > .text > .image,
.ui.dropdown .menu > .item > .image,
.ui.dropdown .menu > .item > img {
display: inline-block;
vertical-align: middle;
width: auto;
max-height: @menuImageMaxHeight;
margin: @itemImageMargin;
}
/*----------------- /*-----------------
Item Description Item Description
-------------------*/ -------------------*/
@ -233,25 +218,59 @@
Coupling Coupling
*******************************/ *******************************/
/* Icons / Flags / Labels */
/*--------------
Sub Elements
---------------*/
/* Icons / Flags / Labels / Image */
.ui.dropdown > .text > .icon, .ui.dropdown > .text > .icon,
.ui.dropdown .menu > .item > .icon {
margin: @itemIconMargin;
}
.ui.dropdown > .text > .label, .ui.dropdown > .text > .label,
.ui.dropdown .menu > .item > .label {
margin: @itemLabelMargin;
.ui.dropdown > .text > .flag,
.ui.dropdown > .text > img,
.ui.dropdown > .text > .image {
margin-top: @textLineHeightOffset;
}
.ui.dropdown .menu > .item > .icon,
.ui.dropdown .menu > .item > .label,
.ui.dropdown .menu > .item > .flag,
.ui.dropdown .menu > .item > .image,
.ui.dropdown .menu > .item > img {
margin-top: @itemLineHeightOffset;
} }
.ui.dropdown > .text > .icon,
.ui.dropdown > .text > .label,
.ui.dropdown > .text > .flag, .ui.dropdown > .text > .flag,
.ui.dropdown .menu > .item > .flag {
margin: @itemFlagMargin;
.ui.dropdown > .text > img,
.ui.dropdown > .text > .image,
.ui.dropdown .menu > .item > .icon,
.ui.dropdown .menu > .item > .label,
.ui.dropdown .menu > .item > .flag,
.ui.dropdown .menu > .item > .image,
.ui.dropdown .menu > .item > img {
margin-left: 0em;
margin-right: @itemElementDistance;
} }
.ui.dropdown .menu > .item > .icon + .text {
display: block;
margin-right: @itemIconDistance;
/*--------------
Image
---------------*/
.ui.dropdown > .text > img,
.ui.dropdown > .text > .image,
.ui.dropdown .menu > .item > .image,
.ui.dropdown .menu > .item > img {
display: inline-block;
vertical-align: middle;
width: auto;
max-height: @menuImageMaxHeight;
} }
/*--------------
Menu
---------------*/
/* Remove Menu Item Divider */ /* Remove Menu Item Divider */
.ui.dropdown .ui.menu > .item:before, .ui.dropdown .ui.menu > .item:before,
.ui.menu .ui.dropdown .menu > .item:before { .ui.menu .ui.dropdown .menu > .item:before {
@ -263,6 +282,17 @@
border-left: none; border-left: none;
} }
/* Automatically float dropdown menu right on last menu item */
.ui.menu .right.menu .dropdown:last-child .menu,
.ui.buttons > .ui.dropdown:last-child .menu {
left: auto;
right: 0em;
}
/*--------------
Button
---------------*/
/* No Margin On Icon Button */ /* No Margin On Icon Button */
.ui.dropdown.icon.button > .dropdown.icon { .ui.dropdown.icon.button > .dropdown.icon {
margin: 0em; margin: 0em;
@ -273,12 +303,6 @@
border-bottom-right-radius: 0em; border-bottom-right-radius: 0em;
} }
/* Automatically float dropdown menu right on last menu item */
.ui.menu .right.menu .dropdown:last-child .menu,
.ui.buttons > .ui.dropdown:last-child .menu {
left: auto;
right: 0em;
}
/******************************* /*******************************

22
src/themes/default/modules/dropdown.variables

@ -6,7 +6,6 @@
Element Element
--------------------*/ --------------------*/
@lineHeight: 1;
@transition: @transition:
border-radius 0.1s ease, border-radius 0.1s ease,
width 0.2s ease width 0.2s ease
@ -40,7 +39,7 @@
/* Text */ /* Text */
@textLineHeight: 1em; @textLineHeight: 1em;
@textLineHeightOffset: (@itemLineHeight - 1em);
@textLineHeightOffset: (@textLineHeight - 1em);
/* Menu Item */ /* Menu Item */
@itemFontSize: 1rem; @itemFontSize: 1rem;
@ -87,23 +86,12 @@
/* Menu Image */ /* Menu Image */
@menuImageMaxHeight: 2.5em; @menuImageMaxHeight: 2.5em;
/* Menu Item Icon */
@itemIconFloat: right;
@itemIconMargin: @itemLineHeightOffset 0.75em 0em 0em;
@itemIconDistance: 1em;
/* Item Sub-Element */
@itemElementDistance: 0.75em;
/* Sub-Menu Icon */
/* Sub-Menu Dropdown Icon */
@itemDropdownIconFloat: right; @itemDropdownIconFloat: right;
@itemDropdownIconMargin: @itemIconMargin;
/* Label */
@itemLabelMargin: @itemIconMargin;
/* Flag */
@itemFlagMargin: @itemIconMargin;
/* Image */
@itemImageMargin: @itemIconMargin;
@itemDropdownIconMargin: @itemLineHeightOffset 0em 0em @itemElementDistance;
/* Description */ /* Description */
@itemDescriptionMargin: 0em 0em 0em 1em; @itemDescriptionMargin: 0em 0em 0em 1em;

Loading…
Cancel
Save