266 lines
5.5 KiB
CSS
266 lines
5.5 KiB
CSS
/* Based on FormHack v1.2.0 (formhack.io) */
|
|
/* But with some custom modifications */
|
|
|
|
/* Config ----------------------------- */
|
|
:root {
|
|
|
|
/* Font */
|
|
--fh-font-family: 'Raleway', sans-serif;
|
|
--fh-font-size: 16px;
|
|
--fh-font-color: var(--color-input-text);
|
|
|
|
/* Borders */
|
|
--fh-border-radius: 5px;
|
|
--fh-border-width: 1px;
|
|
--fh-border-style: solid;
|
|
--fh-border-color: var(--color-input-border);
|
|
|
|
/* Inputs, Textareas, Select, Option */
|
|
--fh-input-height: 40px;
|
|
--fh-input-width: 100%;
|
|
--fh-input-max-width: 100%;
|
|
--fh-input-bg-color: var(--color-input-bg);
|
|
--fh-focus-bg-color: var(--fh-input-bg-color);
|
|
--fh-focus-border-color: var(--color-palette-blue);
|
|
--fh-focus-font-color: var(--fh-font-color);
|
|
|
|
/* Select Vendor Styling */
|
|
--fh-select-vendor-styling: none; /* comment this out to maintain vendor styling */
|
|
|
|
|
|
/* Buttons & Input Submits */
|
|
--fh-button-height: 40px;
|
|
--fh-button-width: 100%;
|
|
--fh-button-min-width: 200px;
|
|
--fh-button-font-color: var(--cta-color);
|
|
--fh-button-bg-color: var(--cta-bg);
|
|
--fh-button-hover-bg-color: var(--cta-bg-hover);
|
|
--fh-button-hover-font-color: var(--fh-button-font-color);
|
|
|
|
/* Layout */
|
|
--fh-layout-display: block;
|
|
--fh-layout-margin: var(--grid-gutter) 0; /* change to "10px auto" to center */
|
|
--fh-layout-text-align: left;
|
|
}
|
|
|
|
|
|
|
|
/* Global Reset Styles ------------------ */
|
|
|
|
input,
|
|
textarea,
|
|
select,
|
|
option,
|
|
optgroup,
|
|
button,
|
|
legend,
|
|
fieldset,
|
|
.cta {
|
|
box-sizing: border-box;
|
|
outline: none;
|
|
|
|
font-family: var(--fh-font-family);
|
|
font-size: var(--fh-font-size);
|
|
color: var(--fh-font-color);
|
|
vertical-align: top;
|
|
|
|
display: var(--fh-layout-display);
|
|
margin: var(--fh-layout-margin);
|
|
text-align: var(--fh-layout-text-align);
|
|
}
|
|
|
|
|
|
datalist {
|
|
font-family: var(--fh-font-family);
|
|
font-size: var(--fh-font-size);
|
|
}
|
|
|
|
label {
|
|
display: var(--fh-layout-display);
|
|
margin: var(--fh-layout-margin) 0 0;
|
|
text-align: var(--fh-layout-text-align);
|
|
font-weight: bold;
|
|
font-size: 0.875em;
|
|
|
|
& + input {
|
|
margin-top: calc(var(--grid-gutter) * 0.25)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* Input & Textarea ------------------ */
|
|
|
|
/* Fields with standard width */
|
|
input[type="text"],
|
|
input[type="email"],
|
|
input[type="password"],
|
|
input[type="search"],
|
|
input[type="color"],
|
|
input[type="date"],
|
|
input[type="datetime-local"],
|
|
input[type="month"],
|
|
input[type="number"],
|
|
input[type="tel"],
|
|
input[type="time"],
|
|
input[type="url"],
|
|
input[type="week"],
|
|
input[list],
|
|
input[type="file"],
|
|
/* select, */
|
|
textarea {
|
|
width: var(--fh-input-width);
|
|
max-width: var(--fh-input-max-width);
|
|
padding: calc( var(--fh-input-height) / 5 );
|
|
background-color: var(--fh-input-bg-color);
|
|
|
|
border-radius: var(--fh-border-radius);
|
|
border-width: var(--fh-border-width);
|
|
border-style: var(--fh-border-style);
|
|
border-color: var(--fh-border-color);
|
|
}
|
|
|
|
/* Fields with standard height */
|
|
input[type="text"],
|
|
input[type="email"],
|
|
input[type="password"],
|
|
input[type="search"],
|
|
input[type="color"],
|
|
input[type="date"],
|
|
input[type="datetime-local"],
|
|
input[type="month"],
|
|
input[type="number"],
|
|
input[type="tel"],
|
|
input[type="time"],
|
|
input[type="url"],
|
|
input[type="week"],
|
|
input[list] {
|
|
height: var(--fh-input-height);
|
|
-webkit-appearance: none;
|
|
}
|
|
|
|
/* Other */
|
|
|
|
textarea {
|
|
-webkit-appearance: none;
|
|
overflow: auto;
|
|
}
|
|
|
|
input[type="range"] {
|
|
height: var(--fh-input-height);
|
|
width: var(--fh-input-width);
|
|
max-width: var(--fh-input-max-width);
|
|
}
|
|
|
|
input[type="file"] {
|
|
min-height: var(--fh-input-height);
|
|
}
|
|
|
|
input[type="search"] {
|
|
height: var(--fh-input-height);
|
|
-webkit-appearance: none;
|
|
}
|
|
input[type="search"]::-webkit-search-cancel-button,
|
|
input[type="search"]::-webkit-search-decoration {
|
|
-webkit-appearance: none;
|
|
}
|
|
|
|
input[type="checkbox"],
|
|
input[type="radio"] {
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
}
|
|
/* For checkbox and radio to be centered, need to wrap the input and label in a span -
|
|
/* .checkbox-container {
|
|
/* display: block;
|
|
/* text-align: center;
|
|
/* }
|
|
|
|
|
|
/* Fieldset ------------------ */
|
|
|
|
fieldset {
|
|
padding: 0;
|
|
border: 0;
|
|
}
|
|
|
|
legend {
|
|
padding: 0;
|
|
font-weight: inherit;
|
|
}
|
|
|
|
/* Buttons, Input Type Submit/Reset ------------------ */
|
|
|
|
button,
|
|
input[type="button"],
|
|
input[type="submit"],
|
|
input[type="reset"],
|
|
input[type="image"],
|
|
.cta {
|
|
display: inline-block;
|
|
height: var(--fh-button-height);
|
|
min-width: var(--fh-button-min-width);
|
|
background-color: var(--fh-button-bg-color);
|
|
padding: 0 2em;
|
|
cursor: pointer;
|
|
|
|
line-height: var(--fh-button-height);
|
|
color: var(--fh-button-font-color);
|
|
font-weight: normal;
|
|
|
|
-webkit-appearance: none;
|
|
-moz-appearance: none;
|
|
|
|
border: none;
|
|
border-radius: var(--cta-radius);
|
|
text-align: center;
|
|
}
|
|
|
|
input[type="image"] {
|
|
text-align: center;
|
|
padding: calc( var(--fh-input-height) / 5 );
|
|
}
|
|
|
|
/* States ------------------ */
|
|
|
|
input[disabled],
|
|
textarea[disabled],
|
|
select[disabled],
|
|
option[disabled],
|
|
button[disabled] {
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
input:focus,
|
|
textarea:focus,
|
|
select:focus,
|
|
option:focus {
|
|
border-color: var(--color-palette-blue);
|
|
color: var(--fh-font-color);
|
|
}
|
|
|
|
button:focus,
|
|
.cta:focus {
|
|
background-color: var(--fh-button-hover-bg-color);
|
|
color: var(--fh-button-hover-font-color);
|
|
}
|
|
|
|
input[type="checkbox"]:focus,
|
|
input[type="radio"]:focus {
|
|
outline: var(--fh-focus-border-color) solid 2px;
|
|
}
|
|
|
|
button:hover,
|
|
input[type="button"]:hover,
|
|
input[type="submit"]:hover,
|
|
input[type="reset"]:hover,
|
|
button:focus,
|
|
input[type="button"]:focus,
|
|
input[type="submit"]:focus,
|
|
input[type="reset"]:focus,
|
|
.cta:hover,
|
|
.cta:focus {
|
|
background-color: var(--fh-button-hover-bg-color);
|
|
color: var(--fh-button-hover-font-color);
|
|
}
|