_buttons.less 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004
  1. // /**
  2. // * Copyright © Magento, Inc. All rights reserved.
  3. // * See COPYING.txt for license details.
  4. // */
  5. // # Default button
  6. //
  7. // Default style for buttons is set by the <code>.lib-button()</code> mixin. The mixin is called in <code>.lib-magento-reset()</code> or it can be called directly.
  8. //
  9. // ## Default button large
  10. // ```html
  11. // <button class="example-button-1 example-button-2" type="button"><span>Button</span></button>
  12. // <button class="example-button-1 example-button-2 :hover" type="button"><span>Hover</span></button>
  13. // <button class="example-button-1 example-button-2 :active" type="button"><span>Active</span></button>
  14. // <button class="example-button-1 example-button-2" type="button" disabled><span>Disabled</span></button>
  15. // ```
  16. //
  17. // ## Default button
  18. // ```html
  19. // <button class="example-button-1" type="button"><span>Button</span></button>
  20. // <button class="example-button-1 :hover" type="button"><span>Hover</span></button>
  21. // <button class="example-button-1 :active" type="button"><span>Active</span></button>
  22. // <button class="example-button-1" type="button" disabled><span>Disabled</span></button>
  23. // ```
  24. //
  25. // ## Default button small
  26. // ```html
  27. // <button class="example-button-1 example-button-3" type="button"><span>Button</span></button>
  28. // <button class="example-button-1 example-button-3 :hover" type="button"><span>Hover</span></button>
  29. // <button class="example-button-1 example-button-3 :active" type="button"><span>Active</span></button>
  30. // <button class="example-button-1 example-button-3" type="button" disabled><span>Disabled</span></button>
  31. // ```
  32. //
  33. button {
  34. .lib-button(@_button-margin: 3px);
  35. border-radius: 3px;
  36. &:active,
  37. &:focus {
  38. box-shadow: inset 0 2px 1px rgba(0,0,0,.12);
  39. }
  40. }
  41. .example-button-1 {
  42. &.example-button-2 {
  43. .lib-button-l();
  44. }
  45. &.example-button-3 {
  46. .lib-button-s();
  47. border-radius: 0;
  48. color: @color-black;
  49. &:hover,
  50. &.active {
  51. color: @color-black;
  52. }
  53. }
  54. }
  55. // # Button variables
  56. //
  57. // <pre>
  58. // <table>
  59. // <tr>
  60. // <th class="vars_head">Mixin variable</th>
  61. // <th class="vars_head">Global variable</th>
  62. // <th class="vars_head">Default value</th>
  63. // <th class="vars_head">Allowed values</th>
  64. // <th class="vars_head">Comment</th>
  65. // </tr>
  66. // <tr>
  67. // <th>@_button-font-family</th>
  68. // <td>@button__font-family</td>
  69. // <td class="vars_value">@font-family__base</td>
  70. // <td class="vars_value">'' | false | value</td>
  71. // <td>Button font family</td>
  72. // </tr>
  73. // <tr>
  74. // <th>@_button-font-size</th>
  75. // <td>@button__font-size</td>
  76. // <td class="vars_value">@font-size__base</td>
  77. // <td class="vars_value">'' | false | value</td>
  78. // <td>Button font size</td>
  79. // </tr>
  80. // <tr>
  81. // <th>@_button-font-weight</th>
  82. // <td>@button__font-weight</td>
  83. // <td class="vars_value">@font-weight__bold</td>
  84. // <td class="vars_value">'' | false | value</td>
  85. // <td>Button font weight</td>
  86. // </tr>
  87. // <tr>
  88. // <th>@_button-cursor</th>
  89. // <td>@button__cursor</td>
  90. // <td class="vars_value">pointer</td>
  91. // <td class="vars_value">'' | false | value</td>
  92. // <td>Button cursor</td>
  93. // </tr>
  94. // <tr>
  95. // <th>@_button-display</th>
  96. // <td>@button__display</td>
  97. // <td class="vars_value">inline-block</td>
  98. // <td class="vars_value">'' | false | value</td>
  99. // <td>Button display</td>
  100. // </tr>
  101. // <tr>
  102. // <th>@_button-disabled-opacity</th>
  103. // <td>@button__disabled__opacity</td>
  104. // <td class="vars_value">.5</td>
  105. // <td class="vars_value">'' | false | value</td>
  106. // <td>Button disabled opacity</td>
  107. // </tr>
  108. // <tr>
  109. // <th>@_button-line-height</th>
  110. // <td>@button__line-height</td>
  111. // <td class="vars_value">@font-size__base + 2</td>
  112. // <td class="vars_value">'' | false | value</td>
  113. // <td>Button height</td>
  114. // </tr>
  115. // <tr>
  116. // <th>@_button-width</th>
  117. // <td>@button__width</td>
  118. // <td class="vars_value">false</td>
  119. // <td class="vars_value">'' | false | value</td>
  120. // <td>Button width</td>
  121. // </tr>
  122. // <tr>
  123. // <th>@_button-margin</th>
  124. // <td>@button__margin</td>
  125. // <td class="vars_value">0</td>
  126. // <td class="vars_value">'' | false | value</td>
  127. // <td>Button margin</td>
  128. // </tr>
  129. // <tr>
  130. // <th>@_button-padding</th>
  131. // <td>@button__padding</td>
  132. // <td class="vars_value">7px 15px</td>
  133. // <td class="vars_value">'' | false | value</td>
  134. // <td>Button padding</td>
  135. // </tr>
  136. // <tr>
  137. // <th>@_button-gradient</th>
  138. // <td>@button__gradient</td>
  139. // <td class="vars_value">false</td>
  140. // <td class="vars_value">'' | false | true</td>
  141. // <td>Button has gradient background</td>
  142. // </tr>
  143. // <tr>
  144. // <th>@_button-gradient-direction</th>
  145. // <td>@button__gradient-direction</td>
  146. // <td class="vars_value">false</td>
  147. // <td class="vars_value">'' | false | vertical | horizontal</td>
  148. // <td>Direction of button background gradient (if there is any)</td>
  149. // </tr>
  150. // <tr>
  151. // <th colspan="5" class="vars_section">Button default state</th>
  152. // </tr>
  153. // <tr>
  154. // <th>@_button-color</th>
  155. // <td>@button__color</td>
  156. // <td class="vars_value">@primary__color</td>
  157. // <td class="vars_value">'' | false | value</td>
  158. // <td>Button text color</td>
  159. // </tr>
  160. // <tr>
  161. // <th>@_button-background</th>
  162. // <td>@button__background</td>
  163. // <td class="vars_value">#f2f2f2</td>
  164. // <td class="vars_value">'' | false | value</td>
  165. // <td>Button background</td>
  166. // </tr>
  167. // <tr>
  168. // <th>@_button-border</th>
  169. // <td>@button__border</td>
  170. // <td class="vars_value">1px solid #cdcdcd</td>
  171. // <td class="vars_value">'' | false | value</td>
  172. // <td>Button border</td>
  173. // </tr>
  174. // <tr>
  175. // <th>@_button-gradient-color-start</th>
  176. // <td>@button__gradient-color-start</td>
  177. // <td class="vars_value">false</td>
  178. // <td class="vars_value">'' | false | value</td>
  179. // <td>Gradient background start color</td>
  180. // </tr>
  181. // <tr>
  182. // <th>@_button-gradient-color-end</th>
  183. // <td>@button__gradient-color-end</td>
  184. // <td class="vars_value">false</td>
  185. // <td class="vars_value">'' | false | value</td>
  186. // <td>Gradient background end color</td>
  187. // </tr>
  188. // <tr>
  189. // <th colspan="5" class="vars_section">Button hover state</th>
  190. // </tr>
  191. // <tr>
  192. // <th>@_button-color-hover</th>
  193. // <td>@button__hover__color</td>
  194. // <td class="vars_value">#555</td>
  195. // <td class="vars_value">'' | false | value</td>
  196. // <td>Hovered button text color</td>
  197. // </tr>
  198. // <tr>
  199. // <th>@_button-background-hover</th>
  200. // <td>@button__hover__background</td>
  201. // <td class="vars_value">#e2e2e2</td>
  202. // <td class="vars_value">'' | false | value</td>
  203. // <td>Hovered button background</td>
  204. // </tr>
  205. // <tr>
  206. // <th>@_button-border-hover</th>
  207. // <td>@button__hover__border</td>
  208. // <td class="vars_value">@button__border</td>
  209. // <td class="vars_value">'' | false | value</td>
  210. // <td>Hovered button border</td>
  211. // </tr>
  212. // <tr>
  213. // <th nowrap="nowrap">@_button-gradient-color-start-hover</th>
  214. // <td>@button__hover__gradient-color-start</td>
  215. // <td class="vars_value">false</td>
  216. // <td class="vars_value">'' | false | value</td>
  217. // <td>Hovered button gradient background start color</td>
  218. // </tr>
  219. // <tr>
  220. // <th>@_button-gradient-color-end-hover</th>
  221. // <td>@button__hover__gradient-color-end</td>
  222. // <td class="vars_value">false</td>
  223. // <td class="vars_value">'' | false | value</td>
  224. // <td>Hovered button gradient background end color</td>
  225. // </tr>
  226. // <tr>
  227. // <th colspan="5" class="vars_section">Button active state</th>
  228. // </tr>
  229. // <tr>
  230. // <th>@_button-color-active</th>
  231. // <td>@button__active__color</td>
  232. // <td class="vars_value">@button__color</td>
  233. // <td class="vars_value">'' | false | value</td>
  234. // <td>Active button text color</td>
  235. // </tr>
  236. // <tr>
  237. // <th>@_button-background-active</th>
  238. // <td>@button__active__background</td>
  239. // <td class="vars_value">@button__hover__background</td>
  240. // <td class="vars_value">'' | false | value</td>
  241. // <td>Active button background</td>
  242. // </tr>
  243. // <tr>
  244. // <th>@_button-border-active</th>
  245. // <td>@button__active__border</td>
  246. // <td class="vars_value">@button__border</td>
  247. // <td class="vars_value">'' | false | value</td>
  248. // <td>Active button border</td>
  249. // </tr>
  250. // <tr>
  251. // <th>@_button-gradient-color-start-active<br /></th>
  252. // <td>@button__active__gradient-color-start</td>
  253. // <td class="vars_value">false</td>
  254. // <td class="vars_value">'' | false | value</td>
  255. // <td>Active button gradient background start color</td>
  256. // </tr>
  257. // <tr>
  258. // <th>@_button-gradient-color-end-active</th>
  259. // <td>@button__active__gradient-color-end</td>
  260. // <td class="vars_value">false</td>
  261. // <td class="vars_value">'' | false | value</td>
  262. // <td>Active button gradient background end color</td>
  263. // </tr>
  264. // <tr>
  265. // <th colspan="5" class="vars_section">Button with icon</th>
  266. // </tr>
  267. // <tr>
  268. // <th>@_button-icon-use</th>
  269. // <td>@button-icon__use</td>
  270. // <td class="vars_value">false</td>
  271. // <td class="vars_value">'' | false | true</td>
  272. // <td>Button has an icon</td>
  273. // </tr>
  274. // <tr>
  275. // <th>@_button-font-content</th>
  276. // <td>@button-icon__content</td>
  277. // <td class="vars_value">@icon-settings</td>
  278. // <td class="vars_value">'' | false | value</td>
  279. // <td>Button icon symbol</td>
  280. // </tr>
  281. // <tr>
  282. // <th>@_button-icon-font</th>
  283. // <td>@button-icon__font</td>
  284. // <td class="vars_value">@icon-font</td>
  285. // <td class="vars_value">'' | false | value</td>
  286. // <td>Button icon font</td>
  287. // </tr>
  288. // <tr>
  289. // <th>@_button-icon-font-size</th>
  290. // <td>@button-icon__font-size</td>
  291. // <td class="vars_value">22px</td>
  292. // <td class="vars_value">'' | false | value</td>
  293. // <td>Button icon font size</td>
  294. // </tr>
  295. // <tr>
  296. // <th>@_button-icon-font-line-height</th>
  297. // <td>@button-icon__line-height</td>
  298. // <td class="vars_value" nowrap="nowrap">@button-icon__font-size</td>
  299. // <td class="vars_value">'' | false | value</td>
  300. // <td>Button icon line height</td>
  301. // </tr>
  302. // <tr>
  303. // <th>@_button-icon-font-color</th>
  304. // <td>@button-icon__color</td>
  305. // <td class="vars_value">inherit</td>
  306. // <td class="vars_value">'' | false | value</td>
  307. // <td>Button icon color</td>
  308. // </tr>
  309. // <tr>
  310. // <th>@_button-icon-font-color-hover</th>
  311. // <td>@button-icon__hover__font-color</td>
  312. // <td class="vars_value">inherit</td>
  313. // <td class="vars_value">'' | false | value</td>
  314. // <td>Hovered button icon color</td>
  315. // </tr>
  316. // <tr>
  317. // <th>@_button-icon-font-color-active</th>
  318. // <td>@button-icon__active__font-color</td>
  319. // <td class="vars_value">inherit</td>
  320. // <td class="vars_value">'' | false | value</td>
  321. // <td>Active button icon color</td>
  322. // </tr>
  323. // <tr>
  324. // <th>@_button-icon-font-margin</th>
  325. // <td>@button-icon__margin</td>
  326. // <td class="vars_value">0</td>
  327. // <td class="vars_value">'' | false | value</td>
  328. // <td>Button icon margin</td>
  329. // </tr>
  330. // <tr>
  331. // <th>@_button-icon-font-vertical-align</th>
  332. // <td>@button-icon__vertical-align</td>
  333. // <td class="vars_value">top</td>
  334. // <td class="vars_value">'' | false | value</td>
  335. // <td>Button icon vertical align</td>
  336. // </tr>
  337. // <tr>
  338. // <th>@_button-icon-font-position</th>
  339. // <td>@button-icon__position</td>
  340. // <td class="vars_value">@icon__position</td>
  341. // <td class="vars_value">'' | false | before | after</td>
  342. // <td>Button icon font position</td>
  343. // </tr>
  344. // <tr>
  345. // <th>@_button-icon-font-text-hide</th>
  346. // <td>@button-icon__text-hide</td>
  347. // <td class="vars_value">false</td>
  348. // <td class="vars_value">'' | false | true</td>
  349. // <td>Button icon text hide</td>
  350. // </tr>
  351. // </table>
  352. // </pre>
  353. //
  354. // # Button as an icon
  355. //
  356. // To make a button look like an icon you need to:
  357. //
  358. // enable icon:
  359. // ```css
  360. // @_button-icon-use: true
  361. // ```
  362. // set the font icon code:
  363. // ```css
  364. // @_button-font-content: @icon-cart
  365. // ```
  366. // hide button text:
  367. // ```css
  368. // @_button-icon-font-text-hide: true
  369. // ```
  370. //
  371. // ```html
  372. // <button class="example-button-10" type="button">
  373. // <span>Add to cart</span>
  374. // </button>
  375. // <button class="example-button-10 :hover" type="button">
  376. // <span>Add to cart</span>
  377. // </button>
  378. // <button class="example-button-10 :active" type="button">
  379. // <span>Add to cart</span>
  380. // </button>
  381. // ```
  382. //
  383. .example-button-10 {
  384. .lib-button(
  385. @_button-margin: 3px,
  386. @_button-icon-use: true,
  387. @_button-font-content: @icon-cart,
  388. @_button-icon-font-text-hide: true
  389. );
  390. .lib-button-reset();
  391. }
  392. // # Button with an icon on the left or right side of the text
  393. //
  394. // <code>@_button-icon-font-position</code> variable is used to set up the icon position
  395. //
  396. // Use <code>before</code> to set up button icon position on the left:
  397. // ```css
  398. // @_button-icon-font-position: before
  399. // ```
  400. //
  401. // ```html
  402. // <button class="example-button-11" type="button" title="Add to cart">
  403. // <span>Button</span>
  404. // </button>
  405. // <button class="example-button-11 :hover" type="button" title="Add to cart">
  406. // <span>Hover</span>
  407. // </button>
  408. // <button class="example-button-11 :active" type="button" title="Add to cart">
  409. // <span>Active</span>
  410. // </button>
  411. // <button class="example-button-11 disabled" type="button" title="Add to cart">
  412. // <span>Disabled</span>
  413. // </button>
  414. // ```
  415. // Use <code>after</code> to set up button icon position on the right:
  416. // ```css
  417. // @_button-icon-font-position: after
  418. // ```
  419. // ```html
  420. // <button class="example-button-12" type="button" title="Add to cart">
  421. // <span>Button</span>
  422. // </button>
  423. // <button class="example-button-12 :hover" type="button" title="Add to cart">
  424. // <span>Hover</span>
  425. // </button>
  426. // <button class="example-button-12 :active" type="button" title="Add to cart">
  427. // <span>Active</span>
  428. // </button>
  429. // <button class="example-button-12 disabled" type="button" title="Add to cart">
  430. // <span>Disabled</span>
  431. // </button>
  432. // ```
  433. //
  434. .example-button-11 {
  435. .lib-button(
  436. @_button-margin: 3px,
  437. @_button-icon-use: true,
  438. @_button-font-content: @icon-cart,
  439. @_button-icon-font-position: before
  440. );
  441. }
  442. .example-button-12 {
  443. .lib-button(
  444. @_button-margin: 3px,
  445. @_button-icon-use: true,
  446. @_button-font-content: @icon-cart,
  447. @_button-icon-font-position: after
  448. );
  449. }
  450. // # Button with fixed width
  451. //
  452. // To get a fixed width button, you need to set:
  453. // ```css
  454. // @_button-width: 100px
  455. // ```
  456. //
  457. // ```html
  458. // <button class="example-button-13" type="button" title="Add to cart">
  459. // <span>Button</span>
  460. // </button>
  461. // <button class="example-button-13 :hover" type="button" title="Add to cart">
  462. // <span>Hover</span>
  463. // </button>
  464. // <button class="example-button-13 :active" type="button" title="Add to cart">
  465. // <span>Active</span>
  466. // </button>
  467. // <button class="example-button-13 disabled" type="button" title="Add to cart">
  468. // <span>Disabled</span>
  469. // </button>
  470. // ```
  471. //
  472. .example-button-13 {
  473. .lib-button(@_button-width: 100px, @_button-margin: 3px);
  474. }
  475. // # Primary button
  476. //
  477. // The <code>.lib-button-primary()</code> mixin is used to create a **primary button**. By default it uses Primary button variables from _variables.less file.
  478. //
  479. // ##Primary button big
  480. // ```html
  481. // <button class="example-button-4 example-button-5" type="button"><span>Button</span></button>
  482. // <button class="example-button-4 example-button-5 :hover" type="button"><span>Hover</span></button>
  483. // <button class="example-button-4 example-button-5 :active" type="button"><span>Active</span></button>
  484. // <button class="example-button-4 example-button-5" type="button" disabled><span>Disabled</span></button>
  485. // ```
  486. //
  487. // ##Primary button
  488. // ```html
  489. // <button class="example-button-4" type="button"><span>Button</span></button>
  490. // <button class="example-button-4 :hover" type="button"><span>Hover</span></button>
  491. // <button class="example-button-4 :active" type="button"><span>Active</span></button>
  492. // <button class="example-button-4 disabled" type="button"><span>Disabled</span></button>
  493. // ```
  494. //
  495. // ##Primary button small
  496. // ```html
  497. // <button class="example-button-4 example-button-6" type="button"><span>Button</span></button>
  498. // <button class="example-button-4 example-button-6 :hover" type="button"><span>Hover</span></button>
  499. // <button class="example-button-4 example-button-6 :active" type="button"><span>Active</span></button>
  500. // <button class="example-button-4 example-button-6" type="button" disabled><span>Disabled</span></button>
  501. // ```
  502. //
  503. .example-button-4 {
  504. .lib-button-primary(
  505. @_button-margin: 3px
  506. );
  507. &:active {
  508. box-shadow: inset 0 3px 1px rgba(0,0,0,.29);
  509. }
  510. &.example-button-5 {
  511. .lib-button-l(@_button-l-padding: 7px 35px);
  512. }
  513. &.example-button-6 {
  514. .lib-button-s();
  515. color: @color-white;
  516. &:hover,
  517. &.active {
  518. color: @color-white;
  519. }
  520. }
  521. }
  522. // # Primary button variables
  523. //
  524. // In the variables list primary buttons are configured with <code>@button-primary__</code> prefix. So for example to configure primary button background you should use <code>@_button-background</code> variable of the mixin or <code>@button-primary__background</code> of the global variables list.
  525. //
  526. // <pre>
  527. // <table>
  528. // <tr>
  529. // <th class="vars_head">Mixin variable</th>
  530. // <th class="vars_head">Global variable</th>
  531. // <th class="vars_head">Default value</th>
  532. // <th class="vars_head">Allowed values</th>
  533. // <th class="vars_head">Comment</th>
  534. // </tr>
  535. // <tr>
  536. // <th>@_button-line-height</th>
  537. // <td>@button-primary__line-height</td>
  538. // <td class="vars_value">false</td>
  539. // <td class="vars_value">'' | false | value</td>
  540. // <td>Button line-height</td>
  541. // </tr>
  542. // <tr>
  543. // <th>@_button-width</th>
  544. // <td>@button-primary__width</td>
  545. // <td class="vars_value">false</td>
  546. // <td class="vars_value">'' | false | value</td>
  547. // <td>Button width</td>
  548. // </tr>
  549. // <tr>
  550. // <th>@_button-margin</th>
  551. // <td>@button-primary__margin</td>
  552. // <td class="vars_value">false</td>
  553. // <td class="vars_value">'' | false | value</td>
  554. // <td>Button margin</td>
  555. // </tr>
  556. // <tr>
  557. // <th>@_button-padding</th>
  558. // <td>@button-primary__padding</td>
  559. // <td class="vars_value">@button__padding</td>
  560. // <td class="vars_value">'' | false | value</td>
  561. // <td>Button padding</td>
  562. // </tr>
  563. // <tr>
  564. // <th>@_button-gradient</th>
  565. // <td>@button-primary__gradient</td>
  566. // <td class="vars_value">false</td>
  567. // <td class="vars_value">'' | false | true</td>
  568. // <td>Button has gradient background</td>
  569. // </tr>
  570. // <tr>
  571. // <th>@_button-gradient-direction</th>
  572. // <td>@button-primary__gradient-direction</td>
  573. // <td class="vars_value">false</td>
  574. // <td class="vars_value">'' | false | vertical | horizontal</td>
  575. // <td>Direction of button background gradient (if there is any)</td>
  576. // </tr>
  577. // <tr>
  578. // <th colspan="5" class="vars_section">Button default state</th>
  579. // </tr>
  580. // <tr>
  581. // <th>@_button-background</th>
  582. // <td>@button-primary__background</td>
  583. // <td class="vars_value">#1979c3</td>
  584. // <td class="vars_value">'' | false | value</td>
  585. // <td>Button background</td>
  586. // </tr>
  587. // <tr>
  588. // <th>@_button-border</th>
  589. // <td>@button-primary__border</td>
  590. // <td class="vars_value">1px solid #1979c3</td>
  591. // <td class="vars_value">'' | false | value</td>
  592. // <td>Button border</td>
  593. // </tr>
  594. // <tr>
  595. // <th>@_button-color</th>
  596. // <td>@button-primary__color</td>
  597. // <td class="vars_value">#fff</td>
  598. // <td class="vars_value">'' | false | value</td>
  599. // <td>Button text color</td>
  600. // </tr>
  601. // <tr>
  602. // <th>@_button-gradient-color-start</th>
  603. // <td>@button-primary__gradient-color-start</td>
  604. // <td class="vars_value">false</td>
  605. // <td class="vars_value">'' | false | value</td>
  606. // <td>Gradient background start color</td>
  607. // </tr>
  608. // <tr>
  609. // <th>@_button-gradient-color-end</th>
  610. // <td>@button-primary__gradient-color-end</td>
  611. // <td class="vars_value">false</td>
  612. // <td class="vars_value">'' | false | value</td>
  613. // <td>Gradient background end color</td>
  614. // </tr>
  615. // <tr>
  616. // <th colspan="5" class="vars_section">Button hover state</th>
  617. // </tr>
  618. // <tr>
  619. // <th>@_button-background-hover</th>
  620. // <td>@button-primary__hover__background</td>
  621. // <td class="vars_value">#006bb4</td>
  622. // <td class="vars_value">'' | false | value</td>
  623. // <td>Hovered button background</td>
  624. // </tr>
  625. // <tr>
  626. // <th>@_button-border-hover</th>
  627. // <td>@button-primary__hover__border</td>
  628. // <td class="vars_value">1px solid #006bb4</td>
  629. // <td class="vars_value">'' | false | value</td>
  630. // <td>Hovered button border</td>
  631. // </tr>
  632. // <tr>
  633. // <th>@_button-color-hover</th>
  634. // <td>@button-primary__hover__color</td>
  635. // <td class="vars_value">@button-primary__color</td>
  636. // <td class="vars_value">'' | false | value</td>
  637. // <td>Hovered button text color</td>
  638. // </tr>
  639. // <tr>
  640. // <th nowrap="nowrap">@_button-gradient-color-start-hover</th>
  641. // <td>@button-primary__hover__gradient-color-start</td>
  642. // <td class="vars_value">false</td>
  643. // <td class="vars_value">'' | false | value</td>
  644. // <td>Hovered button gradient background start color</td>
  645. // </tr>
  646. // <tr>
  647. // <th>@_button-gradient-color-end-hover</th>
  648. // <td>@button-primary__hover__gradient-color-end</td>
  649. // <td class="vars_value">false</td>
  650. // <td class="vars_value">'' | false | value</td>
  651. // <td>Hovered button gradient background end color</td>
  652. // </tr>
  653. // <tr>
  654. // <th colspan="5" class="vars_section">Button active state</th>
  655. // </tr>
  656. // <tr>
  657. // <th>@_button-background-active</th>
  658. // <td>@button-primary__active__background</td>
  659. // <td class="vars_value">@button-primary__hover__background</td>
  660. // <td class="vars_value">'' | false | value</td>
  661. // <td>Active button background</td>
  662. // </tr>
  663. // <tr>
  664. // <th>@_button-border-active</th>
  665. // <td>@button-primary__active__border</td>
  666. // <td class="vars_value">@button-primary__hover__border</td>
  667. // <td class="vars_value">'' | false | value</td>
  668. // <td>Active button border</td>
  669. // </tr>
  670. // <tr>
  671. // <th>@_button-color-active</th>
  672. // <td>@button-primary__active__color</td>
  673. // <td class="vars_value">@button-primary__color</td>
  674. // <td class="vars_value">'' | false | value</td>
  675. // <td>Active button text color</td>
  676. // </tr>
  677. // <tr>
  678. // <th>@_button-gradient-color-start-active</th>
  679. // <td>@button-primary__active__gradient-color-start</td>
  680. // <td class="vars_value">false</td>
  681. // <td class="vars_value">'' | false | value</td>
  682. // <td>Active button gradient background start color</td>
  683. // </tr>
  684. // <tr>
  685. // <th>@_button-gradient-color-end-active</th>
  686. // <td>@button-primary__active__gradient-color-end</td>
  687. // <td class="vars_value">false</td>
  688. // <td class="vars_value">'' | false | value</td>
  689. // <td>Active button gradient background end color</td>
  690. // </tr>
  691. // </table>
  692. // </pre>
  693. // # Button with gradient background
  694. //
  695. // The <code>.lib-button()</code> mixin can get its values from _variables.less file or directly
  696. // ```html
  697. // <button class="example-button-7" type="button"><span>Button</span></button>
  698. // <button class="example-button-7 :hover" type="button"><span>Hover</span></button>
  699. // <button class="example-button-7 :active" type="button"><span>Active</span></button>
  700. // <button class="example-button-7 disabled" type="button"><span>Disabled</span></button>
  701. // ```
  702. //
  703. .example-button-7 {
  704. .lib-button(
  705. @_button-margin: 3px,
  706. @_button-padding: @button__padding,
  707. @_button-gradient-color-start: #1979c3,
  708. @_button-gradient-color-end: #006bb4,
  709. @_button-color: @color-white,
  710. @_button-gradient-color-start-hover: #006bb4,
  711. @_button-gradient-color-end-hover: #1979c3,
  712. @_button-color-hover: @color-white,
  713. @_button-gradient-color-start-active: #006bb4,
  714. @_button-gradient-color-end-active: #006bb4,
  715. @_button-color-active: @color-white,
  716. @_button-gradient: true,
  717. @_button-gradient-direction: vertical,
  718. @_button-border: @button-primary__border,
  719. @_button-border-hover: @button-primary__hover__border,
  720. @_button-border-active: @button-primary__active__border
  721. );
  722. border-radius: 3px;
  723. &:active {
  724. box-shadow: inset 0 3px 1px rgba(0,0,0,.29);
  725. }
  726. }
  727. // # Button as a link
  728. //
  729. // The <code>.lib-button-as-link()</code> mixin is used to make button look like a link. It resets default button styles.
  730. //
  731. // ```html
  732. // <button class="example-button-8" type="button"><span>Button</span></button>
  733. // <button class="example-button-8 :visited" type="button"><span>Visited</span></button>
  734. // <button class="example-button-8 :hover" type="button"><span>Hover</span></button>
  735. // <button class="example-button-8 :active" type="button"><span>Active</span></button>
  736. // <button class="example-button-8 disabled" type="button"><span>Disabled</span></button>
  737. // ```
  738. //
  739. .example-button-8 {
  740. .lib-button-as-link();
  741. font-weight: normal;
  742. &:active {
  743. box-shadow: none;
  744. }
  745. }
  746. // # Button as a link variables
  747. //
  748. // <pre>
  749. // <table>
  750. // <tr>
  751. // <th class="vars_head">Mixin variable</th>
  752. // <th class="vars_head">Global variable</th>
  753. // <th class="vars_head">Default value</th>
  754. // <th class="vars_head">Allowed values</th>
  755. // <th class="vars_head">Comment</th>
  756. // </tr>
  757. // <tr>
  758. // <th>@_link-color</th>
  759. // <td>@link__color</td>
  760. // <td class="vars_value">@link-color</td>
  761. // <td class="vars_value">'' | false | value</td>
  762. // <td>Button as a link color</td>
  763. // </tr>
  764. // <tr>
  765. // <th>@_link-color-hover</th>
  766. // <td>@link__hover__color</td>
  767. // <td class="vars_value">@link-color-hover</td>
  768. // <td class="vars_value">'' | false | value</td>
  769. // <td>Button as a link hovered color</td>
  770. // </tr>
  771. // <tr>
  772. // <th>@_line-height</th>
  773. // <td>@line-height__base</td>
  774. // <td class="vars_value">@line-height-base</td>
  775. // <td class="vars_value">'' | false | value</td>
  776. // <td>Button as a link line height</td>
  777. // </tr>
  778. // <tr>
  779. // <th>@_margin</th>
  780. // <td>-</td>
  781. // <td class="vars_value">0</td>
  782. // <td class="vars_value">'' | false | value</td>
  783. // <td>Button as a link margin</td>
  784. // </tr>
  785. // <tr>
  786. // <th>@_padding</th>
  787. // <td>-</td>
  788. // <td class="vars_value">0</td>
  789. // <td class="vars_value">'' | false | value</td>
  790. // <td>Button as a link padding</td>
  791. // </tr>
  792. // <tr>
  793. // <th>@_disabled_opacity</th>
  794. // <td>@button__disabled__opacity</td>
  795. // <td class="vars_value">.5</td>
  796. // <td class="vars_value">range between .1 and .9</td>
  797. // <td>Button as a link opacity</td>
  798. // </tr>
  799. // </table>
  800. // # Link as a button
  801. //
  802. // The <code>.lib-link-as-button()</code> mixin is used to reset link styles (text-decoration and display inline). Then to make it look like a button, you need to add the <code>.lib-button()</code> mixin with appropriate parameters.
  803. //
  804. // ```html
  805. // <a href="#" class="example-button-9"><span>Button</span></a>
  806. // <a href="#" class="example-button-9 :hover"><span>Hover</span></a>
  807. // <a href="#" class="example-button-9 :active"><span>Active</span></a>
  808. // <a href="#" class="example-button-9 disabled"><span>Disabled</span></a>
  809. // ```
  810. //
  811. .example-button-9 {
  812. .lib-link-as-button();
  813. .lib-button();
  814. margin: 3px;
  815. border-radius: 3px;
  816. font-weight: bold;
  817. &:active {
  818. box-shadow: inset 0 3px 1px rgba(0,0,0,.29);
  819. }
  820. }
  821. // # Button reset
  822. //
  823. // The <code>.lib-button-reset()</code> mixin is used to fully reset button styles.
  824. //
  825. // ```html
  826. // <button class="example-button-14" type="button"><span>Button with reset styles</span></button>
  827. // ```
  828. //
  829. .example-button-14 {
  830. .lib-button-reset();
  831. }
  832. // # Button revert secondary color
  833. //
  834. // The <code>.lib-button-revert-secondary-color()</code> mixin is used to revert button styles (primary for example) to secondary color styles.
  835. // Also can be passed any color, background and border if needed.
  836. //
  837. // ```html
  838. // <button class="example-button-15" type="button"><span>Reverted color</span></button>
  839. // <button class="example-button-16" type="button"><span>Custom colors</span></button>
  840. // ```
  841. //
  842. .example-button-15 {
  843. .lib-button-primary();
  844. .lib-button-revert-secondary-color();
  845. }
  846. // # Button revert secondary color variables
  847. //
  848. // <pre>
  849. // <table>
  850. // <tr>
  851. // <th class="vars_head">Mixin variable</th>
  852. // <th class="vars_head">Global variable</th>
  853. // <th class="vars_head">Default value</th>
  854. // <th class="vars_head">Allowed values</th>
  855. // <th class="vars_head">Comment</th>
  856. // </tr>
  857. // <tr>
  858. // <th>@_button-color</th>
  859. // <td>@button__color</td>
  860. // <td class="vars_value">@button__color</td>
  861. // <td class="vars_value">'' | false | value</td>
  862. // <td>Button color</td>
  863. // </tr>
  864. // <tr>
  865. // <th>@_button-background</th>
  866. // <td>@button__background</td>
  867. // <td class="vars_value">@button__background</td>
  868. // <td class="vars_value">'' | false | value</td>
  869. // <td>Button background</td>
  870. // </tr>
  871. // <tr>
  872. // <th>@_button-border</th>
  873. // <td>@button__border</td>
  874. // <td class="vars_value">@button__border</td>
  875. // <td class="vars_value">'' | false | value</td>
  876. // <td>Button border</td>
  877. // </tr>
  878. // <tr>
  879. // <th>@_button-color-hover</th>
  880. // <td>@button__hover__color</td>
  881. // <td class="vars_value">@button__hover__color</td>
  882. // <td class="vars_value">'' | false | value</td>
  883. // <td>Button hover color</td>
  884. // </tr>
  885. // <tr>
  886. // <th>@_button-background-hover</th>
  887. // <td>@button__hover__background</td>
  888. // <td class="vars_value">@button__hover__background</td>
  889. // <td class="vars_value">'' | false | value</td>
  890. // <td>Button hover background</td>
  891. // </tr>
  892. // <tr>
  893. // <th>@_button-border-hover</th>
  894. // <td>@button__hover__border</td>
  895. // <td class="vars_value">@button__hover__border</td>
  896. // <td class="vars_value">'' | false | value</td>
  897. // <td>Button hover border</td>
  898. // </tr>
  899. // <tr>
  900. // <th>@_button-color-active</th>
  901. // <td>@button__active__color</td>
  902. // <td class="vars_value">@button__active__color</td>
  903. // <td class="vars_value">'' | false | value</td>
  904. // <td>Button active color</td>
  905. // </tr>
  906. // <tr>
  907. // <th>@_button-background-active</th>
  908. // <td>@button__active__background</td>
  909. // <td class="vars_value">@button__active__background</td>
  910. // <td class="vars_value">'' | false | value</td>
  911. // <td>Button active background</td>
  912. // </tr>
  913. // <tr>
  914. // <th>@_button-border-active</th>
  915. // <td>@button__active__border</td>
  916. // <td class="vars_value">@button__active__border</td>
  917. // <td class="vars_value">'' | false | value</td>
  918. // <td>Button active border</td>
  919. // </tr>
  920. // </table>
  921. // </pre>
  922. // # Button revert secondary size
  923. //
  924. // The <code>.lib-button-revert-secondary-size()</code> mixin is used to revert button sizes to secondary button sizes.
  925. // Also can be passed font-size, line-height and padding if needed.
  926. //
  927. // ```html
  928. // <button class="example-button-17" type="button"><span>Reverted size</span></button>
  929. // <button class="example-button-18" type="button"><span>Custom sizes</span></button>
  930. // ```
  931. //
  932. .example-button-17 {
  933. .lib-button-l();
  934. .lib-button-revert-secondary-size();
  935. }
  936. .example-button-18 {
  937. .lib-button-revert-secondary-size(
  938. @_button-font-size: 10px,
  939. @_button-line-height: 12px,
  940. @_button-padding: 4px 10px
  941. );
  942. }
  943. // # Button revert secondary size variables
  944. //
  945. // <pre>
  946. // <table>
  947. // <tr>
  948. // <th class="vars_head">Mixin variable</th>
  949. // <th class="vars_head">Global variable</th>
  950. // <th class="vars_head">Default value</th>
  951. // <th class="vars_head">Allowed values</th>
  952. // <th class="vars_head">Comment</th>
  953. // </tr>
  954. // <tr>
  955. // <th>@_button-font-size</th>
  956. // <td>@button__font-size</td>
  957. // <td class="vars_value">@button__font-size</td>
  958. // <td class="vars_value">'' | value</td>
  959. // <td>Button font size</td>
  960. // </tr>
  961. // <tr>
  962. // <th>@_button-line-height</th>
  963. // <td>@button__line-height</td>
  964. // <td class="vars_value">@button__line-height</td>
  965. // <td class="vars_value">'' | value</td>
  966. // <td>Button line-height</td>
  967. // </tr>
  968. // <tr>
  969. // <th>@_button-padding</th>
  970. // <td>@button__padding</td>
  971. // <td class="vars_value">@button__padding</td>
  972. // <td class="vars_value">'' | value</td>
  973. // <td>Button padding</td>
  974. // </tr>
  975. // </table>
  976. // </pre>