Files
bulma/sass/elements/button.sass

96 lines
2.0 KiB
Sass
Raw Normal View History

2016-01-24 00:03:43 +00:00
=button-small
2016-06-29 23:25:27 +01:00
border-radius: $radius-small
2016-10-29 18:53:30 +01:00
font-size: $size-small
2016-01-24 00:03:43 +00:00
=button-medium
2016-10-29 18:53:30 +01:00
font-size: $size-medium
2016-01-24 00:03:43 +00:00
=button-large
2016-10-29 18:53:30 +01:00
font-size: $size-large
2016-01-24 00:03:43 +00:00
.button
+control
2016-09-22 23:14:18 +01:00
+unselectable
cursor: pointer
2016-03-26 17:28:43 +00:00
justify-content: center
2016-10-29 18:53:30 +01:00
padding-left: 1em
padding-right: 1em
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
2016-04-10 16:00:32 +01:00
.icon,
.tag
&:first-child
2016-04-10 16:00:32 +01:00
margin-left: -2px
margin-right: 4px
&:last-child
margin-left: 4px
2016-04-10 16:00:32 +01:00
margin-right: -2px
2016-05-30 19:41:54 +01: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 16:00:32 +01: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 23:59:48 +01:00
background-color: $color
2016-09-24 16:04:53 +01:00
border-width: 0
2016-01-24 00:03:43 +00:00
color: $color-invert
&:hover,
2016-05-30 19:41:54 +01:00
&:focus,
&.is-active
2016-09-22 19:48:42 +01:00
background-color: darken($color, 5%)
2016-01-24 00:03:43 +00:00
border-color: transparent
color: $color-invert
&.is-inverted
2016-06-29 23:59:48 +01:00
background-color: $color-invert
2016-01-24 00:03:43 +00:00
color: $color
&:hover
2016-06-29 23:59:48 +01:00
background-color: darken($color-invert, 5%)
2016-04-10 16:00:32 +01:00
&.is-loading
&:after
border-color: transparent transparent $color-invert $color-invert !important
&.is-outlined
2016-06-29 23:59:48 +01:00
background-color: transparent
2016-04-10 16:00:32 +01:00
border-color: $color
2016-09-24 16:04:53 +01:00
border-width: 1px
2016-04-10 16:00:32 +01:00
color: $color
&:hover,
&:focus
2016-06-29 23:59:48 +01:00
background-color: $color
border-color: $color
color: $color-invert
2016-03-26 15:38:33 +00:00
&.is-link
2016-06-29 23:59:48 +01:00
background-color: transparent
2016-09-24 16:04:53 +01:00
border-width: 0
2016-03-26 15:38:33 +00:00
color: $text
text-decoration: underline
&:hover,
&:focus
2016-09-24 16:04:53 +01:00
background-color: $background
2016-03-26 15:38:33 +00:00
color: $text-strong
2016-04-10 16:00:32 +01: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 16:00:32 +01:00
// Modifiers
&[disabled],
&.is-disabled
opacity: 0.5
&.is-fullwidth
2016-05-29 13:16:09 +01: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
2016-09-22 23:14:18 +01:00
+loader
2016-01-24 00:03:43 +00:00
+center(16px)
position: absolute !important