Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

318 lines
6.2 KiB

@import '_mixins';
@import '_vars';
//
// Support for Angular validation states.
//
.form-control {
&.ng-invalid {
&.ng-touched,
&.ng-dirty {
& {
border-color: $color-theme-error;
}
&:hover,
&:focus {
border-color: $color-theme-error-dark;
box-shadow: 0 0 .2rem, $color-theme-error;
}
}
}
}
//
// Error tooltip.
//
.errors {
// Container where the tooltip is placed.
&-container {
position: relative;
}
// Small triangle under the error tooltip with the border trick.
&::after {
@include absolute(null, null, -.75rem, .625rem);
@include caret-bottom($color-theme-error, .4rem);
}
// The tooltip rectangle itself.
& {
@include absolute(null, null, .4rem, 0);
@include border-radius(2px);
background: $color-theme-error;
color: $color-dark-foreground;
font-size: .9rem;
font-weight: normal;
padding: .25rem .5rem;
}
}
//
// Align labels to the right.
//
.col-form-label,
.col-form-checkbox-label {
text-align: right;
}
//
// Form alerts.
//
.form-alert {
& {
@include border-radius(4px);
color: $color-dark-foreground;
font-size: .9rem;
font-weight: normal;
margin-bottom: .75rem;
margin-top: .25rem;
padding: .5rem;
padding-right: 1.5rem;
}
&-close {
@include absolute(0, 0, auto, auto);
display: none;
padding: .5rem;
}
&-error {
background: $color-theme-error;
}
&-success {
background: $color-theme-green-dark;
}
&.closeable {
position: relative;
.form-alert-close {
display: inline-block;
}
}
p {
&:last-child {
margin-bottom: 0;
}
}
ul {
margin: 0;
}
}
.form-bubble {
& {
position: relative;
}
.form-alert {
@include absolute(.25rem, 0, auto, auto);
font-size: 1rem;
font-weight: normal;
max-width: 600px;
min-width: 200px;
padding: 1rem;
padding-right: 2.5rem;
text-align: left;
z-index: 2000;
&::after {
@include absolute(-.75rem, .625rem, auto, auto);
@include caret-top($color-theme-error, .4rem);
}
}
}
//
// Control Dropdown item
//
.control-dropdown {
& {
@include absolute(2px, auto, auto, 0);
@include border-radius(.25em);
@include box-shadow;
background: $color-dark-foreground;
border: 1px solid $color-input;
max-height: 15rem;
overflow-x: hidden;
overflow-y: auto;
padding: .25rem 0;
}
&-item {
& {
padding: .5rem .75rem;
}
&.separated {
border-bottom: 1px solid lighten($color-input, 5%);
&:last-child {
border: 0;
}
}
&.active,
&:active,
&:hover {
color: $color-dark-foreground;
.text-muted {
color: $color-dark-foreground !important;
}
}
&:active,
&.active {
background: $color-theme-blue;
&.separated {
border-color: $color-theme-blue;
}
}
&:hover {
background: $color-theme-blue;
&.separated {
border-color: $color-theme-blue;
}
}
&-selectable {
& {
cursor: pointer;
}
}
}
}
//
// Form group error.
//
.form-group {
// Remove the margin after the last form group.
&:last-child {
margin-bottom: 0;
}
// Remove the margin if the next element is hidden.
&~.hidden {
margin-bottom: 0;
}
}
.col-form-label {
font-size: 90%;
}
label {
& {
color: $color-title;
font-size: 90%;
font-weight: 500;
}
&.form-check-label {
font-size: 100%;
font-weight: normal;
}
.hint {
color: $color-text-decent;
}
.text-muted {
font-weight: normal;
}
}
//
// Custom search form.
//
.search-form {
& {
flex-grow: 1;
position: relative;
}
// Keep some additional space for the search icon.
.form-control {
padding-right: 3rem;
}
// Search icon that is placed within the form control.
.icon-search {
@include absolute(.75rem, .75rem, auto, auto);
color: $color-dark2-focus-foreground;
font-size: 1.1rem;
font-weight: lighter;
}
}
// Dark form control for the dark panel.
.form-control-dark {
& {
@include placeholder-color($color-dark2-placeholder);
background: $color-dark2-control;
border: 1px solid $color-dark2-control;
color: darken($color-dark-foreground, 20%);
transition: background-color .3s ease;
}
&:focus {
background: lighten($color-dark2-control, 2%);
border-color: lighten($color-dark2-control, 2%);
color: $color-dark2-focus-foreground;
}
}
input {
&.form-underlined {
& {
border: 0;
border-bottom: 1px solid $color-input;
border-radius: 0;
}
&:focus,
&.focus {
background: transparent;
border-bottom-color: $color-theme-blue;
box-shadow: none;
outline: none;
}
&:disabled {
background: none;
}
&[readonly] {
background: none;
}
&.ng-invalid {
&.ng-touched,
&.ng-dirty {
& {
background: transparent;
border-bottom-color: $color-theme-error;
border-color: transparent;
box-shadow: none;
outline: none;
}
&:hover,
&:focus {
border-bottom-color: $color-theme-error-dark;
border-color: transparent;
box-shadow: none;
}
}
}
}
}