Skip to content

Commit

Permalink
more dark mode fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
basher committed Jun 28, 2024
1 parent 0f27801 commit 5f0f1d2
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions ui/public/storybook-overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

/* Override dark mode in Storybook docs. */
:root :has(#storybook-docs:not([hidden='true'])) {
--color-brand: 270 50% 80%;
--color-text: 0 0% 20%;
--color-neutral-900: 0 0% 95%;
color-scheme: light !important;
}
12 changes: 12 additions & 0 deletions ui/src/css/components/_banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ Dependencies.
}
}

&__media {
.image {
@if $allow-dark-mode {
/* stylelint-disable-next-line max-nesting-depth */
@media (prefers-color-scheme: dark) {
opacity: 1;
transition: none;
}
}
}
}

&__overlay {
@include bp-medium {
// Example, so text is legible above image.
Expand Down
14 changes: 14 additions & 0 deletions ui/src/css/web-components/_webui-modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ webui-modal {
margin: auto;
padding: 0 $gutter-m $gutter-m;

/* stylelint-disable-next-line order/order */
@if $allow-dark-mode {
@media (prefers-color-scheme: dark) {
background: $color-neutral-900;
}
}

&::backdrop {
background: var(--color-backdrop);
pointer-events: none; // So click outside works.
Expand All @@ -35,6 +42,13 @@ webui-modal {
display: flex;
justify-content: flex-end;
padding-block-start: $gutter-m;

/* stylelint-disable-next-line order/order */
@if $allow-dark-mode {
@media (prefers-color-scheme: dark) {
background: $color-neutral-900;
}
}
}

.modal__content {
Expand Down

0 comments on commit 5f0f1d2

Please sign in to comment.