szurubooru/client/css/core-forms.styl

351 lines
7.9 KiB
Stylus
Raw Normal View History

2016-04-13 20:06:34 +02:00
@import colors
form
display: block
width: 20em
.input
2016-04-13 20:06:34 +02:00
list-style-type: none
margin: 0 0 2em 0
2016-04-13 20:06:34 +02:00
padding: 0
li
2016-07-29 12:38:36 +02:00
margin-top: 1.2em
2016-04-13 20:06:34 +02:00
label
display: block
2016-07-29 12:38:36 +02:00
padding: 0.3em 0
2016-04-13 20:06:34 +02:00
.input li:first-child label:not(.radio):not(.checkbox):not(.file-dropper),
.input li:first-child
padding-top: 0
margin-top: 0
form:not(.horizontal)
2016-04-13 20:06:34 +02:00
.hint
margin-top: 0.2em
2016-04-13 20:06:34 +02:00
margin-bottom: 0
color: $inactive-link-color
font-size: 80%
line-height: 120%
2016-04-14 12:11:31 +02:00
form.horizontal
display: inline-block
margin-bottom: 1em
.input, .buttons, ul
display: inline-block
2017-12-16 03:45:51 +01:00
vertical-align: top
2016-04-14 12:11:31 +02:00
margin: 0
padding: 0
input
2017-12-16 03:45:51 +01:00
vertical-align: top
2016-04-14 12:11:31 +02:00
.buttons
margin-right: 0.5em
2017-12-16 03:45:51 +01:00
@media (max-width: 1000px)
display: block
.input, .buttons, ul
display: block
margin-top: 0.5em
&:first-child
margin-top: 0
.buttons
margin-right: 0
2016-04-14 12:11:31 +02:00
2016-04-13 20:06:34 +02:00
/*
* Radio buttons and checkboxes
*/
input[type=radio], input[type=checkbox]
position: absolute
opacity: 0
.radio, .checkbox
box-sizing: border-box
position: relative
display: inline-block
padding-left: calc(20px + 0.5em) !important
vertical-align: middle
cursor: pointer
&:hover:before
border-color: $main-color
.radio:before
border-radius: 100%
.radio:before, .checkbox:before
transition: border-color 0.1s linear
position: absolute
left: 0
top: 0.15em
2016-04-13 20:06:34 +02:00
display: block
width: 16px
height: 16px
background: $input-enabled-background-color
border: 2px solid $input-enabled-border-color
content: ''
.radio:after
background: $main-color
transition: opacity 0.1s linear
position: absolute
left: 5px
top: 0.15em
margin-top: 5px
2016-04-13 20:06:34 +02:00
display: block
width: 10px
height: 10px
border-radius: 50%
content: ''
opacity: 0
.checkbox:after
transition: opacity 0.1s linear
position: absolute
top: 0.15em
2016-04-13 20:06:34 +02:00
left: 6px
display: block
margin-top: 3px
2016-04-13 20:06:34 +02:00
width: 5px
height: 9px
border-right: 3px solid $main-color
border-bottom: 3px solid $main-color
content: ''
opacity: 0
transform: rotate(45deg)
input[type=radio]:checked + .radio:before,
input[type=checkbox]:checked + .checkbox:before
border-color: $main-color
input[type=radio]:checked + .radio:after,
input[type=checkbox]:checked + .checkbox:after
opacity: 1
input[type=radio]:disabled + .radio:before,
input[type=checkbox]:disabled + .checkbox:before,
input[type=radio]:disabled + .radio:after,
input[type=checkbox]:disabled + .checkbox:after
border-color: $input-disabled-text-color
input[type=radio]:disabled + .radio,
input[type=checkbox]:disabled + .checkbox
border-color: $input-disabled-text-color
input[type=radio]:focus + .radio:before,
input[type=checkbox]:focus + .checkbox:before
border-color: $main-color
/*
* Date and time inputs
*/
input[type=date],
input[type=time]
vertical-align: top
font-family: 'Droid Sans', sans-serif
font-size: 100%
padding: 0.2em 0.3em
box-sizing: border-box
border: 2px solid $input-enabled-border-color
background: $input-enabled-background-color
color: $input-enabled-text-color
box-shadow: none /* :-moz-submit-invalid on FF */
transition: border-color 0.1s linear, background-color 0.1s linear
&:disabled
border: 2px solid $input-disabled-border-color
background: $input-disabled-background-color
color: $input-disabled-text-color
&:focus
border-color: $main-color
&[readonly]
border: 2px solid $input-disabled-border-color
background: $input-disabled-background-color
color: $input-disabled-text-color
2016-04-13 20:06:34 +02:00
/*
* Regular inputs
*/
select,
textarea,
input[type=text],
input[type=email],
input[type=password],
input[type=number]
vertical-align: top
2016-04-14 13:11:26 +02:00
font-family: 'Droid Sans', sans-serif
2016-04-13 20:06:34 +02:00
font-size: 100%
padding: 0.2em 0.3em
2016-04-13 20:06:34 +02:00
text-overflow: ellipsis
width: 100%
box-sizing: border-box
border: 2px solid $input-enabled-border-color
background: $input-enabled-background-color
color: $input-enabled-text-color
box-shadow: none /* :-moz-submit-invalid on FF */
2016-04-13 20:06:34 +02:00
transition: border-color 0.1s linear, background-color 0.1s linear
&:disabled
border: 2px solid $input-disabled-border-color
background: $input-disabled-background-color
color: $input-disabled-text-color
&:focus
border-color: $main-color
&[readonly]
border: 2px solid $input-disabled-border-color
background: $input-disabled-background-color
color: $input-disabled-text-color
input[readonly],
input[readonly]+.radio,
input[readonly]+.checkbox,
input:disabled+.radio,
input:disabled+.checkbox,
input:disabled
cursor: not-allowed
2016-05-10 10:57:59 +02:00
label.color
white-space: nowrap
2016-05-10 10:57:59 +02:00
position: relative
display: flex
2016-05-10 10:57:59 +02:00
input[type=text]
margin-right: 0.25em
width: auto
.preview
display: inline-block
2016-05-10 10:57:59 +02:00
text-align: center
padding: 0 0.5em
border: 2px solid black
&:after
content: 'A'
.background-preview
border-right: 0
color: transparent
.text-preview
border-left: 0
2016-05-10 10:57:59 +02:00
2016-04-13 20:06:34 +02:00
form.show-validation .input
input:invalid
outline: 0
2016-04-13 20:06:34 +02:00
border: 2px solid $input-bad-border-color
background: $input-bad-background-color
input:valid
outline: 0
2016-04-13 20:06:34 +02:00
border: 2px solid $input-good-border-color
background: $input-good-background-color
/*
* Buttons
*/
button,
input[type=button],
input[type=submit]
cursor: pointer
font-size: 100%
padding: 0.2em 0.7em
2017-12-16 03:45:51 +01:00
border-radius: 0
border: 2px solid $button-enabled-background-color
2016-04-13 20:06:34 +02:00
background: $button-enabled-background-color
color: $button-enabled-text-color
outline: 0 /* something on Chrome */
2017-12-16 03:45:51 +01:00
-moz-appearance: none
-webkit-appearance: none
2016-04-13 20:06:34 +02:00
&:disabled
cursor: default
border-color: $button-disabled-background-color
background-color: $button-disabled-background-color
color: $button-disabled-text-color
&.discourage
border-color: transparent
background-color: transparent
color: $button-disabled-text-color
2016-04-13 20:06:34 +02:00
&:focus
border: 2px solid $text-color
2016-04-13 20:06:34 +02:00
select:-moz-focusring
text-shadow: 0
button::-moz-focus-inner,
input::-moz-focus-inner
border: 0
/*
* File dropper
*/
2016-08-20 22:31:22 +02:00
.file-dropper-holder
.file-dropper
display: block
background: $window-color
border: 3px dashed #eee
padding: 0.3em 0.5em
line-height: 140%
text-align: center
cursor: pointer
overflow: hidden
2016-08-20 22:31:22 +02:00
word-wrap: break-word
.url-holder
display: flex
2016-08-20 22:31:22 +02:00
margin-top: 0.5em
input, button
min-width: 0 /* firefox being sassy */
width: auto !important /* don't inherit anything weird */
input
flex: 1
button
margin-left: 0.5em
2016-04-13 20:06:34 +02:00
input[type=file]:disabled+.file-dropper
cursor: default
opacity: .5
input[type=file]:active+.file-dropper,
input[type=file]:focus+.file-dropper,
.file-dropper.active
border-color: $main-color
2016-05-15 11:24:52 +02:00
.autocomplete
position: absolute
z-index: 10
background: $window-color
2016-05-15 11:24:52 +02:00
border: 2px solid $main-color
display: none
font-size: 0.95em
ul
list-style-type: none
margin: 0
padding: 0
li
margin: 0
a
display: block
padding: 0.1em 0.5em
&.active a, a:hover
background: $button-enabled-background-color
color: $button-enabled-text-color
span
color: $button-enabled-text-color
.disabled
color: $inactive-link-color
.anticomplete
display: none