mirror of
https://github.com/jgthms/bulma.git
synced 2024-10-17 09:04:18 +00:00
130 lines
3.0 KiB
Sass
130 lines
3.0 KiB
Sass
$button-hover: $link-hover !default
|
|
$button-hover-border: $link-hover-border !default
|
|
|
|
$button-focus: $link-focus !default
|
|
$button-focus-border: $link-focus-border !default
|
|
|
|
$button-active: $link-active !default
|
|
$button-active-border: $link-active-border !default
|
|
|
|
$button-shadow-inset: inset 0 1px 2px rgba($black, 0.2)
|
|
|
|
=button-small
|
|
border-radius: $radius-small
|
|
font-size: $size-small
|
|
=button-medium
|
|
font-size: $size-medium
|
|
=button-large
|
|
font-size: $size-large
|
|
|
|
.button
|
|
+control
|
|
+unselectable
|
|
cursor: pointer
|
|
justify-content: center
|
|
padding-left: 1em
|
|
padding-right: 1em
|
|
text-align: center
|
|
white-space: nowrap
|
|
strong
|
|
color: inherit
|
|
.icon,
|
|
.tag
|
|
&:first-child
|
|
margin-left: -2px
|
|
margin-right: 4px
|
|
&:last-child
|
|
margin-left: 4px
|
|
margin-right: -2px
|
|
// States
|
|
&:hover,
|
|
&.is-hovered
|
|
border-color: $button-hover-border
|
|
color: $button-hover
|
|
&:focus,
|
|
&.is-focused
|
|
border-color: $button-focus-border
|
|
box-shadow: 0 0 0.5em rgba($button-focus-border, 0.5)
|
|
color: $button-focus
|
|
&:active,
|
|
&.is-active
|
|
border-color: $button-active-border
|
|
box-shadow: $button-shadow-inset
|
|
color: $button-active
|
|
// Colors
|
|
&.is-link
|
|
background-color: transparent
|
|
border-width: 0
|
|
color: $text
|
|
text-decoration: underline
|
|
&:hover,
|
|
&.is-hovered,
|
|
&:focus,
|
|
&.is-focused,
|
|
&:active,
|
|
&.is-active
|
|
background-color: $background
|
|
color: $text-strong
|
|
@each $name, $pair in $colors
|
|
$color: nth($pair, 1)
|
|
$color-invert: nth($pair, 2)
|
|
&.is-#{$name}
|
|
background-color: $color
|
|
border-width: 0
|
|
color: $color-invert
|
|
&:hover,
|
|
&.is-hovered
|
|
background-color: darken($color, 2.5%)
|
|
border-color: transparent
|
|
color: $color-invert
|
|
&:focus,
|
|
&.is-focused
|
|
border-color: transparent
|
|
box-shadow: 0 0 0.5em rgba($color, 0.5)
|
|
color: $color-invert
|
|
&:active,
|
|
&.is-active
|
|
background-color: darken($color, 5%)
|
|
border-color: transparent
|
|
box-shadow: $button-shadow-inset
|
|
color: $color-invert
|
|
&.is-inverted
|
|
background-color: $color-invert
|
|
color: $color
|
|
&:hover
|
|
background-color: darken($color-invert, 5%)
|
|
&.is-loading
|
|
&:after
|
|
border-color: transparent transparent $color-invert $color-invert !important
|
|
&.is-outlined
|
|
background-color: transparent
|
|
border-color: $color
|
|
border-width: 1px
|
|
color: $color
|
|
&:hover,
|
|
&:focus
|
|
background-color: $color
|
|
border-color: $color
|
|
color: $color-invert
|
|
// Sizes
|
|
&.is-small
|
|
+button-small
|
|
&.is-medium
|
|
+button-medium
|
|
&.is-large
|
|
+button-large
|
|
// Modifiers
|
|
&[disabled],
|
|
&.is-disabled
|
|
opacity: 0.5
|
|
&.is-fullwidth
|
|
display: flex
|
|
width: 100%
|
|
&.is-loading
|
|
color: transparent !important
|
|
pointer-events: none
|
|
&:after
|
|
+loader
|
|
+center(16px)
|
|
position: absolute !important
|