Ghost/ghost/admin/app/styles/patterns/forms.css
2015-05-22 19:05:09 +01:00

324 lines
6.2 KiB
CSS

/* Forms
/* ---------------------------------------------------------- */
form * {
user-select: text;
}
form label {
display: block;
color: var(--darkgrey);
font-size: 1.3rem;
font-weight: bold;
}
form .word-count {
float: right;
font-weight: bold;
}
fieldset {
border: none;
margin: 0 0 3em 0;
padding: 0;
}
legend {
display: block;
width: 100%;
margin: 2em 0;
border-bottom: #e1e1e1 1px solid;
font-size: 1.2em;
line-height: 2.0em;
color: var(--brown);
}
input {
user-select: text;
}
/* Form Groups
/* ---------------------------------------------------------- */
.form-group {
position: relative;
margin-bottom: 1.6em;
width: 100%;
max-width: 500px;
}
.form-group p {
margin: 4px 0 0 0;
color: #B3B2A8;
font-size: 1.3rem;
}
.form-group label {
margin-bottom: 4px;
}
@media (max-width: 550px) {
.form-group {
max-width: 100%;
}
}
/* Input Icons
/* ---------------------------------------------------------- */
.input-icon[class*='icon-'] {
position: relative;
display: block;
}
.input-icon[class*='icon-'] input[type="email"],
.input-icon[class*='icon-'] input[type="number"],
.input-icon[class*='icon-'] input[type="password"],
.input-icon[class*='icon-'] input[type="search"],
.input-icon[class*='icon-'] input[type="tel"],
.input-icon[class*='icon-'] input[type="text"],
.input-icon[class*='icon-'] input[type="url"],
.input-icon[class*='icon-'] input[type="date"] {
padding-left: 3.2rem;
}
.input-icon[class*='icon-'] .gh-select select {
padding-left: 3.2rem;
}
.input-icon[class*='icon-']:before {
position: absolute;
top: 50%;
left: 1.1rem;
font-size: 1.3rem;
transform: translateY(-52%);
z-index: 100;
}
/* Inputs
/* ---------------------------------------------------------- */
.gh-input,
.gh-select,
select {
display: block;
padding: 8px 10px;
width: 100%;
border: 1px solid #E0DFD7;
border-radius: var(--border-radius);
-webkit-appearance: none;
font-size: 1.4rem;
font-weight: normal;
color: var(--darkgrey);
transition: border-color 0.15s linear;
user-select: text;
}
.gh-input.error,
.gh-select.error,
select.error {
border-color: var(--red);
}
.gh-input:focus,
.gh-select:focus,
select:focus {
border-color: var(--brown);
outline: 0;
}
textarea {
width: 100%;
max-width: 500px;
min-width: 250px;
height: auto;
min-height: 10rem;
line-height: 1.5;
resize: vertical;
user-select: text;
}
/* Radio / Checkboxes
/* ---------------------------------------------------------- */
.for-radio label,
.for-checkbox label {
display: block;
padding-bottom: 4px;
}
.for-radio label p,
.for-checkbox label p {
font-weight: normal;
color: #000;
}
.for-radio label:hover input:not(:checked) + .input-toggle-component,
.for-checkbox label:hover input:not(:checked) + .input-toggle-component {
border-color: var(--midbrown);
}
.for-radio input,
.for-checkbox input {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: -9999px;
}
.for-radio .input-toggle-component,
.for-checkbox .input-toggle-component {
position: relative;
top: 1px;
display: inline-block;
float: left;
width: 18px;
height: 18px;
margin-right: 7px;
background: #F7F7F3;
border: 1px solid #e1e1e1;
}
.for-radio p,
.for-checkbox p {
font-weight: normal;
color: #B3B2A8;
white-space: nowrap;
}
.for-checkbox .input-toggle-component {
border-radius: var(--border-radius);
}
.for-checkbox label .input-toggle-component {
transition: background 0.15s ease-in-out, border-color 0.15s ease-in-out;
}
.for-checkbox label .input-toggle-component:before {
transition: opacity 0.15s ease-in-out;
content: '';
position: absolute;
width: 10px;
height: 6px;
top: 4px;
left: 3px;
border: 2px solid #fff;
border-top: none;
border-right: none;
transform: rotate(-45deg);
opacity: 0;
}
.for-checkbox label input:checked + .input-toggle-component {
background: var(--green);
border-color: color(var(--green) lightness(-10%));
}
.for-checkbox label input:checked + .input-toggle-component:before {
opacity: 1;
}
.for-radio .input-toggle-component {
border-radius: 100px;
}
.for-radio label .input-toggle-component {
transition: background 0.15s ease-in-out, border-color 0.15s ease-in-out;
}
.for-radio label .input-toggle-component:before {
transition: opacity 0.15s ease-in-out;
content: '';
position: absolute;
width: 8px;
height: 8px;
top: 4px;
left: 4px;
background: #FFF;
border-radius: 100%;
opacity: 0;
}
.for-radio label input:checked + .input-toggle-component {
background: var(--green);
border-color: color(var(--green) lightness(-10%));
}
.for-radio label input:checked + .input-toggle-component:before {
opacity: 1;
}
/* Select
/* ---------------------------------------------------------- */
.gh-select {
position: relative;
display: block;
overflow: hidden;
width: 100%;
max-width: 100%;
padding: 0;
border-width: 0;
}
.gh-select:after {
font-family: "ghosticons" !important;
font-style: normal !important;
font-weight: normal !important;
font-variant: normal !important;
text-transform: none !important;
speak: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
position: absolute;
top: 50%;
right: 0.8em;
margin-top: -0.5em;
pointer-events: none;
content: "\e00f";
}
.gh-select select {
appearance: none;
-webkit-appearance: none;
-moz-appearance: window;
text-indent: 0.01px;
text-overflow: "";
background: #fff;
outline: none;
padding: 8px 10px;
line-height: normal;
}
.gh-select select::-ms-expand {
display: none;
}
.gh-select select:-moz-focusring {
color: transparent;
text-shadow: 0 0 0 #000;
}
/* FFF: Fucking Firefox Fixes
/* ---------------------------------------------------------- */
@-moz-document url-prefix() {
.gh-select {
border-width: 1px;
}
.gh-select select {
padding: 7px 10px 7px 8px;
}
.gh-select:focus {
border-color: var(--brown);
}
}