bulma/sass/elements/form.sass

253 lines
4.7 KiB
Sass
Raw Normal View History

=form-control
+control
@each $name, $pair in $colors
$color: nth($pair, 1)
&.is-#{$name}
border-color: $color
2016-01-24 00:03:43 +00:00
.input
+form-control
box-shadow: inset 0 1px 2px rgba($black, 0.1)
2016-01-24 00:03:43 +00:00
max-width: 100%
width: 100%
&[type="search"]
border-radius: 290486px
2016-04-10 15:00:32 +00:00
// Sizes
2016-01-24 00:03:43 +00:00
&.is-small
+control-small
&.is-medium
+control-medium
&.is-large
+control-large
2016-04-10 15:00:32 +00:00
// Modifiers
2016-01-24 00:03:43 +00:00
&.is-fullwidth
display: block
width: 100%
&.is-inline
display: inline
width: auto
.textarea
@extend .input
display: block
2016-01-24 00:03:43 +00:00
line-height: 1.2
max-height: 600px
max-width: 100%
min-height: 120px
min-width: 100%
padding: 10px
resize: vertical
%control-with-element
cursor: pointer
display: inline-block
line-height: 16px
position: relative
vertical-align: top
input
cursor: pointer
&:hover
color: $control-hover
&.is-disabled
2016-04-10 15:00:32 +00:00
color: $text-light
pointer-events: none
input
pointer-events: none
2016-01-24 00:03:43 +00:00
.checkbox
@extend %control-with-element
.radio
@extend %control-with-element
& + .radio
margin-left: 10px
.select
display: inline-block
height: 32px
position: relative
vertical-align: top
select
+form-control
2016-01-24 00:03:43 +00:00
cursor: pointer
display: block
outline: none
padding-right: 36px
&:hover
border-color: $control-hover-border
2016-01-29 13:39:29 +00:00
&::ms-expand
display: none
&.is-fullwidth
width: 100%
select
width: 100%
2016-01-24 00:03:43 +00:00
&:after
+arrow($link)
margin-top: -6px
right: 16px
top: 50%
&:hover
&:after
border-color: $link-hover
2016-05-30 18:21:10 +00:00
&.is-small
height: 24px
select
+control-small
padding-right: 28px
&.is-medium
height: 40px
select
+control-medium
padding-right: 44px
&.is-large
height: 48px
select
+control-large
padding-right: 52px
2016-01-24 00:03:43 +00:00
.label
color: $text-strong
display: block
2016-03-26 15:38:33 +00:00
font-weight: bold
&:not(:last-child)
margin-bottom: 5px
2016-03-26 15:38:33 +00:00
.help
display: block
font-size: $size-small
margin-top: 5px
@each $name, $pair in $colors
$color: nth($pair, 1)
&.is-#{$name}
color: $color
// Containers
2016-03-25 13:38:40 +00:00
.control-label
2016-03-26 15:38:33 +00:00
+mobile
margin-bottom: 5px
+tablet
flex: 1
margin-right: 20px
padding-top: 7px
text-align: right
2016-03-25 13:38:40 +00:00
2016-01-24 00:03:43 +00:00
.control
position: relative
text-align: left
2016-01-24 00:03:43 +00:00
&:not(:last-child)
margin-bottom: 10px
2016-04-10 15:00:32 +00:00
// Modifiers
&.has-addons
2016-01-24 00:03:43 +00:00
display: flex
2016-04-10 15:00:32 +00:00
justify-content: flex-start
2016-01-24 00:03:43 +00:00
.button,
2016-04-10 15:00:32 +00:00
.input,
2016-01-24 00:03:43 +00:00
.select
border-radius: 0
margin-right: -1px
2016-05-30 18:36:17 +00:00
width: auto
2016-01-24 00:03:43 +00:00
&:hover
z-index: 2
&:active,
&:focus
z-index: 3
&:first-child
border-radius: $radius 0 0 $radius
select
border-radius: $radius 0 0 $radius
&:last-child
border-radius: 0 $radius $radius 0
2016-04-10 15:00:32 +00:00
select
border-radius: 0 $radius $radius 0
2016-05-30 18:36:17 +00:00
&.is-expanded
flex: 1
2016-04-10 15:00:32 +00:00
&.has-addons-centered
2016-01-24 00:03:43 +00:00
justify-content: center
2016-04-10 15:00:32 +00:00
&.has-addons-right
justify-content: flex-end
2016-05-30 18:36:17 +00:00
&.has-addons-fullwidth
.button,
.input,
.select
flex: 1
2016-04-10 15:00:32 +00:00
&.has-icon
& > .fa
2016-04-13 23:07:02 +00:00
+fa(14px, 24px)
2016-04-10 15:00:32 +00:00
color: $text-light
pointer-events: none
position: absolute
2016-04-13 23:07:02 +00:00
top: 4px
2016-04-10 15:00:32 +00:00
z-index: 4
.input
&:focus + .fa
color: $text-strong
2016-04-13 23:07:02 +00:00
&.is-small + .fa
font-size: 10.5px
top: 0
&.is-medium + .fa
font-size: 21px
top: 8px
&.is-large + .fa
font-size: 21px
top: 12px
2016-04-10 15:00:32 +00:00
&:not(.has-icon-right)
& > .fa
2016-04-13 23:07:02 +00:00
left: 4px
2016-04-10 15:00:32 +00:00
.input
padding-left: 32px
2016-04-13 23:07:02 +00:00
&.is-small
padding-left: 24px
& + .fa
left: 0
&.is-medium
padding-left: 40px
& + .fa
left: 8px
&.is-large
padding-left: 48px
& + .fa
left: 12px
2016-04-10 15:00:32 +00:00
&.has-icon-right
& > .fa
2016-04-13 23:07:02 +00:00
right: 4px
2016-04-10 15:00:32 +00:00
.input
padding-right: 32px
2016-04-13 23:07:02 +00:00
&.is-small
padding-right: 24px
& + .fa
right: 0
&.is-medium
padding-right: 40px
& + .fa
right: 8px
&.is-large
padding-right: 48px
& + .fa
right: 12px
&.is-grouped
2016-03-25 13:38:40 +00:00
display: flex
2016-04-10 15:00:32 +00:00
justify-content: flex-start
2016-05-30 18:21:10 +00:00
& > .control
2016-03-25 13:38:40 +00:00
&:not(:last-child)
2016-05-30 18:21:10 +00:00
margin-bottom: 0
2016-03-25 13:38:40 +00:00
margin-right: 10px
2016-05-30 18:21:10 +00:00
&.is-expanded
flex: 1
2016-04-10 15:00:32 +00:00
&.is-grouped-centered
justify-content: center
&.is-grouped-right
justify-content: flex-end
&.is-horizontal
2016-03-26 15:38:33 +00:00
+tablet
display: flex
2016-03-26 15:38:33 +00:00
& > .control
display: flex
flex: 5
2016-04-10 15:00:32 +00:00
&.is-loading
&:after
@extend .loader
position: absolute !important
right: 8px
top: 8px