// // Component: Button // // ======================================================================== // Variables // ======================================================================== @button-height: 45px; @button-mini-height: @global-mini-height; @button-small-height: @global-small-height; @button-large-height: 54px; @button-padding-horizontal: 20px; @button-large-padding-horizontal: 25px; @button-font-size: 0.8rem; @button-font-weight: 900; @button-font-family: 'Nunito'; @button-line-height: 45px; @button-mini-line-height: @global-mini-height; @button-small-line-height: @global-small-height; @button-large-line-height: 54px; @button-mini-font-size: round((@global-font-size * 0.78)); @button-small-font-size: round((@global-font-size * 0.85)); @button-large-font-size: round((@global-font-size * 0.9)); @button-background: @global-secondary-background; @button-color: @global-contrast-color; @button-hover-background: desaturate(darken(@button-background, 1%), 10%); @button-hover-color: @global-contrast-color; @button-active-background: darken(@button-hover-background, 1%); @button-active-color: @global-contrast-color; @button-primary-background: @global-primary-background; @button-primary-color: #fff; @button-primary-hover-background: desaturate(darken(@button-primary-background, 1%), 1%); @button-primary-hover-color: #fff; @button-primary-active-background: darken(@button-primary-hover-background, 1%); @button-primary-active-color: #fff; @button-success-background: @global-success-background; @button-success-color: @global-contrast-color; @button-success-hover-background: desaturate(darken(@button-success-background, 1%), 10%); @button-success-hover-color: @global-contrast-color; @button-success-active-background: darken(@button-success-hover-background, 1%); @button-success-active-color: @global-contrast-color; @button-warning-background: @global-warning-background; @button-warning-color: @global-contrast-color; @button-warning-hover-background: desaturate(darken(@button-warning-background, 1%), 10%); @button-warning-hover-color: @global-contrast-color; @button-warning-active-background: darken(@button-warning-hover-background, 1%); @button-warning-active-color: @global-contrast-color; @button-danger-background: @global-danger-background; @button-danger-color: @global-contrast-color; @button-danger-hover-background: desaturate(darken(@button-danger-background, 1%), 10%); @button-danger-hover-color: @global-contrast-color; @button-danger-active-background: darken(@button-danger-hover-background, 1%); @button-danger-active-color: @global-contrast-color; @button-disabled-background: @global-light-background; @button-disabled-color: @global-muted-color; @button-link-color: @global-color; @button-link-hover-color: @global-link-color; @button-link-disabled-color: @global-muted-color; @button-simple-background: @global-background; @button-simple-hover-background: desaturate(darken(@button-simple-background, 1%), 10%); @button-simple-color: @global-color; @button-line-background: none; @button-line-color: @button-primary-background; @button-line-border: @button-primary-background; @button-line-hover-color: @button-primary-background; @button-line-hover-background: rgba(0,0,0,0); @button-line-hover-border: @button-primary-background; @button-border-radius: 25px; @button-hover-box-shadow: 5px 0 15px; @button-active-box-shadow: 5px 0 5px; // Component // ======================================================================== .hook-button() { border-radius: @button-border-radius; border: none; transition: @global-transition; transition-duration: 200ms; text-transform: uppercase; font-weight: @button-font-weight; } .hook-button-hover() { box-shadow: @button-hover-box-shadow fade(@button-background, 30%); } .hook-button-active() { box-shadow: @button-active-box-shadow fade(@button-background, 30%); } // Color modifiers // ======================================================================== // // Modifier: `uk-button-primary` // .hook-button-primary() {} .hook-button-primary-hover() { box-shadow: @button-hover-box-shadow fade(@button-primary-background, 40%); } .hook-button-primary-active() { box-shadow: @button-active-box-shadow fade(@button-primary-background, 40%); } // // Modifier: `uk-button-success` // .hook-button-success() {} .hook-button-success-hover() { box-shadow: @button-hover-box-shadow fade(@button-success-background, 40%); } .hook-button-success-active() {} // // Modifier: `uk-button-warning` // .hook-button-warning() {} .hook-button-warning-hover() { box-shadow: @button-hover-box-shadow fade(@button-warning-background, 40%); } .hook-button-warning-active() {} // // Modifier: `uk-button-danger` // .hook-button-danger() {} .hook-button-danger-hover() { box-shadow: @button-hover-box-shadow fade(@button-danger-background, 40%); } .hook-button-danger-active() {} // Disabled state // ======================================================================== .hook-button-disable() { box-shadow:none; background-image: none; } // Modifier: `uk-button-link` // ======================================================================== .hook-button-link() { padding: 0 !important; position: relative; font-weight: @global-bold-font-weight; &:active, &:focus, &:hover, &:hover:after, &.uk-link:hover { text-decoration: none; box-shadow: none; text-shadow: none; } &:after { content: ""; position: absolute; height: 2px; width: 25%; left: 0; bottom: 0; background-color: @global-link-color; transition: @global-transition; } &:hover:after { width: 100%; } &:focus { outline: none; } &:active { background-color: rgba(0,0,0,0) !important; } } // Size modifiers // ======================================================================== .hook-button-large() {} // Miscellaneous // ======================================================================== .hook-button-misc() { /* Sub-object `uk-button-group` ========================================================================== */ .uk-button-group > .uk-button:not(:first-child):not(:last-child), .uk-button-group > div:not(:first-child):not(:last-child) .uk-button { border-radius: 0; } .uk-button-group > .uk-button:first-child, .uk-button-group > div:first-child .uk-button { border-top-right-radius: 0; border-bottom-right-radius: 0; } .uk-button-group > .uk-button:last-child, .uk-button-group > div:last-child .uk-button { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid @global-light-05-shadow; } .uk-button-group > .uk-button:not(:first-child):not(:last-child), .uk-button-group > div:not(:first-child):not(:last-child) .uk-button { border-left: 1px solid @global-light-05-shadow; } .uk-button-outline, .uk-button.uk-button-outline, .uk-button-line, .uk-button.uk-button-line { background: @button-line-background !important; border: 2px solid @button-line-border; color: @button-line-color; box-shadow: none; border-radius: @button-border-radius; padding-bottom: 0; } .uk-button-outline:hover, .uk-button.uk-button-outline:hover, .uk-button-line:hover, .uk-button.uk-button-line:hover { background: @button-line-hover-background !important; border: 2px solid @button-line-hover-border !important; color: @button-line-hover-color; box-shadow: @button-hover-box-shadow fade(@button-primary-background, 30%); } .uk-button-secondary { background-color: @global-secondary-background; color: @global-contrast-color; } .uk-button-secondary:hover { background-color: desaturate(darken(@global-secondary-background, 1%), 1%); box-shadow: @button-hover-box-shadow fade(@global-secondary-background, 30%); } .uk-button-secondary:focus, .uk-button-secondary:active { background-color: darken(@global-secondary-background, 1%); } // Primary 2 .uk-button-primary-2 { background-color: @global-primary-2-background; color: @global-primary-2-color; } .uk-button-primary-2:hover { background-color: desaturate(darken(@global-primary-2-background, 1%), 1%); } .uk-button-primary-2:focus, .uk-button-primary-2:active { background-color: darken(@global-primary-2-background, 1%); } // Primary 3 .uk-button-primary-3 { background-color: @global-primary-3-background; color: @global-primary-3-color; } .uk-button-primary-3:hover { background-color: desaturate(darken(@global-primary-3-background, 1%), 1%); } .uk-button-primary-3:focus, .uk-button-primary-3:active { background-color: darken(@global-primary-3-background, 1%); } // Primary 4 .uk-button-primary-4 { background-color: @global-primary-4-background; color: @global-primary-4-color; } .uk-button-primary-4:hover { background-color: desaturate(darken(@global-primary-4-background, 1%), 1%); } .uk-button-primary-4:focus, .uk-button-primary-4:active { background-color: darken(@global-primary-4-background, 1%); } .uk-form input[type="submit"] { border-radius: @global-border-radius; font-family: @button-font-family; border: 1px solid @global-border; font-size: @button-font-size; &.uk-button-primary { color: @button-primary-color; } &.uk-button-default { color: @button-color; } } /* * Modifier: `uk-button-warning` */ .uk-button-warning { background-color: @button-warning-background; color: @button-warning-color; .hook-button-warning; } /* Hover */ .uk-button-warning:hover, .uk-button-warning:focus { background-color: @button-warning-hover-background; color: @button-warning-hover-color; .hook-button-warning-hover; } /* Active */ .uk-button-warning:active, .uk-button-warning.uk-active { background-color: @button-warning-active-background; color: @button-warning-active-color; .hook-button-warning-active; } .uk-button { i:before { font-size: 12px; margin-left: 5px; } &.uk-button-large i:before { font-size: 14px; } } a.btn-link { font-family: @global-body-font-family; font-size: @global-font-size; } .uk-button.uk-button-rounded { border-radius: 25px; padding: 0 50px; } button.uk-width-1-1 { white-space: nowrap; } }