Files
editor/src/styles/_input.scss
Harel M a22476cab2 Add lint to CI and fix errors (#853)
Adds lint to CI and fixes errors.
I'm not sure I'm fully proud of all the solutions there.
But there's no lint issues and the lint is being checked as part of the
CI.

---------

Co-authored-by: Yuri Astrakhan <yuriastrakhan@gmail.com>
2023-12-26 23:13:22 +02:00

254 lines
4.2 KiB
SCSS

@use 'sass:color';
//INPUT
.maputnik-input {
height: 24px;
width: 100%;
display: block;
box-sizing: border-box;
font-size: $font-size-6;
line-height: 2;
padding-left: $margin-2;
padding-right: $margin-2;
border: none;
background-color: $color-gray;
color: color.adjust($color-lowgray, $lightness: 12%);
&:invalid {
border: solid 1px #B71C1C;
border-radius: 2px;
}
}
.maputnik-string {
@extend .maputnik-input; /* stylelint-disable-line */
&--multi {
resize: vertical;
height: 78px;
}
&--disabled {
background: transparent;
border: none;
}
}
.maputnik-number-container {
display: flex;
}
.maputnik-number-range {
width: calc(100% - 4.5em);
margin-right: 0.5em;
flex-shrink: 0;
}
.maputnik-number {
@extend .maputnik-input; /* stylelint-disable-line */
}
//COLOR PICKER
.maputnik-color {
@extend .maputnik-input; /* stylelint-disable-line */
height: 26px;
}
.maputnik-color-wrapper {
position: relative;
@include flex-row;
}
.maputnik-color-swatch {
height: 26px;
width: 14px;
flex-shrink: 0;
flex-grow: 0;
}
// ARRAY
.maputnik-array {
> * {
margin-bottom: $margin-3;
}
.maputnik-array-block {
.maputnik-array-block-action {
vertical-align: top;
display: inline-block;
width: 2em;
}
.maputnik-array-block-content {
vertical-align: top;
display: inline-block;
width: calc(100% - 2em);
}
}
.maputnik-array-add-value {
display: inline-block;
float: right;
}
}
// SELECT
.maputnik-select {
@extend .maputnik-input; /* stylelint-disable-line */
-moz-appearance: none;
-webkit-appearance: none;
background: $color-gray url("#{$icon-down-arrow}") right center no-repeat;
color: $color-white;
background-position: calc(100% - 2px) center;
padding-right: 20px;
height: 24px;
}
// MULTIBUTTON
.maputnik-multibutton {
padding: 0;
.maputnik-button {
margin-right: $margin-1;
}
}
.maputnik-button-selected {
background-color: color.adjust($color-midgray, $lightness: 12%);
color: white;
}
// CHECKBOX
.maputnik-checkbox {
position: absolute;
z-index: 1;
width: 100%;
height: 100%;
margin: 0;
left: 0;
top: 0;
outline: none;
&-wrapper {
@extend .maputnik-input; /* stylelint-disable-line */
padding-left: 0;
padding-right: 0;
position: relative;
text-align: center;
vertical-align: middle;
cursor: pointer;
max-width: 24px;
}
&-box {
z-index: 2;
display: inline-block;
text-align: center;
height: 24px;
width: 24px;
margin-right: $margin-2;
background-color: $color-gray;
border-radius: 2px;
border-style: solid;
border-width: 2px;
border-color: $color-gray;
transition: background-color 0.1s ease-out;
position: absolute;
top: 0;
left: 0;
// So they fall through to the <input/> beneath
pointer-events: none;
@media screen and (prefers-reduced-motion: reduce) {
transition-duration: 0ms;
}
}
&:focus {
z-index: 8;
}
&:focus + &-box {
z-index: 9;
}
&-icon {
width: 50%;
height: 50%;
margin-top: 1px;
fill: $color-lowgray;
}
}
// AUTOCOMPLETE
.maputnik-autocomplete {
&-menu {
border: none;
padding: 2px 0;
margin-right: 10px;
position: absolute;
overflow: auto;
max-height: 50%;
background: $color-gray;
z-index: 3;
}
&-menu-item {
user-select: none;
color: $color-lowgray;
cursor: default;
padding: $margin-1;
font-size: $font-size-6;
z-index: 3;
background: $color-gray;
}
&-menu-item-selected {
background: $color-midgray;
}
}
// FONT
.maputnik-font {
.maputnik-autocomplete:not(:last-child) {
margin-bottom: $margin-3;
}
}
.maputnik-input-block-content {
position: relative;
}
.SpecDoc__sdk-support {
position: relative;
max-width: 100%;
overflow-x: auto;
}
.SpecDoc__sdk-support__table {
width: 100%;
margin-top: $margin-3;
td, th {
border: solid 1px $color-midgray;
padding: 4px 6px;
white-space: nowrap;
}
}
.SpecDoc__values li {
margin-top: $margin-3;
}
.SpecDoc__values code {
background: $color-midgray;
padding: 0.1em 0.3em;
border-radius: 2px;
}