philomena/assets/css/elements/forms.css

188 lines
3.1 KiB
CSS
Raw Normal View History

2019-08-18 02:43:44 +02:00
form p {
margin-left: 0;
}
.field--block {
display: block;
}
.field--inline {
display: flex;
}
.field-error-js {
2024-12-17 17:49:05 +01:00
background: var(--warning-light-color);
2019-08-18 02:43:44 +02:00
padding: 3px;
}
.input {
box-sizing: border-box;
padding: 6px;
2024-12-17 17:49:05 +01:00
border: 1px solid var(--input-border);
2019-08-18 02:43:44 +02:00
font-size: 14px;
2024-12-17 17:49:05 +01:00
font-family: var(--font-family-monospace);
color: var(--input-text-color);
background: var(--input-color);
2019-08-18 02:43:44 +02:00
max-width: 100%; /* prevent resizable inputs from overflowing the container */
}
.input::placeholder {
opacity: 0.54;
color: inherit;
}
2019-08-18 02:43:44 +02:00
.input[required]:invalid {
box-shadow: none;
}
.input:focus {
outline: none;
2024-12-17 17:49:05 +01:00
border: 1px solid var(--input-border-active);
background: var(--input-color-active);
2019-08-18 02:43:44 +02:00
}
.input--wide {
width: 100%;
}
.input--short {
max-width: 30em;
}
.input--small {
padding: 0 3px;
}
.input--text {
min-height: 8.6em;
2019-08-18 02:43:44 +02:00
}
.input--separate-left {
margin-left: 5px;
}
.input--separate-top {
margin-top: 5px;
}
.input--decoy {
display: inline-block;
width: 0;
height: 0;
border: 0;
padding: 0;
box-sizing: border-box;
}
.input--resize-vertical {
resize: vertical;
}
2019-08-18 02:43:44 +02:00
.checkbox {
margin: 0.2em 0 0 0.4em;
padding: 0;
}
textarea {
height: 4em;
}
2024-12-17 17:49:05 +01:00
.field,
.actions {
2019-08-18 02:43:44 +02:00
margin-bottom: 6px;
}
.field_with_errors {
2024-12-17 17:49:05 +01:00
background: var(--danger-color);
2019-08-18 02:43:44 +02:00
}
2019-11-02 14:28:54 +01:00
span.help-block {
2024-12-17 17:49:05 +01:00
background: var(--danger-color);
2019-11-02 14:28:54 +01:00
display: block;
}
2019-08-18 02:43:44 +02:00
/* hform is used for 30em inline 2-element textinput/button forms */
.hform .field {
display: flex;
max-width: 30em;
width: 100%;
}
/* text input - grow to container size */
.hform__text {
flex: 1 0 auto;
}
/* button - don't shrink or grow at all */
.hform__button {
flex: 0 0 auto;
margin-left: 5px;
}
/* Click-toggleable */
.toggle-box {
display: none;
}
.toggle-box + label {
position: relative;
}
2024-12-17 17:49:05 +01:00
.toggle-box + label > * {
display: inline;
}
.toggle-box + label:before {
2019-08-18 02:43:44 +02:00
content: "";
width: 0;
height: 0;
border-style: solid;
display: inline-block;
margin-right: 0.25em;
border-width: 0.5em 0 0.5em 0.9em;
2024-12-17 17:49:05 +01:00
border-color: transparent transparent transparent var(--foreground-color);
2019-08-18 02:43:44 +02:00
}
2024-12-17 17:49:05 +01:00
.toggle-box:checked + label:before {
2019-08-18 02:43:44 +02:00
border-width: 0.9em 0.5em 0;
2024-12-17 17:49:05 +01:00
border-color: var(--foreground-color) transparent transparent transparent;
2019-08-18 02:43:44 +02:00
}
.toggle-box-container {
overflow: hidden;
position: relative;
height: 0;
}
.toggle-box:checked + label + .toggle-box-container {
height: auto;
}
.toggle-box:checked + label + .toggle-box-container > .toggle-box-container__content {
2024-12-17 17:49:05 +01:00
margin-top: var(--block-spacing);
2019-08-18 02:43:44 +02:00
}
2024-12-17 17:49:05 +01:00
select.input,
select.input:focus {
-moz-appearance: none;
appearance: none;
2024-12-17 17:49:05 +01:00
background:
2024-12-19 17:37:02 +01:00
linear-gradient(45deg, transparent 50%, var(--foreground-color) 50%) calc(100% - 15px) 12px / 5px 5px no-repeat,
linear-gradient(135deg, var(--foreground-color) 50%, transparent 50%) calc(100% - 10px) 12px / 5px 5px no-repeat;
padding-right: 25px;
2024-12-17 17:49:05 +01:00
}
2024-12-17 17:49:05 +01:00
select.input option,
select.input:focus option {
background-color: var(--input-color);
}
2024-12-17 17:49:05 +01:00
select.input:hover option,
select.input:focus:hover option {
background-color: var(--input-color-active);
}
2024-12-17 17:49:05 +01:00
select.input:hover,
select.input:focus:hover {
cursor: pointer;
2024-12-17 17:49:05 +01:00
background-color: var(--input-color-active);
}