_actions-dropdown.less 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. // /**
  2. // * Copyright © Magento, Inc. All rights reserved.
  3. // * See COPYING.txt for license details.
  4. // */
  5. //
  6. // Forms -> Dropdown element
  7. // _____________________________________________
  8. //
  9. // Variables
  10. // _____________________________________________
  11. //
  12. // Utilities
  13. // ---------------------------------------------
  14. .admin__action-dropdown-menu__align(
  15. @_align
  16. ) when (@_align = left) {
  17. .admin__action-dropdown-text {
  18. &:after {
  19. left: -(@component__shadow-size__base + 1);
  20. right: 0;
  21. }
  22. }
  23. .admin__action-dropdown-menu {
  24. left: auto;
  25. right: 0;
  26. }
  27. }
  28. .admin__action-dropdown-menu__align(
  29. @_align
  30. ) when (@_align = right) {
  31. .admin__action-dropdown-text {
  32. &:after {
  33. left: 0;
  34. right: -(@component__shadow-size__base + 1);
  35. }
  36. }
  37. .admin__action-dropdown-menu {
  38. left: 0;
  39. right: auto;
  40. }
  41. }
  42. .action-dropdown-menu-link-pattern() {
  43. color: @action-dropdown__color;
  44. display: block;
  45. text-decoration: none;
  46. }
  47. //
  48. .admin__action-dropdown-wrap {
  49. .admin__action-dropdown-menu__align(left);
  50. display: inline-block;
  51. position: relative;
  52. &.active,
  53. &._active {
  54. .admin__action-dropdown {
  55. border-color: @action-dropdown__active__border-color;
  56. box-shadow: @component__box-shadow__base;
  57. }
  58. // Dropdown helper to prevent box shadow unnecessary appearing
  59. .admin__action-dropdown-text {
  60. &:after {
  61. background-color: @action-dropdown__background-color;
  62. content: '';
  63. height: @component__shadow-size__base + 1;
  64. position: absolute;
  65. top: 100%;
  66. }
  67. }
  68. .admin__action-dropdown-menu {
  69. display: block;
  70. }
  71. }
  72. &._disabled {
  73. .admin__action-dropdown {
  74. cursor: default;
  75. }
  76. &:hover {
  77. .admin__action-dropdown {
  78. color: @action-dropdown__color;
  79. }
  80. }
  81. }
  82. }
  83. .admin__action-dropdown {
  84. .action-toggle-triangle(
  85. @_dropdown__padding-right: @action-dropdown__padding-right;
  86. );
  87. background-color: @action-dropdown__background-color;
  88. border: 1px solid transparent;
  89. border-bottom: none;
  90. border-radius: 0;
  91. box-shadow: none;
  92. color: @action-dropdown__color;
  93. display: inline-block;
  94. font-size: @action-dropdown__font-size;
  95. font-weight: @font-weight__regular;
  96. letter-spacing: -.025em;
  97. padding: @action-dropdown__padding-top @action-dropdown__padding-right @action-dropdown__padding-bottom @action-dropdown__padding-horizontal;
  98. position: relative;
  99. vertical-align: baseline;
  100. z-index: 2;
  101. &:hover,
  102. &:focus {
  103. background-color: @action-dropdown__background-color;
  104. color: @action-dropdown__hover__color;
  105. text-decoration: none;
  106. }
  107. // Triangle
  108. &:after {
  109. right: @action-dropdown__padding-horizontal;
  110. }
  111. // Icon
  112. &:before {
  113. margin-right: 1rem;
  114. }
  115. }
  116. .admin__action-dropdown-menu {
  117. background-color: @action-dropdown__background-color;
  118. border: 1px solid @action-dropdown__active__border-color;
  119. box-shadow: @component__box-shadow__base;
  120. display: none;
  121. line-height: @line-height__base;
  122. margin-top: -1px;
  123. min-width: 120%;
  124. padding: @action-dropdown-menu__padding-vertical @action-dropdown-menu__padding-horizontal;
  125. position: absolute;
  126. top: 100%;
  127. transition: all @appearing__transition-duration @apperaing__transition-timing-function;
  128. z-index: 1;
  129. > li {
  130. display: block;
  131. > a {
  132. .action-dropdown-menu-link-pattern();
  133. padding: @action-dropdown-menu-link__padding-vertical @action-dropdown-menu-link__padding-horizontal;
  134. }
  135. }
  136. }
  137. // Generic select lists
  138. .selectmenu {
  139. &:extend(.abs-form-control-pattern);
  140. display: inline-block;
  141. padding-left: 1.5rem;
  142. position: relative;
  143. text-align: left;
  144. width: auto;
  145. z-index: 1;
  146. /**
  147. * @codingStandardsIgnoreStart
  148. */
  149. &:hover {
  150. &:extend(.abs-form-control-pattern:hover);
  151. }
  152. &._focus {
  153. &:extend(.abs-form-control-pattern:focus);
  154. }
  155. &._active {
  156. border-color: @action__active__border-color;
  157. z-index: @action-select__z-index;
  158. }
  159. .action-save,
  160. .action-edit,
  161. .action-delete {
  162. .action-icon();
  163. &:before {
  164. &:extend(.abs-icon all);
  165. content: @icon-delete__content;
  166. }
  167. > span {
  168. &:extend(.abs-visually-hidden all);
  169. }
  170. padding: 0 1rem 0 1rem;
  171. }
  172. .action-edit,
  173. .action-delete {
  174. border: 0 solid @color-white;
  175. border-left-width: 1px;
  176. bottom: 0;
  177. position: absolute;
  178. right: 0;
  179. top: 0;
  180. z-index: 1;
  181. &:hover {
  182. border: 0 solid @color-white;
  183. border-left-width: 1px;
  184. }
  185. }
  186. .action-save:before {
  187. content: @icon-arrow-right__content;
  188. }
  189. .action-edit:before {
  190. content: @icon-edit__content;
  191. }
  192. }
  193. .selectmenu-value {
  194. display: inline-block;
  195. input[type='text'] {
  196. .lib-css(appearance, none, 1);
  197. border: 0;
  198. display: inline;
  199. margin: 0;
  200. body._keyfocus &:focus {
  201. box-shadow: none;
  202. }
  203. }
  204. }
  205. .selectmenu-toggle {
  206. .action-toggle-triangle();
  207. background: transparent;
  208. border-width: 0;
  209. bottom: 0;
  210. float: right;
  211. position: absolute;
  212. right: 0;
  213. top: 0;
  214. width: 0;
  215. &:focus,
  216. &:active,
  217. &:hover {
  218. background: transparent;
  219. }
  220. .selectmenu:hover & {
  221. &:before {
  222. &:extend(.abs-form-control-pattern:hover);
  223. }
  224. }
  225. .selectmenu._active &:before {
  226. border-color: @action__active__border-color;
  227. }
  228. .selectmenu._focus &:before {
  229. &:extend(.abs-form-control-pattern:focus);
  230. }
  231. body._keyfocus &:focus {
  232. box-shadow: none;
  233. }
  234. span {
  235. &:extend(.abs-visually-hidden all);
  236. }
  237. &:before {
  238. background: @color-gray89;
  239. border-left: 1px solid @action__border-color;
  240. bottom: 0;
  241. content: '';
  242. display: block;
  243. position: absolute;
  244. right: 0;
  245. top: 0;
  246. width: 3.2rem;
  247. }
  248. }
  249. .selectmenu-items {
  250. background: @action-dropdown__background-color;
  251. border: 1px solid @action__active__border-color;
  252. box-shadow: @component__box-shadow__base;
  253. display: none;
  254. float: left;
  255. left: -1px;
  256. margin-top: 3px;
  257. max-width: 20rem;
  258. min-width: ~'calc(100% + 2px)';
  259. position: absolute;
  260. top: 100%;
  261. &._active {
  262. display: block;
  263. }
  264. ul {
  265. float: left;
  266. list-style-type: none;
  267. margin: 0;
  268. min-width: 100%;
  269. padding: 0;
  270. }
  271. li {
  272. .lib-vendor-prefix-display(flex);
  273. .lib-vendor-prefix-flex-direction(row);
  274. display: flex;
  275. flex-direction: row;
  276. transition: background .2s linear;
  277. &:hover {
  278. background: @action-menu__hover__background-color;
  279. }
  280. &:last-child {
  281. .selectmenu-item-action {
  282. .lib-link();
  283. }
  284. }
  285. }
  286. }
  287. .selectmenu-item {
  288. position: relative;
  289. width: 100%;
  290. z-index: 1;
  291. li._edit > & {
  292. display: none;
  293. }
  294. }
  295. .selectmenu-item-edit {
  296. display: none;
  297. padding: .3rem 4rem .3rem .4rem;
  298. position: relative;
  299. white-space: nowrap;
  300. z-index: 1;
  301. li:last-child & {
  302. padding-right: .4rem;
  303. }
  304. .admin__control-text {
  305. margin: 0;
  306. width: 5.4rem;
  307. }
  308. li._edit & {
  309. display: block;
  310. }
  311. }
  312. .selectmenu-item-action {
  313. .lib-css(appearance, none, 1);
  314. background: transparent;
  315. border: 0;
  316. color: @text__color;
  317. display: block;
  318. font-size: @font-size__base;
  319. font-weight: @font-weight__regular;
  320. min-width: 100%;
  321. padding: 1rem 6rem 1rem 1.5rem;
  322. text-align: left;
  323. transition: background .2s linear;
  324. width: 5rem;
  325. &:hover,
  326. &:focus {
  327. background: @action-menu__hover__background-color;
  328. }
  329. }