_actions.less 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. // /**
  2. // * Copyright © Magento, Inc. All rights reserved.
  3. // * See COPYING.txt for license details.
  4. // */
  5. //
  6. // Imports
  7. // _____________________________________________
  8. @import 'actions/_actions-dropdown.less';
  9. @import 'actions/_actions-split.less';
  10. @import 'actions/_actions-select.less';
  11. @import 'actions/_actions-multicheck.less';
  12. @import 'actions/_actions-multiselect.less';
  13. @import 'actions/_actions-switcher.less';
  14. //
  15. // Extends
  16. // _____________________________________________
  17. .abs-action-reset {
  18. .action-reset();
  19. }
  20. .abs-action-pattern {
  21. &[disabled],
  22. &.disabled {
  23. cursor: default;
  24. opacity: @disabled__opacity;
  25. pointer-events: none;
  26. }
  27. border: @button__border-size @button__border-style;
  28. border-radius: 0; // ToDo UI Delete with admin scope
  29. display: inline-block;
  30. font-family: @button__font-family;
  31. font-size: @button__font-size;
  32. font-weight: @font-weight__semibold;
  33. line-height: @button__line-height;
  34. padding: @button__padding-top @button__padding-horizontal @button__padding-bottom;
  35. text-align: center;
  36. vertical-align: baseline;
  37. }
  38. .abs-action-l {
  39. font-size: @font-size__l;
  40. letter-spacing: .025em;
  41. padding-bottom: @button__padding-vertical__l;
  42. padding-top: @button__padding-vertical__l;
  43. }
  44. .abs-action-delete {
  45. &:extend(.abs-action-reset all);
  46. &:extend(.abs-icon all);
  47. display: inline-block;
  48. font-size: 1.6rem;
  49. margin-left: 1.2rem;
  50. padding-top: .7rem;
  51. text-decoration: none;
  52. vertical-align: middle;
  53. &:after {
  54. color: @color-very-dark-gray;
  55. content: @icon-delete__content;
  56. }
  57. &:hover {
  58. &:after {
  59. color: @color-very-dark-gray-black2;
  60. }
  61. }
  62. > span {
  63. &:extend(.abs-visually-hidden all);
  64. }
  65. }
  66. .abs-action-button-as-link {
  67. .lib-button-as-link(@_margin: false);
  68. .lib-css(font-weight, @font-weight__regular);
  69. border-radius: 0;
  70. &:active,
  71. &:not(:focus) {
  72. box-shadow: none;
  73. }
  74. &:focus {
  75. color: @link__hover__color;
  76. }
  77. }
  78. .abs-action-default {
  79. .action-default();
  80. }
  81. .abs-action-primary {
  82. .action-primary();
  83. }
  84. .abs-action-secondary {
  85. .action-secondary();
  86. }
  87. .abs-action-tertiary {
  88. .action-tertiary();
  89. }
  90. .abs-action-quaternary {
  91. .action-quaternary();
  92. }
  93. .abs-action-menu {
  94. .action-menu();
  95. }
  96. // Triangle Wrap
  97. .abs-action-wrap-triangle {
  98. position: relative;
  99. .action-default {
  100. width: 100%;
  101. &:before,
  102. &:after {
  103. border-style: solid;
  104. content: '';
  105. height: 0;
  106. position: absolute;
  107. top: 0;
  108. width: 0;
  109. }
  110. &:active,
  111. &:hover,
  112. &:focus {
  113. box-shadow: none;
  114. }
  115. &:focus {
  116. ._keyfocus & {
  117. box-shadow: @button__hover__box-shadow;
  118. }
  119. }
  120. }
  121. }
  122. // Right Triangle
  123. .abs-action-wrap-triangle-right {
  124. display: inline-block;
  125. padding-right: @button-triangle__base__size - .1;
  126. position: relative;
  127. .action-default {
  128. &:before,
  129. &:after {
  130. border-color: transparent transparent transparent @button__background-color;
  131. border-width: @button-triangle__base__size 0 (@button-triangle__base__size - .1) @button-triangle__base__size;
  132. left: 100%;
  133. margin-left: -(@button-triangle__base__size);
  134. }
  135. &:before {
  136. border-left-color: @button-triangle__base__border-color;
  137. right: -1px;
  138. }
  139. &:hover,
  140. &:active,
  141. &:focus {
  142. &:after {
  143. border-left-color: @button__hover__background-color;
  144. }
  145. }
  146. }
  147. .action-primary {
  148. &:after {
  149. border-color: transparent transparent transparent @button-primary__background-color;
  150. }
  151. &:hover,
  152. &:active,
  153. &:focus {
  154. &:after {
  155. border-left-color: @button-primary__hover__background-color;
  156. }
  157. }
  158. }
  159. }
  160. // Left Triangle
  161. .abs-action-wrap-triangle-left {
  162. display: inline-block;
  163. padding-left: @button-triangle__base__size - .1;
  164. .action-default {
  165. text-indent: -(@button-triangle__base__size) / 2;
  166. &:before,
  167. &:after {
  168. border-color: transparent @button__background-color transparent transparent;
  169. border-width: @button-triangle__base__size @button-triangle__base__size (@button-triangle__base__size - .1) 0;
  170. margin-right: -(@button-triangle__base__size);
  171. right: 100%;
  172. }
  173. &:before {
  174. border-right-color: @button-triangle__base__border-color;
  175. left: -1px;
  176. }
  177. &:hover,
  178. &:active,
  179. &:focus {
  180. &:after {
  181. border-right-color: @button__hover__background-color;
  182. }
  183. }
  184. }
  185. .action-primary {
  186. &:after {
  187. border-color: transparent @button-primary__background-color transparent transparent;
  188. }
  189. &:hover,
  190. &:active,
  191. &:focus {
  192. &:after {
  193. border-right-color: @button-primary__hover__background-color;
  194. }
  195. }
  196. }
  197. }
  198. //
  199. // Default action
  200. // ---------------------------------------------
  201. .action-default,
  202. button {
  203. &:extend(.abs-action-pattern all);
  204. background: @button__background-color;
  205. border-color: @button__border-color;
  206. color: @button__color;
  207. &:hover,
  208. &:active,
  209. &:focus {
  210. background-color: @button__hover__background-color;
  211. color: @button__color;
  212. text-decoration: none;
  213. }
  214. }
  215. //
  216. // Primary action
  217. // ---------------------------------------------
  218. .action-primary {
  219. &:extend(.abs-action-pattern all);
  220. background-color: @button-primary__background-color;
  221. border-color: @button-primary__background-color;
  222. color: @button-primary__color;
  223. text-shadow: 1px 1px 0 rgba(0, 0, 0, .25);
  224. &:hover,
  225. &:active,
  226. &:focus {
  227. background-color: @button-primary__hover__background-color;
  228. border-color: @button-primary__hover__border-color;
  229. box-shadow: @button__hover__box-shadow;
  230. color: @button-primary__color;
  231. text-decoration: none;
  232. }
  233. &.disabled,
  234. &[disabled] {
  235. cursor: default;
  236. opacity: @disabled__opacity;
  237. pointer-events: none;
  238. }
  239. }
  240. //
  241. // Secondary action
  242. // ---------------------------------------------
  243. .action-secondary {
  244. &:extend(.abs-action-pattern all);
  245. background-color: @button-secondary__background-color;
  246. border-color: @button-secondary__border-color;
  247. color: @button-secondary__color;
  248. text-shadow: 1px 1px 1px rgba(0, 0, 0, .3);
  249. &:hover,
  250. &:active,
  251. &:focus {
  252. background-color: @button-secondary__hover__background-color;
  253. border-color: @button-secondary__hover__border-color;
  254. box-shadow: @button__hover__box-shadow;
  255. color: @button-secondary__color;
  256. text-decoration: none;
  257. }
  258. &:active {
  259. background-color: @button-secondary__active__background-color;
  260. }
  261. }
  262. //
  263. // Tertiary action & Quaternary action
  264. // ---------------------------------------------
  265. .action-tertiary,
  266. .action-quaternary {
  267. &:extend(.abs-action-pattern all);
  268. background-color: transparent;
  269. border-color: transparent;
  270. text-shadow: none;
  271. &:active,
  272. &:hover,
  273. &:focus {
  274. background-color: transparent;
  275. border-color: transparent;
  276. box-shadow: none;
  277. }
  278. }
  279. .action-tertiary {
  280. color: @link__color;
  281. &:active,
  282. &:hover,
  283. &:focus {
  284. color: @link__hover__color;
  285. text-decoration: underline;
  286. }
  287. }
  288. .action-quaternary {
  289. color: @text__color;
  290. &:active,
  291. &:hover,
  292. &:focus {
  293. color: darken(@text__color, 10%);
  294. }
  295. }
  296. //
  297. // Specific actions
  298. // ---------------------------------------------
  299. .action-close {
  300. > span {
  301. .hidden();
  302. }
  303. &:extend(.abs-action-reset all);
  304. &:active {
  305. .scale();
  306. }
  307. &:before {
  308. &:extend(.abs-icon all);
  309. content: @icon-close-mage__content;
  310. .transition(color);
  311. }
  312. &:hover {
  313. cursor: pointer;
  314. text-decoration: none;
  315. }
  316. }
  317. .action-basic {
  318. &:extend(.abs-action-secondary all);
  319. }
  320. .action-additional {
  321. &:extend(.abs-action-button-as-link all);
  322. }
  323. //
  324. // Action menu
  325. // ---------------------------------------------
  326. // Used in actions split, action select and all other simple (one line) action menu list
  327. .action-menu {
  328. background-color: @page-wrapper__background-color;
  329. border: 1px solid @action__active__border-color;
  330. border-radius: 1px;
  331. box-shadow: @component__box-shadow__base;
  332. color: @text__color;
  333. display: none;
  334. font-weight: @font-weight__regular;
  335. left: 0;
  336. list-style: none;
  337. margin: 2px 0 0; // Action box-shadow + 1px indent
  338. min-width: 0; // ToDo UI Should be deleted with old styles
  339. padding: 0;
  340. position: absolute;
  341. right: 0;
  342. top: 100%;
  343. &._active {
  344. display: block;
  345. }
  346. > li {
  347. border: none; // ToDo UI Should be deleted with old styles
  348. display: block;
  349. padding: 0;
  350. transition: background-color .1s linear;
  351. > a {
  352. &:hover {
  353. text-decoration: none;
  354. }
  355. }
  356. &._visible {
  357. background-color: @action-menu__hover__background-color;
  358. }
  359. &:hover {
  360. background-color: @action-menu__hover__background-color;
  361. }
  362. &:active {
  363. background-color: darken(@action-menu__hover__background-color, 10%);
  364. }
  365. &._parent {
  366. .lib-vendor-prefix-display(flex);
  367. .lib-vendor-prefix-flex-direction(row);
  368. display: flex;
  369. flex-direction: row;
  370. > .action-menu-item {
  371. min-width: 100%;
  372. }
  373. }
  374. }
  375. .item,
  376. .action-menu-item {
  377. cursor: pointer;
  378. display: block;
  379. padding: .6875em 1em;
  380. }
  381. .action-submenu {
  382. &:extend(.action-menu all);
  383. bottom: auto;
  384. left: auto;
  385. margin-left: 0;
  386. margin-top: -1px;
  387. position: absolute;
  388. right: auto;
  389. top: auto;
  390. }
  391. a {
  392. &.action-menu-item {
  393. color: @text__color;
  394. &:focus {
  395. background-color: @action-menu__hover__background-color;
  396. box-shadow: none;
  397. }
  398. }
  399. }
  400. }
  401. //
  402. // ToDo UI: Button migration
  403. // _____________________________________________
  404. button {
  405. &:extend(.abs-action-default all);
  406. &.primary {
  407. &:extend(.abs-action-primary all);
  408. }
  409. &.secondary {
  410. &:extend(.abs-action-secondary all);
  411. }
  412. &.tertiary {
  413. &:extend(.abs-action-tertiary all);
  414. }
  415. }