Files
editor/src/styles/_input.scss
T
Harel M 0fbba4b362 Fix missing font auto complete menu (#1491)
## Launch Checklist

This fixes the position of the autocomplete list - CSS fix mostly.
It also changes the loading of the metadata to be using promises instead
of callbacks.

I couldn't reproduce the following issue, so I'll be closing it for now.
- Fixes #945

Before:
<img width="563" height="577" alt="image"
src="https://github.com/user-attachments/assets/6ea264e1-cb85-4a8a-8df5-ab50e7815333"
/>

After:
<img width="563" height="577" alt="image"
src="https://github.com/user-attachments/assets/27fa2901-dd96-44fd-9774-363fd4c5ed98"
/>


 - [x] Briefly describe the changes in this PR.
 - [x] Link to related issues.
- [x] Include before/after visuals or gifs if this PR includes visual
changes.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-11-06 16:31:14 +02:00

260 lines
4.5 KiB
SCSS

@use "mixins";
@use "vars";
@use 'sass:color';
//INPUT
.maputnik-input {
height: 24px;
width: 100%;
display: block;
box-sizing: border-box;
font-size: vars.$font-size-6;
line-height: 2;
padding-left: vars.$margin-2;
padding-right: vars.$margin-2;
border: none;
background-color: vars.$color-gray;
color: color.adjust(vars.$color-lowgray, $lightness: 12%);
&:invalid {
border: solid 1px #B71C1C;
border-radius: 2px;
}
}
.maputnik-string {
@extend .maputnik-input !optional; /* 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 !optional; /* stylelint-disable-line */
}
//COLOR PICKER
.maputnik-color {
@extend .maputnik-input !optional; /* stylelint-disable-line */
height: 26px;
}
.maputnik-color-wrapper {
position: relative;
@include mixins.flex-row;
}
.maputnik-color-swatch {
height: 26px;
width: 14px;
flex-shrink: 0;
flex-grow: 0;
}
// ARRAY
.maputnik-array {
> * {
margin-bottom: vars.$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 !optional; /* stylelint-disable-line */
-moz-appearance: none;
-webkit-appearance: none;
background: vars.$color-gray url("#{vars.$icon-down-arrow}") right center no-repeat;
color: vars.$color-white;
background-position: calc(100% - 2px) center;
padding-right: 20px;
height: 24px;
}
[dir="rtl"] .maputnik-select {
background: vars.$color-gray url("#{vars.$icon-down-arrow}") left center no-repeat;
}
// MULTIBUTTON
.maputnik-multibutton {
padding: 0;
.maputnik-button {
margin-right: vars.$margin-1;
}
}
.maputnik-button-selected {
background-color: color.adjust(vars.$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 !optional; /* 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: vars.$margin-2;
background-color: vars.$color-gray;
border-radius: 2px;
border-style: solid;
border-width: 2px;
border-color: vars.$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: vars.$color-lowgray;
}
}
// AUTOCOMPLETE
.maputnik-autocomplete {
&-menu {
border: none;
padding: 2px 0;
margin-right: 10px;
position: absolute !important;
overflow: auto;
max-height: 50%;
background: vars.$color-gray;
z-index: 3;
}
&-menu-item {
user-select: none;
color: vars.$color-lowgray;
cursor: default;
padding: vars.$margin-1;
font-size: vars.$font-size-6;
z-index: 3;
background: vars.$color-gray;
}
&-menu-item-selected {
background: vars.$color-midgray;
}
}
// FONT
.maputnik-font {
.maputnik-autocomplete:not(:last-child) {
margin-bottom: vars.$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: vars.$margin-3;
td, th {
border: solid 1px vars.$color-midgray;
padding: 4px 6px;
white-space: nowrap;
}
}
.SpecDoc__values li {
margin-top: vars.$margin-3;
}
.SpecDoc__values code, .SpecDoc__doc code {
background: vars.$color-midgray;
padding: 0.1em 0.3em;
border-radius: 2px;
}