123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- @use 'sass:map';
- @use 'sass:math';
- // Layouts for particular kinds of of fields
- // This is expected to go on the parent of the input/select/textarea
- // so in most cases .input
- .iconfield, // generic
- .date_field,
- .time_field,
- .date_time_field,
- .url_field {
- .input {
- position: relative;
- &:before,
- &:after {
- font-family: $font-wagtail-icons;
- display: flex;
- flex-flow: row nowrap;
- align-items: center;
- position: absolute;
- top: 0;
- height: 100%;
- line-height: 100%;
- font-size: 2em;
- color: theme('colors.grey.200');
- }
- &:before {
- inset-inline-start: 0.3em;
- }
- &:after {
- inset-inline-end: 0.5em;
- }
- }
- input {
- padding-inline-start: 2.5em;
- }
- // smaller fields required slight repositioning of icons
- &.field-small {
- .input {
- &:before,
- &:after {
- font-size: 1.3rem; // REMs are necessary here because IE doesn't treat generated content correctly
- }
- &:before {
- inset-inline-start: 0.5em;
- }
- &:after {
- inset-inline-end: 0.5em;
- }
- }
- }
- // special case for search spinners
- &.icon-spinner:after {
- color: $color-teal;
- opacity: 0.8;
- text-align: center;
- top: 0.3em;
- }
- }
- .date_field,
- .date_time_field {
- .input:before {
- content: map.get($icons, 'date'); // UI-Redesign: To be removed
- }
- }
- .time_field {
- .input:before {
- content: map.get($icons, 'time'); // UI-Redesign: To be removed
- }
- }
- .url_field {
- .input:before {
- content: map.get($icons, 'link'); // UI-Redesign: To be removed
- }
- }
- .fields > li,
- .field-col {
- @include clearfix();
- padding-top: 0.5em;
- padding-bottom: 1.2em;
- list-style: none;
- }
- .field-row {
- @include clearfix();
- // negative margin the bottom so it doesn't add too much space
- margin-bottom: -1.2em;
- }
- .input {
- clear: both;
- }
- // field sizing and alignment
- .field-small {
- input,
- textarea,
- select,
- .tagit {
- border-radius: 3px;
- padding: 0.4em 1em;
- }
- }
- .field {
- &.col1,
- &.col2,
- &.col3,
- &.col4,
- &.col5,
- &.col6,
- &.col7,
- &.col8,
- &.col9,
- &.col10,
- &.col11,
- &.col12 {
- clear: both;
- }
- }
- li.inline .field {
- &.col1,
- &.col2,
- &.col3,
- &.col4,
- &.col5,
- &.col6,
- &.col7,
- &.col8,
- &.col9,
- &.col10,
- &.col11,
- &.col12 {
- clear: none;
- }
- }
- // solve gutter issues of inline fields
- ul.inline li:first-child,
- li.inline:first-child {
- margin-inline-start: math.div(-$grid-gutter-width, 2);
- }
- @include media-breakpoint-up(sm) {
- .fields {
- max-width: 800px;
- }
- .field {
- @include row();
- }
- .field-content {
- @include column(10, 0);
- }
- .field-col {
- float: left;
- padding-inline-start: 0;
- // anything less than 4 columns or greater than 6 is impractical
- &.col4 {
- label {
- @include column(2, 0, 4);
- }
- .field-content {
- @include column(2, $padding, 4);
- padding-inline-start: 0;
- }
- }
- &.col6 {
- label {
- @include column(2, 0, 6);
- }
- .field-content {
- @include column(4, $padding, 6);
- padding-inline-start: 0;
- }
- }
- }
- .label-above {
- .field > label,
- .field > .field-content {
- display: block;
- padding: 0 0 0.8em;
- float: none;
- width: auto;
- }
- }
- }
|