bulma/sass/elements/button.sass

111 lines
2.3 KiB
Sass
Raw Normal View History

2016-01-24 00:03:43 +00:00
=button-small
2016-06-29 22:25:27 +00:00
border-radius: $radius-small
2016-01-24 00:03:43 +00:00
font-size: 11px
height: 24px
line-height: 16px
padding-left: 6px
padding-right: 6px
2016-01-24 00:03:43 +00:00
=button-medium
font-size: 18px
height: 40px
padding-left: 14px
padding-right: 14px
2016-01-24 00:03:43 +00:00
=button-large
font-size: 22px
height: 48px
padding-left: 20px
padding-right: 20px
2016-01-24 00:03:43 +00:00
.button
+control
2016-05-07 22:40:06 +00:00
@extend .unselectable
2016-03-26 17:28:43 +00:00
justify-content: center
padding-left: 10px
padding-right: 10px
2016-01-30 11:53:41 +00:00
text-align: center
white-space: nowrap
2016-01-24 00:03:43 +00:00
strong
color: inherit
small
display: block
font-size: $size-small
line-height: 1
margin-top: 5px
2016-04-10 15:00:32 +00:00
.icon,
.tag
&:first-child
2016-04-10 15:00:32 +00:00
margin-left: -2px
margin-right: 4px
&:last-child
margin-left: 4px
2016-04-10 15:00:32 +00:00
margin-right: -2px
2016-05-30 18:41:54 +00:00
&:hover,
&:focus,
&.is-active
2016-01-24 00:03:43 +00:00
color: $control-hover
&:active
box-shadow: inset 0 1px 2px rgba($black, 0.2)
2016-04-10 15:00:32 +00:00
// Colors
2016-01-24 00:03:43 +00:00
@each $name, $pair in $colors
$color: nth($pair, 1)
$color-invert: nth($pair, 2)
&.is-#{$name}
2016-06-29 22:59:48 +00:00
background-color: $color
2016-01-24 00:03:43 +00:00
border-color: transparent
color: $color-invert
&:hover,
2016-05-30 18:41:54 +00:00
&:focus,
&.is-active
2016-06-29 22:59:48 +00:00
background-color: darken($color, 10%)
2016-01-24 00:03:43 +00:00
border-color: transparent
color: $color-invert
&:active
border-color: transparent
&.is-inverted
2016-06-29 22:59:48 +00:00
background-color: $color-invert
2016-01-24 00:03:43 +00:00
color: $color
&:hover
2016-06-29 22:59:48 +00:00
background-color: darken($color-invert, 5%)
2016-04-10 15:00:32 +00:00
&.is-loading
&:after
border-color: transparent transparent $color-invert $color-invert !important
&.is-outlined
2016-06-29 22:59:48 +00:00
background-color: transparent
2016-04-10 15:00:32 +00:00
border-color: $color
color: $color
&:hover,
&:focus
2016-06-29 22:59:48 +00:00
background-color: $color
border-color: $color
color: $color-invert
2016-03-26 15:38:33 +00:00
&.is-link
2016-06-29 22:59:48 +00:00
background-color: transparent
2016-03-26 15:38:33 +00:00
border-color: transparent
color: $text
text-decoration: underline
&:hover,
&:focus
2016-06-29 22:59:48 +00:00
background-color: $border
2016-03-26 15:38:33 +00:00
color: $text-strong
2016-04-10 15:00:32 +00:00
// Sizes
2016-01-24 00:03:43 +00:00
&.is-small
+button-small
&.is-medium
+button-medium
&.is-large
+button-large
2016-04-10 15:00:32 +00:00
// Modifiers
&[disabled],
&.is-disabled
opacity: 0.5
&.is-fullwidth
2016-05-29 12:16:09 +00:00
display: flex
width: 100%
2016-01-24 00:03:43 +00:00
&.is-loading
color: transparent !important
2016-01-24 00:03:43 +00:00
pointer-events: none
&:after
@extend .loader
+center(16px)
position: absolute !important