Skip to content

Commit

Permalink
More dark mode fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed Dec 2, 2024
1 parent 79baa7b commit 92522e9
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 23 deletions.
5 changes: 3 additions & 2 deletions panel/src/components/Dialogs/ErrorDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ export default {

<style>
.k-error-details {
background: var(--color-white);
background: var(--input-color-back);
display: block;
overflow: auto;
padding: 1rem;
border-radius: var(--rounded);
font-size: var(--text-sm);
line-height: 1.25em;
margin-top: 0.75rem;
Expand All @@ -79,7 +80,7 @@ export default {
white-space: pre-line;
}
.k-error-details li:not(:last-child) {
border-bottom: 1px solid var(--color-light);
border-bottom: 1px solid var(--color-border);
padding-bottom: 0.25rem;
margin-bottom: 0.25rem;
}
Expand Down
5 changes: 2 additions & 3 deletions panel/src/components/Dialogs/PageMoveDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ export default {
margin-bottom: var(--spacing-2);
}
.k-page-move-parent {
--tree-color-back: var(--color-white);
--tree-color-hover-back: var(--color-light);
--tree-color-back: var(--input-color-back);
padding: var(--spacing-3);
background: var(--color-white);
background: var(--tree-color-back);
border-radius: var(--rounded);
box-shadow: var(--shadow);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
variant="filled"
@click="$refs.dropdown.toggle()"
>
<k-color-frame :color="value" ratio="1/1" />
<k-color-frame :color="valueAdapted" ratio="1/1" />
</k-button>
<k-dropdown-content
ref="dropdown"
align-x="end"
:options="[
{
text: $t('field.blocks.figure.back.plain'),
click: 'transparent'
click: 'var(--block-color-back)'
},
{
text: $t('field.blocks.figure.back.pattern.light'),
Expand All @@ -34,6 +34,15 @@
export default {
props: {
value: String
},
computed: {
valueAdapted() {
if (this.value === "transparent") {
return "var(--block-color-back)";
}
return this.value;
}
}
};
</script>
Expand All @@ -44,10 +53,10 @@ export default {
--color-frame-size: 1.5rem;
--button-height: 1.5rem;
--button-padding: 0 0.125rem;
--button-color-back: var(--color-white);
--button-color-back: var(--block-color-back);
gap: 0.25rem;
box-shadow: var(--shadow-toolbar);
border: 1px solid var(--color-white);
border: 1px solid var(--button-color-back);
}
.k-block-background-dropdown .k-color-frame {
border-right: 1px solid var(--color-gray-300);
Expand Down
2 changes: 1 addition & 1 deletion panel/src/components/Forms/Blocks/Types/Gallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default {
extends: Block,
data() {
return {
back: this.onBack() ?? "var(--color-white)"
back: this.onBack() ?? "var(--block-color-back)"
};
},
computed: {
Expand Down
7 changes: 5 additions & 2 deletions panel/src/components/Forms/Input/RangeInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default {
position() {
return this.value || this.value === 0
? this.value
: this.default ?? this.baseline;
: (this.default ?? this.baseline);
}
},
watch: {
Expand Down Expand Up @@ -195,7 +195,10 @@ export default {
}
.k-range-input[data-disabled="true"] {
--range-tooltip-back: var(--color-gray-600);
--range-tooltip-back: light-dark(
var(--color-gray-600),
var(--color-gray-850)
);
}
/* Input context */
Expand Down
2 changes: 1 addition & 1 deletion panel/src/components/Forms/Input/TogglesInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export default {
margin-inline-start: var(--spacing-2);
}
.k-toggles-input input:focus:not(:checked) + label {
background: var(--color-blue-200);
background: light-dark(var(--color-blue-200), var(--color-blue-800));
}
.k-toggles-input input:checked + label {
Expand Down
11 changes: 7 additions & 4 deletions panel/src/components/Forms/Layouts/LayoutSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ export default {
}
}
.k-layout-selector-option {
--color-border: hsla(var(--color-gray-hs), 0%, 6%);
--color-back: var(--color-white);
--color-border: light-dark(
hsla(var(--color-gray-hs), 0%, 6%),
hsla(var(--color-gray-hs), 60%, 10%)
);
--color-back: light-dark(var(--color-white), var(--color-gray-950));
border-radius: var(--rounded);
}
.k-layout-selector-option:focus-visible {
Expand All @@ -111,8 +114,8 @@ export default {
height: 100%;
}
.k-layout-selector-option:hover {
--color-border: var(--color-gray-500);
--color-back: var(--color-gray-100);
--color-border: light-dark(var(--color-gray-500), var(--color-gray-800));
--color-back: light-dark(var(--color-gray-100), var(--color-gray-900));
}
.k-layout-selector-option[aria-current="true"] {
--color-border: var(--color-focus);
Expand Down
9 changes: 6 additions & 3 deletions panel/src/components/Layout/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,11 @@ export default {
--table-cell-padding: var(--spacing-3);
--table-color-back: light-dark(var(--color-white), var(--color-gray-850));
--table-color-border: var(--panel-color-back);
--table-color-hover: light-dark(var(--color-gray-100), rgba(0,0,0, .1));
--table-color-th-back: light-dark(var(--color-gray-100), var(--color-gray-800));
--table-color-hover: light-dark(var(--color-gray-100), rgba(0, 0, 0, 0.1));
--table-color-th-back: light-dark(
var(--color-gray-100),
var(--color-gray-800)
);
--table-color-th-text: var(--color-text-dimmed);
--table-row-height: var(--input-height);
}
Expand Down Expand Up @@ -475,7 +478,7 @@ export default {
/* Sortable tables */
.k-table-row-ghost {
background: var(--color-white);
background: var(--table-color-back);
outline: var(--outline);
border-radius: var(--rounded);
margin-bottom: 2px;
Expand Down
5 changes: 3 additions & 2 deletions panel/src/components/Views/Installation/InstallationView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,9 @@ export default {

<style>
.k-installation-dialog {
--dialog-color-back: var(--color-white);
--dialog-shadow: var(--shadow);
--dialog-color-back: light-dark(var(--color-white), var(--color-gray-950));
--dialog-shadow: light-dark(var(--shadow), none);
container-type: inline-size;
}
.k-installation-view .k-button {
Expand Down
2 changes: 1 addition & 1 deletion panel/src/components/Views/PreviewView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export default {
flex-grow: 1;
border-radius: var(--rounded-lg);
box-shadow: var(--shadow-xl);
background: var(--color-white);
background: light-dark(var(--color-white), var(--color-gray-950));
}
.k-preview-view-panel .k-empty {
flex-grow: 1;
Expand Down

0 comments on commit 92522e9

Please sign in to comment.