_actions-toolbar.less 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. // /**
  2. // * Copyright © Magento, Inc. All rights reserved.
  3. // * See COPYING.txt for license details.
  4. // */
  5. // # Actions toolbar
  6. // Actions toolbar is a set of actions on a page, form and so on that includes primary and/or secondary actions.
  7. // To customize action toolbar <code>.lib-actions-toolbar()</code> mixin is used.
  8. // To implement the Actions toolbar use the following markup
  9. //
  10. // **Sample of using a button + link**
  11. // ``` html
  12. // <div class="actions-toolbar">
  13. // <div class="primary">
  14. // <button type="submit" class="action submit" title="Submit"><span>Submit</span></button>
  15. // </div>
  16. // <div class="secondary">
  17. // <a class="action back" href="#"><span>Back</span></a>
  18. // </div>
  19. // </div>
  20. // ```
  21. //
  22. // **Sample of using a button + button**
  23. // ``` html
  24. // <div class="example-actions-toolbar-1">
  25. // <div class="primary">
  26. // <button type="submit" class="action submit" title="Submit"><span>Redeem Gift Card</span></button>
  27. // </div>
  28. // <div class="secondary">
  29. // <button class="action check" type="button" value="Check status and balance">
  30. // <span>Check status and balance</span>
  31. // </button>
  32. // </div>
  33. // </div>
  34. // ```
  35. .actions-toolbar {
  36. .lib-actions-toolbar();
  37. }
  38. .example-actions-toolbar-1 {
  39. .lib-actions-toolbar();
  40. }
  41. // # Actions toolbar mixin variables
  42. //
  43. // <pre>
  44. // <table>
  45. // <tr>
  46. // <th class="vars_head">Mixin variable</th>
  47. // <th class="vars_head">Global variable</th>
  48. // <th class="vars_head">Default value</th>
  49. // <th class="vars_head">Allowed values</th>
  50. // <th class="vars_head">Comment</th>
  51. // </tr>
  52. // <tr>
  53. // <th>@_actions-toolbar-actions-position</th>
  54. // <td>@actions-toolbar-actions__position</td>
  55. // <td class="vars_value">justify</td>
  56. // <td class="vars_value">justify | left | right | center</td>
  57. // <td>Position for actions in Actions toolbar</td>
  58. // </tr>
  59. // <tr>
  60. // <th>@_actions-toolbar-actions-reverse</th>
  61. // <td>@actions-toolbar-actions__reverse</td>
  62. // <td class="vars_value">false</td>
  63. // <td class="vars_value">true | false</td>
  64. // <td>Reverse primary and secondary blocks position in Actions toolbar</td>
  65. // </tr>
  66. // <tr>
  67. // <th>@_actions-toolbar-margin</th>
  68. // <td>@actions-toolbar__margin</td>
  69. // <td class="vars_value">false</td>
  70. // <td class="vars_value">'' | false | value</td>
  71. // <td>Margins of the Actions toolbar</td>
  72. // </tr>
  73. // <tr>
  74. // <th>@_actions-toolbar-padding</th>
  75. // <td>@actions-toolbar__padding</td>
  76. // <td class="vars_value">false</td>
  77. // <td class="vars_value">'' | false | value</td>
  78. // <td>Paddings of the Actions toolbar</td>
  79. // </tr>
  80. // <tr>
  81. // <th>@_actions-toolbar-actions-margin</th>
  82. // <td>@actions-toolbar-actions__margin</td>
  83. // <td class="vars_value">false</td>
  84. // <td class="vars_value">'' | false | value</td>
  85. // <td>Margins of all .actions in the Actions toolbar</td>
  86. // </tr>
  87. // <tr>
  88. // <th>@_actions-toolbar-primary-actions-margin</th>
  89. // <td>@actions-toolbar-actions-primary__margin</td>
  90. // <td class="vars_value">0 @indent__xs 0 0</td>
  91. // <td class="vars_value">'' | false | value</td>
  92. // <td>Margins of primary .actions in the Actions toolbar</td>
  93. // </tr>
  94. // <tr>
  95. // <th>@_actions-toolbar-secondary-actions-margin</th>
  96. // <td>@actions-toolbar-actions-secondary__margin</td>
  97. // <td class="vars_value">false</td>
  98. // <td class="vars_value">'' | false | value</td>
  99. // <td>Margins of secondary .actions in the Actions toolbar</td>
  100. // </tr>
  101. // <tr>
  102. // <th nowrap="nowrap">@_actions-toolbar-actions-links-margin-top</th>
  103. // <td>@actions-toolbar-actions-links__margin-top</td>
  104. // <td class="vars_value">false</td>
  105. // <td class="vars_value">'' | false | value</td>
  106. // <td>Margin-top for links with class .action in the Actions toolbar</td>
  107. // </tr>
  108. // <tr>
  109. // <th nowrap="nowrap">@_actions-toolbar-primary-actions-links-margin-top</th>
  110. // <td>@actions-toolbar-actions-links-primary__margin-top</td>
  111. // <td class="vars_value">false</td>
  112. // <td class="vars_value">'' | false | value</td>
  113. // <td>Margin-top for primary links with class .action in the Actions toolbar</td>
  114. // </tr>
  115. // <tr>
  116. // <th nowrap="nowrap">@_actions-toolbar-secondary-actions-links-margin-top</th>
  117. // <td>@actions-toolbar-actions-secondary__margin</td>
  118. // <td class="vars_value">6px</td>
  119. // <td class="vars_value">'' | false | value</td>
  120. // <td>Margin-top for secondary links with class .action in the Actions toolbar</td>
  121. // </tr>
  122. // </table>
  123. // </pre>
  124. //
  125. // # Actions toolbar alignment
  126. //
  127. // <code>@_actions-toolbar-actions-position</code> variable controls aligning actions toolbar elements. It can be set to:
  128. // ```css
  129. // justify | left | right | center
  130. // ```
  131. //
  132. // **Justify:**
  133. // ```css
  134. // @_actions-toolbar-actions-position: justify
  135. // ```
  136. // ``` html
  137. // <div class="example-actions-toolbar-2">
  138. // <div class="primary">
  139. // <button type="submit" class="action submit" title="Submit"><span>Submit</span></button>
  140. // </div>
  141. // <div class="secondary">
  142. // <a class="action back" href="#"><span>Back</span></a>
  143. // </div>
  144. // </div>
  145. // ```
  146. //
  147. // **Align toolbar elements left:**
  148. // ```css
  149. // @_actions-toolbar-actions-position: left
  150. // ```
  151. // ``` html
  152. // <div class="example-actions-toolbar-3">
  153. // <div class="primary">
  154. // <button type="submit" class="action submit" title="Submit"><span>Submit</span></button>
  155. // </div>
  156. // <div class="secondary">
  157. // <a class="action back" href="#"><span>Back</span></a>
  158. // </div>
  159. // </div>
  160. // ```
  161. //
  162. // **Align toolbar elements right:**
  163. // ```css
  164. // @_actions-toolbar-actions-position: right
  165. // ```
  166. // ``` html
  167. // <div class="example-actions-toolbar-4">
  168. // <div class="primary">
  169. // <button type="submit" class="action submit" title="Submit"><span>Submit</span></button>
  170. // </div>
  171. // <div class="secondary">
  172. // <a class="action back" href="#"><span>Back</span></a>
  173. // </div>
  174. // </div>
  175. // ```
  176. //
  177. // **Center:**
  178. // ```css
  179. // @_actions-toolbar-actions-position: center
  180. // ```
  181. // ``` html
  182. // <div class="example-actions-toolbar-5">
  183. // <div class="primary">
  184. // <button type="submit" class="action submit" title="Submit"><span>Submit</span></button>
  185. // </div>
  186. // <div class="secondary">
  187. // <a class="action back" href="#"><span>Back</span></a>
  188. // </div>
  189. // </div>
  190. // ```
  191. .example-actions-toolbar-2 {
  192. .lib-actions-toolbar(
  193. @_actions-toolbar-actions-position: justify
  194. );
  195. }
  196. .example-actions-toolbar-3 {
  197. .lib-actions-toolbar(
  198. @_actions-toolbar-actions-position: left
  199. );
  200. }
  201. .example-actions-toolbar-4 {
  202. .lib-actions-toolbar(
  203. @_actions-toolbar-actions-position: right
  204. );
  205. }
  206. .example-actions-toolbar-5 {
  207. .lib-actions-toolbar(
  208. @_actions-toolbar-actions-position: center
  209. );
  210. }
  211. // # Reverse primary and secondary blocks
  212. //
  213. // <code>@_actions-toolbar-actions-reverse</code> variable controls reversing of primary and secondary blocks.
  214. //
  215. // If it is set to <code>false</code>, the order of blocks in action toolbar is **default**.
  216. //
  217. // If it is set to <code>true</code>, the order of blocks in action toolbar is **reversed**.
  218. //
  219. // **Justify toolbar elements and reverse them:**
  220. // ```css
  221. // @_actions-toolbar-actions-position: justify,
  222. // @_actions-toolbar-actions-reverse: true
  223. // ```
  224. // ``` html
  225. // <div class="example-actions-toolbar-6">
  226. // <div class="primary">
  227. // <button type="submit" class="action submit" title="Submit"><span>Submit</span></button>
  228. // </div>
  229. // <div class="secondary">
  230. // <a class="action back" href="#"><span>Back</span></a>
  231. // </div>
  232. // </div>
  233. // ```
  234. //
  235. // **Align toolbar elements to the left and reverse them:**
  236. // ```css
  237. // @_actions-toolbar-actions-position: left,
  238. // @_actions-toolbar-actions-reverse: true
  239. // ```
  240. // ``` html
  241. // <div class="example-actions-toolbar-7">
  242. // <div class="primary">
  243. // <button type="submit" class="action submit" title="Submit"><span>Submit</span></button>
  244. // </div>
  245. // <div class="secondary">
  246. // <a class="action back" href="#"><span>Back</span></a>
  247. // </div>
  248. // </div>
  249. // ```
  250. //
  251. // **Align toolbar elements to the right and reverse them:**
  252. // ```css
  253. // @_actions-toolbar-actions-position: right,
  254. // @_actions-toolbar-actions-reverse: true
  255. // ```
  256. // ``` html
  257. // <div class="example-actions-toolbar-8">
  258. // <div class="primary">
  259. // <button type="submit" class="action submit" title="Submit"><span>Submit</span></button>
  260. // </div>
  261. // <div class="secondary">
  262. // <a class="action back" href="#"><span>Back</span></a>
  263. // </div>
  264. // </div>
  265. // ```
  266. .example-actions-toolbar-6 {
  267. .lib-actions-toolbar(
  268. @_actions-toolbar-actions-position: justify,
  269. @_actions-toolbar-actions-reverse: true
  270. );
  271. }
  272. .example-actions-toolbar-7 {
  273. .lib-actions-toolbar(
  274. @_actions-toolbar-actions-position: left,
  275. @_actions-toolbar-actions-reverse: true
  276. );
  277. }
  278. .example-actions-toolbar-8 {
  279. .lib-actions-toolbar(
  280. @_actions-toolbar-actions-position: right,
  281. @_actions-toolbar-actions-reverse: true
  282. );
  283. }
  284. // # Actions toolbar indents customizations
  285. //
  286. // <code>@_actions-toolbar-margin</code> variable controls margins of the actions toolbar wrapper.
  287. //
  288. // <code>@_actions-toolbar-padding</code> variable controls paddings of the actions toolbar wrapper.
  289. //
  290. // ``` html
  291. // <div class="example-actions-toolbar-9">
  292. // <div class="primary">
  293. // <button type="submit" class="action submit" title="Submit"><span>Submit</span></button>
  294. // </div>
  295. // <div class="secondary">
  296. // <a class="action back" href="#"><span>Back</span></a>
  297. // </div>
  298. // </div>
  299. // ```
  300. //
  301. // <code>@_actions-toolbar-primary-actions-margin</code> variable controls margins of the primary action elements.
  302. //
  303. // ``` html
  304. // <div class=" example-actions-toolbar-10">
  305. // <div class="primary">
  306. // <button type="submit" class="action submit" title="Submit"><span>Submit</span></button>
  307. // <button type="submit" class="action submit2" title="Submit2"><span>Submit2</span></button>
  308. // </div>
  309. // <div class="secondary">
  310. // <a href="#" class="action towishlist"><span>Add to Wish List</span></a>
  311. // <a href="#" class="action tocompare"><span>Add to Compare</span></a>
  312. // </div>
  313. // </div>
  314. // ```
  315. //
  316. // <code>@_actions-toolbar-secondary-actions-margin</code> variable controls margins of the secondary action elements.
  317. //
  318. // ``` html
  319. // <div class="example-actions-toolbar-11">
  320. // <div class="primary">
  321. // <button type="submit" class="action submit" title="Submit"><span>Submit</span></button>
  322. // <button type="submit" class="action submit2" title="Submit2"><span>Submit2</span></button>
  323. // </div>
  324. // <div class="secondary">
  325. // <a href="#" class="action towishlist"><span>Add to Wish List</span></a>
  326. // <a href="#" class="action tocompare"><span>Add to Compare</span></a>
  327. // </div>
  328. // </div>
  329. // ```
  330. .example-actions-toolbar-9 {
  331. .lib-actions-toolbar(
  332. @_actions-toolbar-margin: 10px,
  333. @_actions-toolbar-padding: 10px
  334. );
  335. }
  336. .example-actions-toolbar-10 {
  337. .lib-actions-toolbar(
  338. @_actions-toolbar-actions-position: left,
  339. @_actions-toolbar-primary-actions-margin: 0 50px 0 0
  340. );
  341. }
  342. .example-actions-toolbar-11 {
  343. .lib-actions-toolbar(
  344. @_actions-toolbar-actions-position: left,
  345. @_actions-toolbar-secondary-actions-margin: 0 50px 0 0
  346. );
  347. }
  348. // # Responsive actions toolbar
  349. //
  350. // To set up responsive action toolbar, all floats of its elements should be cleared. To do this <code>.lib-actions-toolbar-clear-floats()</code> mixin is used.
  351. //
  352. // ``` html
  353. // <div class="example-actions-toolbar-12">
  354. // <div class="primary">
  355. // <button type="submit" class="action submit" title="Submit"><span>Submit</span></button>
  356. // </div>
  357. // <div class="secondary">
  358. // <a href="#" class="action towishlist"><span>Add to Wish List</span></a>
  359. // </div>
  360. // </div>
  361. // ```
  362. .example-actions-toolbar-12 {
  363. .lib-actions-toolbar();
  364. }
  365. @media only screen and (max-width: @screen__m) {
  366. .example-actions-toolbar-12 {
  367. .lib-actions-toolbar-clear-floats();
  368. }
  369. }