szurubooru/client/css/forms.css

215 lines
4.7 KiB
CSS
Raw Normal View History

2016-03-28 00:19:44 +02:00
form {
display: block;
width: 20em;
}
form fieldset {
margin: 0;
padding: 0;
border: 0;
}
form fieldset legend {
display: block;
text-align: center;
width: 100%;
font-size: 17pt;
}
form ul {
list-style-type: none;
margin: 0;
padding: 0;
}
2016-03-28 00:19:44 +02:00
form ul li {
margin-top: 0.5em;
}
form .buttons {
margin-top: 1em;
}
form .input li:first-child label,
form .input li:first-child {
padding-top: 0;
margin-top: 0;
}
form.tabular ul {
display: table;
border-spacing: 0.5em;
margin: 0.5em -0.5em;
width: 100%;
}
form.tabular ul li {
display: table-row;
}
form.tabular ul li label {
display: table-cell;
width: 33%;
padding: 0;
}
form.tabular .buttons {
margin-left: 33%;
}
form:not(.tabular) ul li label {
display: block;
2016-03-28 00:19:44 +02:00
padding: 0.5em 0;
}
/*
* Radio buttons and checkboxes
*/
2016-03-28 00:19:44 +02:00
input[type=radio], input[type=checkbox] {
float: left;
position: absolute;
opacity: 0;
2016-03-28 00:19:44 +02:00
}
.radio, .checkbox {
box-sizing: border-box;
position: relative;
display: inline-block;
padding-left: calc(20px + 0.5em) !important;
vertical-align: middle;
cursor: pointer;
}
.radio:hover:before, .checkbox:hover:before {
border-color: var(--main-color);
}
.radio:before, .checkbox:before {
transition: border-color 0.1s linear;
position: absolute;
top: 50%;
left: 0;
display: block;
margin-top: -10px;
width: 16px;
height: 16px;
2016-04-06 15:11:20 +02:00
background: var(--input-enabled-background-color);
border: 2px solid var(--input-enabled-border-color);
2016-03-28 00:19:44 +02:00
content: '';
}
.radio:after {
transition: opacity 0.1s linear;
position: absolute;
top: 50%;
left: 5px;
display: block;
margin-top: -5px;
width: 10px;
height: 10px;
border-radius: 50%;
content: '';
opacity: 0;
}
.checkbox:after {
transition: opacity 0.1s linear;
position: absolute;
top: 50%;
left: 6px;
display: block;
margin-top: -7px;
width: 5px;
height: 9px;
border-right: 3px solid var(--main-color);
border-bottom: 3px solid var(--main-color);
content: '';
opacity: 0;
transform: rotate(45deg);
}
input[type=radio]:checked + .radio:before,
input[type=checkbox]:checked + .checkbox:before {
border-color: var(--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: var(--input-disabled-text-color);
}
input[type=radio]:disabled + .radio,
input[type=checkbox]:disabled + .checkbox {
border-color: var(--input-disabled-font-color);
}
input[type=radio]:focus + .radio:before,
input[type=checkbox]:focus + .checkbox:before {
border-color: var(--main-color);
}
/*
* Regular inputs
*/
textarea,
input[type=text],
input[type=email],
input[type=password] {
font-family: 'Inconsolata', monospace;
2016-04-06 15:11:20 +02:00
font-size: 100%;
padding: 0.3em;
text-overflow: ellipsis;
width: 100%;
box-sizing: border-box;
2016-04-06 15:11:20 +02:00
border: 2px solid var(--input-enabled-border-color);
background: var(--input-enabled-background-color);
color: var(--input-enabled-text-color);
box-shadow: none; /* :-moz-submit-invalid on FF */
2016-04-06 15:11:20 +02:00
transition: border-color 0.1s linear, background-color 0.1s linear;
}
textarea:disabled,
input[type=text]:disabled,
input[type=email]:disabled,
input[type=password]:disabled {
border: 2px solid var(--input-disabled-border-color);
background: var(--input-disabled-background-color);
color: var(--input-disabled-text-color);
}
2016-03-28 00:19:44 +02:00
textarea:focus,
input[type=text]:focus,
input[type=email]:focus,
input[type=password]:focus {
border-color: var(--main-color);
}
form.show-validation fieldset.input input:invalid {
outline: none;
2016-03-28 00:19:06 +02:00
border: 2px solid var(--input-bad-border-color);
background: var(--input-bad-background-color);
}
form.show-validation fieldset.input input:valid {
outline: none;
2016-03-28 00:19:06 +02:00
border: 2px solid var(--input-good-border-color);
background: var(--input-good-background-color);
}
/*
* Buttons
*/
button,
input[type=button],
input[type=submit] {
cursor: pointer;
font-size: 100%;
line-height: 100%;
padding: 0.3em 0.7em;
2016-04-06 15:11:20 +02:00
border: 1px solid var(--button-enabled-background-color);
background: var(--button-enabled-background-color);
color: var(--button-enabled-text-color);
}
button:disabled,
input[type=button]:disabled,
input[type=submit]:disabled {
cursor: default;
border-color: var(--button-disabled-background-color);
background-color: var(--button-disabled-background-color);
color: var(--button-disabled-text-color);
}