Files
Grav-Admin-Plugin/themes/grav/scss/template/_forms.scss
2016-03-07 20:05:30 -07:00

417 lines
7.8 KiB
SCSS

// Forms
form {
h1, h3 {
padding: 0 $padding-default 0.5rem;
margin: 0 0 1rem;
font-size: 1.5rem;
text-align: left;
letter-spacing: -1px;
}
h3 {
padding-left: 0;
}
p {
padding: 0 $padding-default;
}
pre {
padding: 1.5rem 3rem;
}
.form-field {
margin-bottom: 1rem;
padding-left: $padding-default;
}
.form-data {
padding-right: $padding-default;
}
.required {
font-family: helvetica, arial;
vertical-align: middle;
line-height: 1;
font-size: 30px;
margin-left: 5px;
}
label {
padding: 5px 0;
font-weight: 400;
margin:0;
[data-hint] {
display: inline;
}
&.toggleable {
display: inline;
}
}
input, select, textarea, button, .selectize-input {
font-size: $core-font-size;
line-height: $core-line-height;
border-radius: $form-border-radius;
-webkit-font-smoothing: antialiased;
}
.selectize-dropdown {
z-index: 100000;
}
// override horizontal layout
.form-column {
> .form-field.grid {
display: block;
> .block {
@include flex(0);
}
}
}
// vertical alignment of forms
.grid.vertical {
@include flex-flow(column);
}
.form-select-wrapper, .selectize-control.single .selectize-input {
position: relative;
&:after {
margin-top: 0;
border: 0;
position: absolute;
content: '\f078';
font-family: 'FontAwesome';
right: 12px;
top: 50%;
line-height: 0;
pointer-events: none;
}
}
.selectize-input {
display: block !important;
box-shadow: none;
padding: $form-select-pad;
margin: 0;
> input {
font-size: $core-font-size;
line-height: $core-line-height;
}
}
.selectize-control.multi .selectize-input {
padding: ($leading-margin / 4) ($leading-margin / 4);
&.has-items {
padding-top: 6px;
padding-bottom: 4px;
}
> div {
border-radius: 2px;
line-height: 1.5;
}
}
.selectize-control.single .selectize-input {
&:after {
right: 27px;
}
&.dropdown-active {
&:after {
content: '\f077';
}
}
}
.x-small {
max-width: 5rem !important;
}
.small {
max-width: 10rem !important;
}
.medium {
max-width: 20rem;
textarea {
height: 7rem;
}
}
.large {
max-width: 30rem !important;
textarea {
height: 10rem;
}
}
select {
width: 100%;
-webkit-appearance:none;
-moz-appearance:none;
appearance:none;
padding: $form-select-pad;
cursor: pointer;
margin: 0;
}
input[type=text], input[type=password], input[type=email], input[type=date] {
width: 100%;
}
input[readonly=readonly] {
font-weight: bold;
}
textarea {
width: 100%;
}
.form-frontmatter-wrapper {
border-radius: $form-border-radius;
}
.switch-toggle {
// margin-left: 30%;
label {
cursor: pointer;
}
a,label {
outline: none !important;
}
}
.dynfields, [data-grav-field="array"] {
input[type=text] {
width: 40%;
float: left;
margin: 0 5px 5px 0;
}
.form-row {
display: inline-block;
span {
padding: 0.5rem;
display: inline-block;
line-height: 1.7;
cursor: pointer;
}
&.array-field-value_only {
width: 100%;
}
}
}
.button-bar {
margin-top: 1rem;
padding: 1.2rem 3rem;
width: 100%;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
.checkboxes {
display: inline-block;
padding: 5px 0;
label {
display: inline;
cursor: pointer;
position: relative;
padding: 0 0 0 2rem;
margin-right: 15px;
}
label:before {
content:"";
display: inline-block;
width: 1.5rem;
height: 1.5rem;
top: 50%;
left: 0;
margin-top: -0.75rem;
margin-right: 10px;
position: absolute;
border-radius: $form-border-radius;
}
input[type=checkbox] {
display: none;
}
input[type=checkbox]:checked + label:before {
content:"\f00c";
font-family: "FontAwesome";
font-size: 1.2rem;
line-height: 1;
text-align: center;
}
&.toggleable label{
margin-right: 0;
}
}
}
// Display
.form-display-wrapper {
p {
padding-left: 0;
padding-right: 0;
&:first-child {
margin-top: 0;
}
}
}
// Frontmatter Field
div.frontmatter {
margin-bottom: 3rem;
}
textarea.frontmatter {
height: 130px !important;
& + .CodeMirror {
border-radius: $form-border-radius;
height: 130px;
}
}
// Sortables
.form-order-wrapper {
ul#ordering {
list-style: none;
margin: 0;
padding: 0;
li {
padding: 0.2rem 1rem;
border-radius: $form-border-radius;
margin: 3px 0;
position: relative;
&.drag-handle {
cursor: move;
&::after {
content: '\f0c9';
font-family: FontAwesome;
position: absolute;
right: 10px;
}
}
}
}
}
// Sortables
.form-list-wrapper {
ul[data-collection-holder] {
list-style: none;
margin: 0;
padding: 0;
> li {
cursor: move;
padding: 1rem;
border-radius: $form-border-radius;
margin: 3px 0;
position: relative;
.item-actions {
position: absolute;
right: 10px;
top: 4px;
.fa-trash-o {
cursor: pointer;
}
}
}
}
.collection-actions {
text-align: right;
}
}
.form-label.block {
z-index: 1;
&:hover {
z-index: 2;
}
}
// Fieldset
#admin-main .admin-block h2 {
font-size: 1.25rem;
margin: 0 0 .5rem;
letter-spacing: normal;
}
.form-fieldset {
margin: 1rem 2rem;
}
.form-fieldset--label {
label {
display: table;
font-size: 1.25rem;
padding: .5rem 1rem;
width: 100%;
}
h2 {
margin: 0 !important;
}
.actions {
font-size: initial;
display: table-cell;
text-align: right;
vertical-align: middle;
}
& + .form-data {
margin-top: 1rem;
padding: 0;
}
}
.form-fieldset--cursor {
cursor: pointer;
}
.form-fieldset--info {
font-size: small;
}
.form-fieldset > input:checked ~ .form-data,
.form-fieldset--collapsible .open,
.form-fieldset input:checked ~ .form-label .form-fieldset--collapsible .close {
display: block;
}
.form-fieldset > .form-data,
.form-fieldset--collapsible .close,
.form-fieldset input:checked ~ .form-label .form-fieldset--collapsible .open {
display: none;
}