diff --git a/src/components/AutoSuggestion/AutoSuggestion.scss b/src/components/AutoSuggestion/AutoSuggestion.scss index 7d4ea2ce..8bd5083b 100644 --- a/src/components/AutoSuggestion/AutoSuggestion.scss +++ b/src/components/AutoSuggestion/AutoSuggestion.scss @@ -27,37 +27,50 @@ } } +.#{$eccgui}-autosuggestion__inputfield { + background-color: $eccgui-color-textfield-background; +} + .#{$eccgui}-singlelinecodeeditor { - position: relative; - padding: 0 1px; + padding: 0; [class^="cm-theme"] { width: 100%; } + &:has(.cm-editor.cm-focused) { + box-shadow: input-transition-shadow($input-shadow-color-focus, true), $input-box-shadow-focus; + } + .cm-editor { - top: 2px; + top: 1px; height: calc(#{$eccgui-size-textfield-height-regular} - 2px); padding: 0; margin: 0; overflow: hidden; + background-color: transparent; + border-radius: 0; + box-shadow: none; &.cm-focused { outline: none; + box-shadow: none; } .cm-scroller { + height: 100%; padding: 0; margin: 0; overflow: auto hidden !important; } - .CodeMirror-vscrollbar { - display: none !important; - } - .cm-content { - vertical-align: middle; + display: flex; + flex-direction: column; + justify-content: center; + height: 100%; + min-height: 100%; + padding: 0; border: none; } diff --git a/src/components/index.scss b/src/components/index.scss index 191b8ebd..c9ea4fd1 100644 --- a/src/components/index.scss +++ b/src/components/index.scss @@ -38,6 +38,5 @@ @import "./Typography/typography"; @import "./Workspace/workspace"; @import "./Accordion/accordion"; -@import "./AutoSuggestion/AutoSuggestion"; @import "./Badge/badge"; @import "./PropertyValuePair/propertyvalue"; diff --git a/src/extensions/_index.scss b/src/extensions/_index.scss index 8f23e9af..41450c42 100644 --- a/src/extensions/_index.scss +++ b/src/extensions/_index.scss @@ -1,9 +1,4 @@ @import "./react-flow/react-flow"; - -/* -CodeMirror styles are already included by the base component styles -because it is used as lib for elements there already. @import "./codemirror/codemirror"; -*/ - +@import "./../components/AutoSuggestion/AutoSuggestion"; // the whole element should moved to extensions forlder @import "./uppy/fileupload"; diff --git a/src/extensions/codemirror/CodeMirror.tsx b/src/extensions/codemirror/CodeMirror.tsx index 29748ae0..7c01427a 100644 --- a/src/extensions/codemirror/CodeMirror.tsx +++ b/src/extensions/codemirror/CodeMirror.tsx @@ -92,7 +92,7 @@ export interface CodeEditorProps { /** Long lines are wrapped and displayed on multiple lines */ wrapLines?: boolean; - outerDivAttributes?: Partial>; + outerDivAttributes?: Omit, "id" | "data-test-id">; /** * Size in spaces that is used for a tabulator key. @@ -276,11 +276,15 @@ export const CodeEditor = ({ return (
); }; diff --git a/src/extensions/codemirror/_codemirror.scss b/src/extensions/codemirror/_codemirror.scss index 82197c48..0197c622 100644 --- a/src/extensions/codemirror/_codemirror.scss +++ b/src/extensions/codemirror/_codemirror.scss @@ -29,7 +29,6 @@ $eccgui-color-codeeditor-background: $eccgui-color-textfield-background !default // fix size to prevent wrong calculation of other elements padding: 0; margin: 1px; - cursor: text; } &.cm-focused { @@ -54,6 +53,7 @@ $eccgui-color-codeeditor-background: $eccgui-color-textfield-background !default } .cm-content { + cursor: text; border-right-width: $eccgui-size-inline-whitespace !important; } diff --git a/src/index.scss b/src/index.scss index 50b05555..c0ff9fd7 100644 --- a/src/index.scss +++ b/src/index.scss @@ -50,7 +50,6 @@ $prefix-carbon: $prefix; // == Load basic components styles ============================================= @import "./components"; -@import "./extensions/codemirror/codemirror"; // set more readable variable for prefix $prefix-eccgui: $eccgui;