/* * # Semantic - Dropdown * http://github.com/semantic-org/semantic-ui/ * * * Copyright 2014 Contributor * Released under the MIT license * http://opensource.org/licenses/MIT * */ /******************************* Theme *******************************/ @type : 'module'; @element : 'dropdown'; @import '../../semantic.config'; /******************************* Dropdown *******************************/ .ui.dropdown { cursor: pointer; position: relative; display: inline-block; line-height: @lineHeight; transition: @transition; tap-highlight-color: rgba(0, 0, 0, 0); } /******************************* Content *******************************/ /*-------------- Menu ---------------*/ .ui.dropdown .menu { cursor: auto; position: absolute; display: none; top: 100%; margin: @menuMargin; padding: @menuPadding; background: @menuBackground; min-width: 100%; white-space: @menuWrap; font-size: 1rem; text-shadow: none; box-shadow: @menuBoxShadow; border-radius: @menuBorderRadius; transition: @menuTransition; z-index: @menuZIndex; will-change: transform, opacity; } /*-------------- Icon ---------------*/ .ui.dropdown > .dropdown.icon { width: auto; margin: @dropdownIconMargin; } .ui.dropdown .menu .item .dropdown.icon { width: auto; float: @dropdownSubMenuIconFloat; margin: @dropdownSubMenuIconMargin; } /*-------------- Text ---------------*/ .ui.dropdown > .text { display: inline-block; vertical-align: top; transition: @textTransition; } /*-------------- Menu Item ---------------*/ .ui.dropdown .menu .item { cursor: pointer; display: block; border: @itemBorder; height: @itemHeight; border-top: @itemDivider; font-size: @itemFontSize; color: @itemColor; padding: @itemVerticalPadding @itemHorizontalPadding !important; font-size: @itemFontSize; text-transform: @itemTextTransform; font-weight: @itemFontWeight; text-align: @itemTextAlign; box-shadow: @itemBoxShadow; -webkit-touch-callout: none; } .ui.dropdown .menu .item .icon { margin: @itemIconMargin; } .ui.dropdown .menu .item:first-child { border-top: none; } /*-------------- Item Image ---------------*/ .ui.dropdown .menu .item > img { height: 2.5em; display: inline-block; vertical-align: middle; margin-right: 0.5em; } /*-------------- Sub Menu ---------------*/ .ui.dropdown .menu .menu { top: @subMenuTop !important; left: @subMenuLeft !important; right: @subMenuRight !important; margin: @subMenuMargin !important; border-radius: @subMenuBorderRadius !important; } /* Hide Arrow */ .ui.dropdown .menu .menu:after { display: none; } /******************************* Coupling *******************************/ /* Remove Menu Item Divider */ .ui.dropdown .ui.menu .item:before, .ui.menu .ui.dropdown .menu .item:before { display: none; } /* Prevent Menu Item Border */ .ui.menu .ui.dropdown .menu .active.item { border-left: none; } /* No Margin On Icon Button */ .ui.dropdown.icon.button > .dropdown.icon { margin: 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; } /******************************* Types *******************************/ /*-------------- Selection ---------------*/ /* Displays like a select box */ .ui.selection.dropdown { cursor: pointer; word-wrap: break-word; white-space: normal; outline: 0; background: @selectionBackground; display: @selectionDisplay; padding: @selectionVerticalPadding @selectionHorizontalPadding; color: @selectionTextColor; box-shadow: @selectionBoxShadow !important; border-radius: @selectionBorderRadius !important; /* Matches selection dropdown height to input height */ border-top: 1px solid transparent; } .ui.selection.dropdown.active { transform: rotateZ(0deg); z-index: 10; } .ui.selection.dropdown select { display: none; } .ui.selection.dropdown > .dropdown.icon { opacity: @selectionIconOpacity; margin: @selectionIconMargin; transition: @selectionIconTransition; } .ui.selection.dropdown .menu { overflow-x: hidden; overflow-y: auto; max-height: @selectionMenuMaxHeight; box-shadow: @selectionMenuBoxShadow; } .ui.selection.dropdown .menu:after, .ui.selection.dropdown .menu:before { display: none; } /* Hover */ .ui.selection.dropdown:hover { box-shadow: @selectionHoverBoxShadow !important; } .ui.selection.dropdown:hover .menu { box-shadow: @selectionHoverMenuBoxShadow; } .ui.selection.dropdown:hover > .dropdown.icon { opacity: @selectionHoverIconOpacity; } /* Connecting Border */ .ui.active.selection.dropdown, .ui.visible.selection.dropdown { border-bottom-left-radius: @selectionVisibleConnectingBorder !important; border-bottom-right-radius: @selectionVisibleConnectingBorder !important; } .ui.active.selection.dropdown > .dropdown.icon { opacity: @selectionActiveIconOpacity; } /*-------------- Inline ---------------*/ .ui.inline.dropdown { cursor: pointer; display: inline-block; color: @inlineTextColor; } .ui.inline.dropdown .dropdown.icon { margin: @inlineIconMargin; vertical-align: top; } .ui.inline.dropdown .text { font-weight: @inlineTextFontWeight; } .ui.inline.dropdown .menu { cursor: auto; margin-top: @inlineMenuDistance; border-radius: @inlineMenuBorderRadius; } /******************************* States *******************************/ /* Dropdown Visible */ .ui.visible.dropdown > .menu { display: block; } /*-------------------- Hover ----------------------*/ /* Menu Item Hover */ .ui.dropdown .menu .item:hover { background-color: rgba(0, 0, 0, 0.03); z-index: 12; } /*-------------------- Active ----------------------*/ /* Menu Item Active */ .ui.dropdown .menu .active.item { background: @activeItemBackground; font-weight: @activeItemFontWeight; color: @activeItemColor; box-shadow: @activeItemBoxShadow; z-index: @activeItemZIndex; } /*-------------------- Default Text ----------------------*/ .ui.dropdown > .default.text, .ui.default.dropdown > .text { color: @defaultTextColor; } .ui.dropdown:hover > .default.text, .ui.default.dropdown:hover > .text { color: @defaultTextHoverColor; } /*-------------------- Error ----------------------*/ .ui.dropdown.error, .ui.dropdown.error > .text, .ui.dropdown.error > .default.text { color: @errorTextColor !important; } .ui.selection.dropdown.error { background: @errorBackgroundColor; box-shadow: 0px 0px 0px 1px @errorBorderColor !important; } .ui.selection.dropdown.error:hover { box-shadow: 0px 0px 0px 1px @errorBorderColor !important; } .ui.dropdown.error > .menu, .ui.dropdown.error > .menu .menu { box-shadow: 0px 0px 1px 1px @errorBorderColor !important; } .ui.dropdown.error > .menu .item { color: #D95C5C !important; } /* Item Hover */ .ui.dropdown.error > .menu .item:hover { background-color: #FFF2F2 !important; } /* Item Active */ .ui.dropdown.error > .menu .active.item { background-color: #FDCFCF !important; } /******************************* Variations *******************************/ /*-------------- Direction ---------------*/ /* Flyout Direction */ .ui.dropdown .menu { left: 0px; } /*-------------- Simple ---------------*/ /* Displays without javascript */ .ui.simple.dropdown .menu:before, .ui.simple.dropdown .menu:after { display: none; } .ui.simple.dropdown .menu { position: absolute; display: block; overflow: hidden; top: -9999px !important; opacity: 0; width: 0; height: 0; transition: @simpleTransition; } .ui.simple.active.dropdown, .ui.simple.dropdown:hover { border-bottom-left-radius: 0em !important; border-bottom-right-radius: 0em !important; } .ui.simple.active.dropdown > .menu, .ui.simple.dropdown:hover > .menu { overflow: visible; width: auto; height: auto; top: 100% !important; opacity: 1; } .ui.simple.dropdown > .menu .item:active > .menu, .ui.simple.dropdown:hover > .menu .item:hover > .menu { overflow: visible; width: auto; height: auto; top: 0% !important; left: 100% !important; opacity: 1; } .ui.simple.disabled.dropdown:hover .menu { display: none; height: 0px; width: 0px; overflow: hidden; } /*-------------- Fluid ---------------*/ .ui.fluid.dropdown { display: block; } .ui.fluid.dropdown > .dropdown.icon { float: right; } /*-------------- Floating ---------------*/ .ui.floating.dropdown .menu { left: 0; right: auto; margin-top: @floatingMenuDistance !important; box-shadow: @floatingMenuBoxShadow; border-radius: @floatingMenuBorderRadius; } /*-------------- Pointing ---------------*/ .ui.pointing.dropdown .menu { top: 100%; margin-top: @pointingMenuDistance; border-radius: @pointingMenuBorderRadius; } .ui.pointing.dropdown .menu:after { display: block; position: absolute; pointer-events: none; content: ''; visibility: visible; transform: rotate(45deg); width: @pointingArrowSize; height: @pointingArrowSize; box-shadow: @pointingArrowBoxShadow; background: @pointingArrowBackground; z-index: @pointingArrowZIndex; } /* Directions */ .ui.pointing.dropdown .menu:after { top: @pointingArrowOffset; left: 50%; margin: 0em 0em 0em @pointingArrowOffset; } .ui.top.left.pointing.dropdown .menu { top: 100%; bottom: auto; left: 0%; right: auto; margin: @pointingArrowDistanceFromEdge 0em 0em; } .ui.top.left.pointing.dropdown .menu:after { top: @pointingArrowOffset; left: @pointingArrowDistanceFromEdge; right: auto; margin: 0em; transform: rotate(45deg); } .ui.top.right.pointing.dropdown .menu { top: 100%; bottom: auto; right: 0%; left: auto; margin: @pointingArrowDistanceFromEdge 0em 0em; } .ui.top.right.pointing.dropdown .menu:after { top: @pointingArrowOffset; left: auto; right: @pointingArrowDistanceFromEdge; margin: 0em; transform: rotate(45deg); } .ui.left.pointing.dropdown .menu { top: 0%; left: 100%; right: auto; margin: 0em 0em 0em @pointingArrowDistanceFromEdge; } .ui.left.pointing.dropdown .menu:after { top: 1em; left: @pointingArrowOffset; margin: 0em 0em 0em 0em; transform: rotate(-45deg); } .ui.right.pointing.dropdown .menu { top: 0%; left: auto; right: 100%; margin: 0em @pointingArrowDistanceFromEdge 0em 0em; } .ui.right.pointing.dropdown .menu:after { top: 1em; left: auto; right: @pointingArrowOffset; margin: 0em 0em 0em 0em; transform: rotate(135deg); } .loadUIOverrides();