gadjo/gadjo/static/css/_forms.scss

420 lines
7.6 KiB
SCSS
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@charset "UTF-8";
$button-color: $primary-color;
$button-cancel-color: darken(grayscale($button-color), 10%);
$button-delete-color: #CD2026;
$button-submit-color: #215D9C;
input, select, button, textarea {
font-size: 100%;
font-family: $font-family;
}
label {
margin-bottom: 0;
font-weight: normal;
}
form div.widget {
margin-bottom: 2ex;
}
div.errornotice p {
margin: 1ex 0;
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 0;
}
}
div.error {
color: black;
font-weight: normal;
background: transparent;
padding-left: 0px;
margin-left: 2px;
}
div.error::before {
content: "\f071"; /* fa-exclamation-triangle */
font-family: FontAwesome;
padding-right: 1ex;
}
span.required {
margin-left: 0.7ex;
position: relative;
top: -0.2ex;
cursor: help;
}
div.widget div.title {
margin-bottom: 0;
}
div.buttons {
margin-top: 2em;
}
div.buttons div {
display: inline-block;
& input[name="submit"] {
font-weight: bold;
}
}
a.button {
padding-bottom: calc(1ex + 1px);
line-height: 2.5em;
}
%button {
padding: 5px 15px;
cursor: pointer;
border: 0px solid #aaa;
@include vendor-prefix('transition', 'all 200ms ease');
vertical-align: baseline;
border-radius: 3px;
font-weight: bold;
background: white;
border: 1px solid $button-color;
color: $button-color;
&:hover {
background: $button-color;
color: white;
border-color: darken($button-color, 20%);
}
&:active { border-color: darken($button-color, 10%); }
&:focus {
border-color: darken($button-color, 20%);
}
@include vendor-prefix('transition', 'border-color 0.2s ease, box-shadow 0.2s linear');
}
a.button, button, input[type=submit], div.buttons input, div.buttons a.cancel {
@extend %button;
}
input[type=submit] {
height: 2.3rem;
}
a.cancel-button, button.cancel-button, div.buttons .cancel-button input, div.buttons a.cancel, div.buttons .cancel-button button {
color: $button-cancel-color;
border-color: $button-cancel-color;
&:hover {
background: #eee;
color: $button-cancel-color;
border-color: darken($button-cancel-color, 20%);
}
&:active { border-color: darken($button-cancel-color, 10%); }
}
div.buttons {
display: flex;
flex-wrap: wrap;
// always force cancel button to be last
a.cancel {
order: 100;
margin-left: 1em;
}
}
a.delete-button, button.delete-button, div.buttons .delete-button input, div.buttons .delete-button button {
color: $button-delete-color;
border-color: $button-delete-color;
&:hover {
background: $button-delete-color;
color: white;
border-color: darken($button-delete-color, 20%);
}
&:active { border-color: darken($button-delete-color, 10%); }
}
a.submit-button, button.submit-button, div.buttons .submit-button input, div.buttons .submit-button button {
color: $button-submit-color;
border-color: $button-submit-color;
&:hover {
color: white;
background: $button-submit-color;
border-color: darken($button-submit-color, 20%);
}
&:active { border-color: darken($button-submit-color, 10%); }
}
form.disabled-during-submit {
// this class is added to forms in w.c.s. when a button is clicked.
div.buttons {
cursor: wait;
button {
pointer-events: none;
box-shadow: none;
opacity: 0.7;
}
}
}
div.ui-dialog button.ui-button-disabled,
div#content button:disabled,
input[type=submit]:disabled {
border-color: #888;
color: #888;
background: #f3f3f3;
pointer-events: none;
box-shadow: none;
cursor: not-allowed;
}
input, input[type="text"], input[type="url"], input[type="email"], input[type="password"], input[type="url"], input[type="tel"], input[type="number"], input[type="search"], input[type="file"], input[type="date"], input[type="datetime-local"], input[type="month"], input[type="time"], input[type="week"], textarea, select {
border: 1px solid #AAA;
border-radius: 0px;
box-sizing: border-box;
margin: 0.2em 0px;
outline: medium none;
padding: 0.7ex 0.7em;
max-width: 100%;
@include vendor-prefix('transition', 'background-size 0.2s ease');
background: white;
&:focus {
border-bottom-color: $button-submit-color;
}
&.disabled,
&[disabled] {
background: #eee;
}
}
input[type="text"][name$="_url"], input[type="text"][name$="-url"], input[type="url"] {
width: 100%;
}
input[type="radio"]:focus, input[type="checkbox"]:focus {
box-shadow: none;
}
input[readonly], select[readonly], textarea[readonly] {
border-width: 0 0 1px 0;
}
div.date input[readonly] {
border-width: 1px;
}
input[type=file] {
border: none;
padding-left: 0;
}
select {
background: white;
@include vendor-prefix('appearance', 'none');
padding-right: 4em;
background-image: url(arrow-down.svg);
background-position: right 1.3rem center;
background-repeat: no-repeat;
background-size: 1rem auto;
}
select[multiple] {
background: white;
padding-right: 0;
}
input[type="checkbox"],
input[type="radio"] {
margin-right: 1ex;
margin-bottom: 1ex;
}
div.content label {
margin-right: 1em;
}
div.widget div.content ul {
padding: 0;
margin: 0;
list-style: none;
}
span.helptext,
div.hint {
display: block;
font-size: 80%;
}
form p label {
display: block;
}
div.a2-block form input,
div.a2-block form select {
width: 100%;
}
div.a2-block form input[type=radio] {
width: auto;
}
div.a2-block form input[type=submit] {
width: auto;
min-width: 20ex;
}
div.a2-block ul#id_edit-profile-title {
margin-left: 1em;
margin-top: -1ex;
li {
display: inline-block;
margin-right: 2em;
}
label {
font-weight: normal;
}
}
form ul.errorlist {
padding: 0;
margin: 2em 0 0 0;
list-style: none;
& li::before {
content: "\f06a";
font-family: FontAwesome;
padding-right: 1ex;
}
}
/* fieldsets */
fieldset.gadjo-foldable legend.gadjo-foldable-widget {
border-bottom: 1px solid #aaa;
cursor: pointer;
display: block;
font-weight: bold;
padding: 1ex 0 0;
width: 100%;
position: relative;
}
fieldset.gadjo-foldable legend.gadjo-foldable-widget:after {
content: "";
@include vendor-prefix('transition', 'transform 0.1s ease');
position: absolute;
right: 1ex;
}
fieldset.gadjo-foldable.gadjo-folded legend.gadjo-foldable-widget:after {
transform: rotate(-90deg);
}
fieldset.gadjo-foldable {
padding: 1ex 0 0 0;
border: 0;
}
.gadjo-foldable.gadjo-folded > .gadjo-folding {
display: none;
}
/* form.as_p */
form p {
margin: 0 0 1em 0;
}
form p label {
display: block;
}
form p.required label:after {
padding-left: 1ex;
content: "*";
color: red;
}
form p label {
margin-bottom: 0.3ex;
}
/* form.small */
form.small p input {
margin-left: 0;
}
form.small p {
margin-bottom: 0.5em;
}
form.small label {
width: 200px;
display: inline-block;
}
form.small a.button,
form.small button {
margin-left: 205px;
display: inline-block;
}
form.small button + button,
form.small button + a.button {
margin-left: 1em;
}
[name$="-clear"] + label {
display: inline;
}
.field-live-hint {
position: absolute;
background: #ffffee;
color: #333;
z-index: 1000000;
padding: 1em 1em;
box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.16);
}
.field-live-hint span::before {
font-family: FontAwesome;
content: "\f0eb"; // lightbulb
padding-right: 0.5em;
}
.field-live-hint button.action,
.field-live-hint button.close {
margin: 0 1em;
padding: 0;
color: blue !important;
border: none;
text-decoration: underline !important;
background: transparent !important;
box-shadow: none !important;
}
.field-live-hint button.close {
color: #333 !important;
margin: 0;
text-decoration: none !important;
}
.field-live-hint button.close::after {
content: "×";
}
form {
.widget-optional span.optional {
display: none;
}
}
form.pk-mark-optional-fields {
.widget-required {
span.required {
display: none;
}
}
.widget-optional span.optional {
display: inline;
font-style: italic;
}
}