// /** // * Copyright © Magento, Inc. All rights reserved. // * See COPYING.txt for license details. // */ // # Default button // // Default style for buttons is set by the .lib-button() mixin. The mixin is called in .lib-magento-reset() or it can be called directly. // // ## Default button large // ```html // // // // // ``` // // ## Default button // ```html // // // // // ``` // // ## Default button small // ```html // // // // // ``` // button { .lib-button(@_button-margin: 3px); border-radius: 3px; &:active, &:focus { box-shadow: inset 0 2px 1px rgba(0,0,0,.12); } } .example-button-1 { &.example-button-2 { .lib-button-l(); } &.example-button-3 { .lib-button-s(); border-radius: 0; color: @color-black; &:hover, &.active { color: @color-black; } } } // # Button variables // //
//    
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//    
Mixin variableGlobal variableDefault valueAllowed valuesComment
@_button-font-family@button__font-family@font-family__base'' | false | valueButton font family
@_button-font-size@button__font-size@font-size__base'' | false | valueButton font size
@_button-font-weight@button__font-weight@font-weight__bold'' | false | valueButton font weight
@_button-cursor@button__cursorpointer'' | false | valueButton cursor
@_button-display@button__displayinline-block'' | false | valueButton display
@_button-disabled-opacity@button__disabled__opacity.5'' | false | valueButton disabled opacity
@_button-line-height@button__line-height@font-size__base + 2'' | false | valueButton height
@_button-width@button__widthfalse'' | false | valueButton width
@_button-margin@button__margin0'' | false | valueButton margin
@_button-padding@button__padding7px 15px'' | false | valueButton padding
@_button-gradient@button__gradientfalse'' | false | trueButton has gradient background
@_button-gradient-direction@button__gradient-directionfalse'' | false | vertical | horizontalDirection of button background gradient (if there is any)
Button default state
@_button-color@button__color@primary__color'' | false | valueButton text color
@_button-background@button__background#f2f2f2'' | false | valueButton background
@_button-border@button__border1px solid #cdcdcd'' | false | valueButton border
@_button-gradient-color-start@button__gradient-color-startfalse'' | false | valueGradient background start color
@_button-gradient-color-end@button__gradient-color-endfalse'' | false | valueGradient background end color
Button hover state
@_button-color-hover@button__hover__color#555'' | false | valueHovered button text color
@_button-background-hover@button__hover__background#e2e2e2'' | false | valueHovered button background
@_button-border-hover@button__hover__border@button__border'' | false | valueHovered button border
@_button-gradient-color-start-hover@button__hover__gradient-color-startfalse'' | false | valueHovered button gradient background start color
@_button-gradient-color-end-hover@button__hover__gradient-color-endfalse'' | false | valueHovered button gradient background end color
Button active state
@_button-color-active@button__active__color@button__color'' | false | valueActive button text color
@_button-background-active@button__active__background@button__hover__background'' | false | valueActive button background
@_button-border-active@button__active__border@button__border'' | false | valueActive button border
@_button-gradient-color-start-active
@button__active__gradient-color-startfalse'' | false | valueActive button gradient background start color
@_button-gradient-color-end-active@button__active__gradient-color-endfalse'' | false | valueActive button gradient background end color
Button with icon
@_button-icon-use@button-icon__usefalse'' | false | trueButton has an icon
@_button-font-content@button-icon__content@icon-settings'' | false | valueButton icon symbol
@_button-icon-font@button-icon__font@icon-font'' | false | valueButton icon font
@_button-icon-font-size@button-icon__font-size22px'' | false | valueButton icon font size
@_button-icon-font-line-height@button-icon__line-height@button-icon__font-size'' | false | valueButton icon line height
@_button-icon-font-color@button-icon__colorinherit'' | false | valueButton icon color
@_button-icon-font-color-hover@button-icon__hover__font-colorinherit'' | false | valueHovered button icon color
@_button-icon-font-color-active@button-icon__active__font-colorinherit'' | false | valueActive button icon color
@_button-icon-font-margin@button-icon__margin0'' | false | valueButton icon margin
@_button-icon-font-vertical-align@button-icon__vertical-aligntop'' | false | valueButton icon vertical align
@_button-icon-font-position@button-icon__position@icon__position'' | false | before | afterButton icon font position
@_button-icon-font-text-hide@button-icon__text-hidefalse'' | false | trueButton icon text hide
//
// // # Button as an icon // // To make a button look like an icon you need to: // // enable icon: // ```css // @_button-icon-use: true // ``` // set the font icon code: // ```css // @_button-font-content: @icon-cart // ``` // hide button text: // ```css // @_button-icon-font-text-hide: true // ``` // // ```html // // // // ``` // .example-button-10 { .lib-button( @_button-margin: 3px, @_button-icon-use: true, @_button-font-content: @icon-cart, @_button-icon-font-text-hide: true ); .lib-button-reset(); } // # Button with an icon on the left or right side of the text // // @_button-icon-font-position variable is used to set up the icon position // // Use before to set up button icon position on the left: // ```css // @_button-icon-font-position: before // ``` // // ```html // // // // // ``` // Use after to set up button icon position on the right: // ```css // @_button-icon-font-position: after // ``` // ```html // // // // // ``` // .example-button-11 { .lib-button( @_button-margin: 3px, @_button-icon-use: true, @_button-font-content: @icon-cart, @_button-icon-font-position: before ); } .example-button-12 { .lib-button( @_button-margin: 3px, @_button-icon-use: true, @_button-font-content: @icon-cart, @_button-icon-font-position: after ); } // # Button with fixed width // // To get a fixed width button, you need to set: // ```css // @_button-width: 100px // ``` // // ```html // // // // // ``` // .example-button-13 { .lib-button(@_button-width: 100px, @_button-margin: 3px); } // # Primary button // // The .lib-button-primary() mixin is used to create a **primary button**. By default it uses Primary button variables from _variables.less file. // // ##Primary button big // ```html // // // // // ``` // // ##Primary button // ```html // // // // // ``` // // ##Primary button small // ```html // // // // // ``` // .example-button-4 { .lib-button-primary( @_button-margin: 3px ); &:active { box-shadow: inset 0 3px 1px rgba(0,0,0,.29); } &.example-button-5 { .lib-button-l(@_button-l-padding: 7px 35px); } &.example-button-6 { .lib-button-s(); color: @color-white; &:hover, &.active { color: @color-white; } } } // # Primary button variables // // In the variables list primary buttons are configured with @button-primary__ prefix. So for example to configure primary button background you should use @_button-background variable of the mixin or @button-primary__background of the global variables list. // //
//    
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//    
Mixin variableGlobal variableDefault valueAllowed valuesComment
@_button-line-height@button-primary__line-heightfalse'' | false | valueButton line-height
@_button-width@button-primary__widthfalse'' | false | valueButton width
@_button-margin@button-primary__marginfalse'' | false | valueButton margin
@_button-padding@button-primary__padding@button__padding'' | false | valueButton padding
@_button-gradient@button-primary__gradientfalse'' | false | trueButton has gradient background
@_button-gradient-direction@button-primary__gradient-directionfalse'' | false | vertical | horizontalDirection of button background gradient (if there is any)
Button default state
@_button-background@button-primary__background#1979c3'' | false | valueButton background
@_button-border@button-primary__border1px solid #1979c3'' | false | valueButton border
@_button-color@button-primary__color#fff'' | false | valueButton text color
@_button-gradient-color-start@button-primary__gradient-color-startfalse'' | false | valueGradient background start color
@_button-gradient-color-end@button-primary__gradient-color-endfalse'' | false | valueGradient background end color
Button hover state
@_button-background-hover@button-primary__hover__background#006bb4'' | false | valueHovered button background
@_button-border-hover@button-primary__hover__border1px solid #006bb4'' | false | valueHovered button border
@_button-color-hover@button-primary__hover__color@button-primary__color'' | false | valueHovered button text color
@_button-gradient-color-start-hover@button-primary__hover__gradient-color-startfalse'' | false | valueHovered button gradient background start color
@_button-gradient-color-end-hover@button-primary__hover__gradient-color-endfalse'' | false | valueHovered button gradient background end color
Button active state
@_button-background-active@button-primary__active__background@button-primary__hover__background'' | false | valueActive button background
@_button-border-active@button-primary__active__border@button-primary__hover__border'' | false | valueActive button border
@_button-color-active@button-primary__active__color@button-primary__color'' | false | valueActive button text color
@_button-gradient-color-start-active@button-primary__active__gradient-color-startfalse'' | false | valueActive button gradient background start color
@_button-gradient-color-end-active@button-primary__active__gradient-color-endfalse'' | false | valueActive button gradient background end color
//
// # Button with gradient background // // The .lib-button() mixin can get its values from _variables.less file or directly // ```html // // // // // ``` // .example-button-7 { .lib-button( @_button-margin: 3px, @_button-padding: @button__padding, @_button-gradient-color-start: #1979c3, @_button-gradient-color-end: #006bb4, @_button-color: @color-white, @_button-gradient-color-start-hover: #006bb4, @_button-gradient-color-end-hover: #1979c3, @_button-color-hover: @color-white, @_button-gradient-color-start-active: #006bb4, @_button-gradient-color-end-active: #006bb4, @_button-color-active: @color-white, @_button-gradient: true, @_button-gradient-direction: vertical, @_button-border: @button-primary__border, @_button-border-hover: @button-primary__hover__border, @_button-border-active: @button-primary__active__border ); border-radius: 3px; &:active { box-shadow: inset 0 3px 1px rgba(0,0,0,.29); } } // # Button as a link // // The .lib-button-as-link() mixin is used to make button look like a link. It resets default button styles. // // ```html // // // // // // ``` // .example-button-8 { .lib-button-as-link(); font-weight: normal; &:active { box-shadow: none; } } // # Button as a link variables // //
//    
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//        
//            
//            
//            
//            
//            
//        
//    
Mixin variableGlobal variableDefault valueAllowed valuesComment
@_link-color@link__color@link-color'' | false | valueButton as a link color
@_link-color-hover@link__hover__color@link-color-hover'' | false | valueButton as a link hovered color
@_line-height@line-height__base@line-height-base'' | false | valueButton as a link line height
@_margin-0'' | false | valueButton as a link margin
@_padding-0'' | false | valueButton as a link padding
@_disabled_opacity@button__disabled__opacity.5range between .1 and .9Button as a link opacity
// # Link as a button // // The .lib-link-as-button() 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 .lib-button() mixin with appropriate parameters. // // ```html // Button // Hover // Active // Disabled // ``` // .example-button-9 { .lib-link-as-button(); .lib-button(); margin: 3px; border-radius: 3px; font-weight: bold; &:active { box-shadow: inset 0 3px 1px rgba(0,0,0,.29); } } // # Button reset // // The .lib-button-reset() mixin is used to fully reset button styles. // // ```html // // ``` // .example-button-14 { .lib-button-reset(); } // # Button revert secondary color // // The .lib-button-revert-secondary-color() mixin is used to revert button styles (primary for example) to secondary color styles. // Also can be passed any color, background and border if needed. // // ```html // // // ``` // .example-button-15 { .lib-button-primary(); .lib-button-revert-secondary-color(); } // # Button revert secondary color variables // //
//    
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//    
Mixin variableGlobal variableDefault valueAllowed valuesComment
@_button-color@button__color@button__color'' | false | valueButton color
@_button-background@button__background@button__background'' | false | valueButton background
@_button-border@button__border@button__border'' | false | valueButton border
@_button-color-hover@button__hover__color@button__hover__color'' | false | valueButton hover color
@_button-background-hover@button__hover__background@button__hover__background'' | false | valueButton hover background
@_button-border-hover@button__hover__border@button__hover__border'' | false | valueButton hover border
@_button-color-active@button__active__color@button__active__color'' | false | valueButton active color
@_button-background-active@button__active__background@button__active__background'' | false | valueButton active background
@_button-border-active@button__active__border@button__active__border'' | false | valueButton active border
//
// # Button revert secondary size // // The .lib-button-revert-secondary-size() mixin is used to revert button sizes to secondary button sizes. // Also can be passed font-size, line-height and padding if needed. // // ```html // // // ``` // .example-button-17 { .lib-button-l(); .lib-button-revert-secondary-size(); } .example-button-18 { .lib-button-revert-secondary-size( @_button-font-size: 10px, @_button-line-height: 12px, @_button-padding: 4px 10px ); } // # Button revert secondary size variables // //
//    
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//      
//        
//        
//        
//        
//        
//      
//    
Mixin variableGlobal variableDefault valueAllowed valuesComment
@_button-font-size@button__font-size@button__font-size'' | valueButton font size
@_button-line-height@button__line-height@button__line-height'' | valueButton line-height
@_button-padding@button__padding@button__padding'' | valueButton padding
//