Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat scss variables #350

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
898c529
feat: use SCSS variables internally
SamMousa Nov 24, 2023
1379aa4
fix: revert search & replace changes that should not be in css files
SamMousa Nov 24, 2023
e4b1030
fix: fix cases of css in js
SamMousa Nov 24, 2023
7ddd246
fix: svelte-select styling
SamMousa Nov 24, 2023
99b92a3
fix: css files must not contain scss variables
SamMousa Nov 27, 2023
b4b5b8a
Merge branch 'feat-scss-variables' of https:/SamMousa/sve…
josdejong Nov 29, 2023
a4da5f9
fix: key color in text mode
SamMousa Nov 29, 2023
44d63fe
fix: svelte-select dark theme background & border
SamMousa Nov 29, 2023
3ffb2f1
fix: big theme
SamMousa Nov 29, 2023
7a4d104
fix: big left margin of insertion marker
SamMousa Nov 29, 2023
b8e0112
fix: modal theming
SamMousa Nov 29, 2023
86217a3
Merge branch 'feat-scss-variables' of https:/SamMousa/sve…
josdejong Nov 30, 2023
bea88ba
chore: apply formatting
josdejong Dec 4, 2023
6eca574
fix: rename `--jse-modal-theme-color` to `--jse-modal-editor-theme-co…
josdejong Dec 4, 2023
f90e370
fix: editor not having a border (modal editor border not yet solved)
josdejong Dec 4, 2023
a44ca48
fix: font color of warnings in dark mode
josdejong Dec 4, 2023
98dfce8
fix: editors in transform modal not having a border
josdejong Dec 4, 2023
c491d97
fix: selection bar not having the right color when the editor does no…
josdejong Dec 4, 2023
3e20fe9
fix: update unit test snapshot
josdejong Dec 4, 2023
f31a075
fix: some minor styling fixes, clean up fixed todo's
josdejong Dec 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/lib/components/JSONEditor.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
@import '../themes/jse-theme-default'; // do not put the .css extension here, else the file will not be bundled
@import '../styles';

.jse-main {
width: 100%;
height: 100%;
min-width: 0;
min-height: $contents-min-height;
font-family: var(--jse-font-family);
font-size: var(--jse-font-size);
font-family: $font-family;
font-size: $font-size;
line-height: normal;
position: relative;
display: flex;
Expand Down
20 changes: 8 additions & 12 deletions src/lib/components/__snapshots__/JSONEditor.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1482,11 +1482,11 @@ exports[`JSONEditor > render tree mode 1`] = `
class="jse-json-node jse-expanded s-BfIc3EpAoT-Y jse-root"
data-path=""
role="treeitem"
style="--level: 0;"
tabindex="-1"
>
<div
class="jse-header-outer s-BfIc3EpAoT-Y"
style="margin-left: calc(0 * var(--jse-indent-size))"
>
<div
class="jse-header s-BfIc3EpAoT-Y"
Expand Down Expand Up @@ -1567,11 +1567,11 @@ exports[`JSONEditor > render tree mode 1`] = `
class="jse-json-node jse-expanded s-BfIc3EpAoT-Y"
data-path="%2F0"
role="treeitem"
style="--level: 1;"
tabindex="-1"
>
<div
class="jse-header-outer s-BfIc3EpAoT-Y"
style="margin-left: calc(1 * var(--jse-indent-size))"
>
<div
class="jse-header s-BfIc3EpAoT-Y"
Expand Down Expand Up @@ -1655,11 +1655,11 @@ exports[`JSONEditor > render tree mode 1`] = `
class="jse-json-node s-BfIc3EpAoT-Y"
data-path="%2F0%2Fid"
role="treeitem"
style="--level: 2;"
tabindex="-1"
>
<div
class="jse-contents-outer s-BfIc3EpAoT-Y"
style="margin-left: calc(2 * var(--jse-indent-size))"
>
<div
class="jse-contents s-BfIc3EpAoT-Y"
Expand Down Expand Up @@ -1717,7 +1717,6 @@ exports[`JSONEditor > render tree mode 1`] = `

<div
class="jse-footer-outer s-BfIc3EpAoT-Y"
style="margin-left: calc(1 * var(--jse-indent-size))"
>
<div
class="jse-footer s-BfIc3EpAoT-Y"
Expand Down Expand Up @@ -1746,11 +1745,11 @@ exports[`JSONEditor > render tree mode 1`] = `
class="jse-json-node jse-expanded s-BfIc3EpAoT-Y"
data-path="%2F1"
role="treeitem"
style="--level: 1;"
tabindex="-1"
>
<div
class="jse-header-outer s-BfIc3EpAoT-Y"
style="margin-left: calc(1 * var(--jse-indent-size))"
>
<div
class="jse-header s-BfIc3EpAoT-Y"
Expand Down Expand Up @@ -1834,11 +1833,11 @@ exports[`JSONEditor > render tree mode 1`] = `
class="jse-json-node s-BfIc3EpAoT-Y"
data-path="%2F1%2Fid"
role="treeitem"
style="--level: 2;"
tabindex="-1"
>
<div
class="jse-contents-outer s-BfIc3EpAoT-Y"
style="margin-left: calc(2 * var(--jse-indent-size))"
>
<div
class="jse-contents s-BfIc3EpAoT-Y"
Expand Down Expand Up @@ -1897,11 +1896,11 @@ exports[`JSONEditor > render tree mode 1`] = `
class="jse-json-node s-BfIc3EpAoT-Y"
data-path="%2F1%2Fname"
role="treeitem"
style="--level: 2;"
tabindex="-1"
>
<div
class="jse-contents-outer s-BfIc3EpAoT-Y"
style="margin-left: calc(2 * var(--jse-indent-size))"
>
<div
class="jse-contents s-BfIc3EpAoT-Y"
Expand Down Expand Up @@ -1959,7 +1958,6 @@ exports[`JSONEditor > render tree mode 1`] = `

<div
class="jse-footer-outer s-BfIc3EpAoT-Y"
style="margin-left: calc(1 * var(--jse-indent-size))"
>
<div
class="jse-footer s-BfIc3EpAoT-Y"
Expand Down Expand Up @@ -1988,11 +1986,11 @@ exports[`JSONEditor > render tree mode 1`] = `
class="jse-json-node jse-expanded s-BfIc3EpAoT-Y"
data-path="%2F2"
role="treeitem"
style="--level: 1;"
tabindex="-1"
>
<div
class="jse-header-outer s-BfIc3EpAoT-Y"
style="margin-left: calc(1 * var(--jse-indent-size))"
>
<div
class="jse-header s-BfIc3EpAoT-Y"
Expand Down Expand Up @@ -2076,11 +2074,11 @@ exports[`JSONEditor > render tree mode 1`] = `
class="jse-json-node s-BfIc3EpAoT-Y"
data-path="%2F2%2Fid"
role="treeitem"
style="--level: 2;"
tabindex="-1"
>
<div
class="jse-contents-outer s-BfIc3EpAoT-Y"
style="margin-left: calc(2 * var(--jse-indent-size))"
>
<div
class="jse-contents s-BfIc3EpAoT-Y"
Expand Down Expand Up @@ -2138,7 +2136,6 @@ exports[`JSONEditor > render tree mode 1`] = `

<div
class="jse-footer-outer s-BfIc3EpAoT-Y"
style="margin-left: calc(1 * var(--jse-indent-size))"
>
<div
class="jse-footer s-BfIc3EpAoT-Y"
Expand Down Expand Up @@ -2167,7 +2164,6 @@ exports[`JSONEditor > render tree mode 1`] = `

<div
class="jse-footer-outer s-BfIc3EpAoT-Y"
style="margin-left: calc(0 * var(--jse-indent-size))"
>
<div
class="jse-footer s-BfIc3EpAoT-Y"
Expand Down
14 changes: 7 additions & 7 deletions src/lib/components/controls/ColorPickerPopup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
:global(.picker_wrapper.popup),
:global(.picker_wrapper.popup .picker_arrow::before),
:global(.picker_wrapper.popup .picker_arrow::after) {
background: var(--jse-color-picker-background);
background: $color-picker-background;
line-height: normal;
}

Expand All @@ -13,20 +13,20 @@
:global(.picker_editor input),
:global(.picker_sample),
:global(.picker_done button) {
box-shadow: var(--jse-color-picker-border-box-shadow);
box-shadow: $color-picker-border-box-shadow;
}

:global(.picker_editor input) {
background: var(--jse-background-color);
color: var(--jse-text-color);
background: $background-color;
color: $text-color;
}

:global(.picker_done button) {
background: var(--jse-button-background);
color: var(--jse-button-color);
background: $button-background;
color: $button-color;
}

:global(.picker_done button:hover) {
background: var(--jse-button-background-highlight);
background: $button-background-highlight;
}
}
18 changes: 9 additions & 9 deletions src/lib/components/controls/DropdownButton.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
flex: 1;
line-height: normal;

$background: var(--jse-context-menu-background);
$background-highlight: var(--jse-context-menu-background-highlight);
$background: $context-menu-background;
$background-highlight: $context-menu-background-highlight;

@include jsoneditor-button;
position: relative;
Expand All @@ -27,23 +27,23 @@
@include jsoneditor-button;

width: 2em;
background: var(--jse-context-menu-background);
color: var(--jse-context-menu-color);
background: $context-menu-background;
color: $context-menu-color;

&.jse-visible {
background: $background;
}

&:hover {
background: var(--jse-context-menu-background-highlight);
background: $context-menu-background-highlight;
}

&:focus {
z-index: 1;
}

&:disabled {
color: var(--jse-context-menu-color-disabled);
color: $context-menu-color-disabled;
background: unset;
}

Expand All @@ -57,8 +57,8 @@
left: 0;
z-index: 1;
background: $background;
color: var(--jse-context-menu-color);
box-shadow: var(--jse-controls-box-shadow);
color: $context-menu-color;
box-shadow: $controls-box-shadow;

&.jse-visible {
display: block;
Expand All @@ -77,7 +77,7 @@
}

&:disabled {
color: var(--jse-context-menu-color-disabled);
color: $context-menu-color-disabled;
background: unset;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/components/controls/EditableDiv.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ div.jse-editable-div {
}

&[contenteditable='true'] {
outline: var(--jse-edit-outline);
outline: $edit-outline;
background: inherit !important;
position: relative;
border-radius: 0;
Expand All @@ -29,13 +29,13 @@ div.jse-editable-div {

&.jse-empty {
&:not(:focus) {
outline: 1px dotted var(--jse-tag-background);
outline: 1px dotted $tag-background;
-moz-outline-radius: 2px;
}

&::after {
pointer-events: none;
color: var(--jse-tag-background);
color: $tag-background;
}
}
}
14 changes: 7 additions & 7 deletions src/lib/components/controls/EditableDivShared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@

.jse-value {
&.jse-string {
color: var(--jse-value-color-string);
color: $value-color-string;
}

&.jse-object,
&.jse-array {
min-width: 16px;
color: var(--jse-delimiter-color);
color: $delimiter-color;
}

&.jse-number {
color: var(--jse-value-color-number);
color: $value-color-number;
}

&.jse-boolean {
color: var(--jse-value-color-boolean);
color: $value-color-boolean;
}

&.jse-null {
color: var(--jse-value-color-null);
color: $value-color-null;
}

&.jse-invalid {
color: var(--jse-text-color);
color: $text-color;
}

&.jse-url {
color: var(--jse-value-color-url);
color: $value-color-url;
text-decoration: underline;
}
}
12 changes: 6 additions & 6 deletions src/lib/components/controls/JSONPreview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

.jse-json-preview {
flex: 1;
font-family: var(--jse-font-family-mono);
font-size: var(--jse-font-size-mono);
color: var(--jse-panel-color-readonly);
font-family: $font-family-mono;
font-size: $font-size-mono;
color: $panel-color-readonly;
overflow: auto;
white-space: pre-wrap;
padding: 2px;

// TODO: JSONPreview shouldn't add borders I think
border-left: var(--jse-main-border);
border-right: var(--jse-main-border);
border-bottom: var(--jse-main-border);
border-left: $main-border;
border-right: $main-border;
border-bottom: $main-border;
}
Loading