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

Added dark mode #845

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/preview-astro/src/components/search/loading.tsx
Expand Up @@ -4,9 +4,9 @@ import Skeleton from "tiny-skeleton-loader-react";
export default function SearchPageIconLoading() {
return (
<div className="item">
<Skeleton height="60px" />
<Skeleton height="60px" background="var(--color-gray-4)" />
<div className="name">
<Skeleton height="15px" />
<Skeleton height="15px" background="var(--color-gray-4)"/>
</div>
</div>
);
Expand Down
7 changes: 5 additions & 2 deletions packages/preview-astro/src/styles/_components.scss
Expand Up @@ -260,15 +260,16 @@ a {
0 1px 2px 0 rgba(0, 0, 0, 0.06);
transition: background-color 150ms ease;
&:hover {
background: #f3f3f3;
background: var(--color-gray-2);
}

.name {
font-size: 1.2rem;
}
.describe {
font-size: 0.8rem;
color: var(--color-gray-4);
color: var(--color-black);
opacity: 0.5;
}
.samples {
overflow: hidden;
Expand Down Expand Up @@ -333,6 +334,7 @@ html:has(.modal-root.active) {
border: none;
background: initial;
padding: 0 10px;
color: var(--color-black);
}
}
}
Expand All @@ -358,6 +360,7 @@ html:has(.modal-root.active) {
button {
border: none;
background: var(--color-gray-2);
color: var(--color-black);
padding: 5px 7px;
border-radius: 5px;
cursor: pointer;
Expand Down
12 changes: 12 additions & 0 deletions packages/preview-astro/src/styles/_core.scss
Expand Up @@ -17,6 +17,18 @@
--border-radius-md: 6px;
}

@media (prefers-color-scheme: dark) {
:root {
--color-black: #ffffff;
--color-white: #3f3f46;
--color-gray-0: #09090b;
--color-gray-1: #18181b;
--color-gray-2: #27272a;
--color-gray-3: #3f3f46;
--color-gray-4: #52525b;
}
}

html,
body {
margin: 0;
Expand Down