Skip to content

feat: Proper dark mode #8274

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

Merged
merged 7 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
102 changes: 45 additions & 57 deletions sites/svelte.dev/package-lock.json

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

2 changes: 1 addition & 1 deletion sites/svelte.dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"@supabase/supabase-js": "^2.7.1",
"@sveltejs/repl": "0.0.3",
"@sveltejs/repl": "^0.1.2",
"cookie": "^0.5.0",
"devalue": "^4.2.3",
"do-not-zip": "^1.0.0",
Expand Down
1 change: 0 additions & 1 deletion sites/svelte.dev/src/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// REPL props

export const svelteUrl = `https://unpkg.com/svelte@3`;
export const rollupUrl = `https://unpkg.com/rollup@1/dist/rollup.browser.js`;
export const mapbox_setup = `window.MAPBOX_ACCESS_TOKEN = '${
import.meta.env.VITE_MAPBOX_ACCESS_TOKEN
}';`;
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

afterNavigate(() => {
repl.set({
components: data.gist.components
components: data.gist.components,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ export default app;`,
align-items: center;
justify-content: space-between;
padding: 0.6rem var(--side-nav);
background-color: var(--second);
color: white;
background-color: var(--sk-back-4);
color: var(--sk-text-1);
white-space: nowrap;
flex: 0;
}
Expand All @@ -256,9 +256,9 @@ export default app;`,
padding: 0.2em;
opacity: 0.7;
transition: opacity 0.3s;
font-family: var(--font);
font-family: var(--sk-font);
font-size: 1.6rem;
color: white;
color: var(--sk-text-1);
/* width: 1.6em;
height: 1.6em; */
line-height: 1;
Expand All @@ -280,7 +280,7 @@ export default app;`,
background: transparent;
border: none;
color: currentColor;
font-family: var(--font);
font-family: var(--sk-font);
font-size: 1.6rem;
opacity: 0.7;
outline: none;
Expand Down
22 changes: 11 additions & 11 deletions sites/svelte.dev/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
</main>

<style>
:global(:root) {
color-scheme: light dark;
}

@media (max-width: 830px) {
:global(aside) {
z-index: 9999 !important;
Expand Down Expand Up @@ -84,26 +88,22 @@
}
}

/** Ukraine banner */
:root {
--ukr-footer-height: 48px;
:global(html, body) {
height: 100%;
width: 100%;
}

main {
padding-bottom: var(--ukr-footer-height);
}

:global(.examples-container, .repl-outer, .tutorial-outer) {
/* :global(.examples-container, .repl-outer, .tutorial-outer) {
height: calc(100vh - var(--nav-h) - var(--ukr-footer-height)) !important;
}
} */

:global(.toggle) {
bottom: var(--ukr-footer-height) !important;
}

:global(.zen-mode) {
/* :global(.zen-mode) {
height: calc(100vh - var(--ukr-footer-height)) !important;
}
} */

@media (max-width: 830px) {
:global(aside) {
Expand Down
10 changes: 6 additions & 4 deletions sites/svelte.dev/src/routes/_components/Demo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
{
id: 'reactive-assignments',
title: 'Reactivity',
description: 'Trigger efficient, granular updates by assigning to local variables. The compiler does the rest.',
description:
'Trigger efficient, granular updates by assigning to local variables. The compiler does the rest.',
},
{
id: 'svg-transitions',
title: 'Transitions',
description: 'Build beautiful UIs with a powerful, performant transition engine built right into the framework.',
description:
'Build beautiful UIs with a powerful, performant transition engine built right into the framework.',
},
];

Expand Down Expand Up @@ -102,8 +104,8 @@
}

button.selected {
background-color: white;
color: var(--sk-back-1);
background-color: var(--sk-back-1);
color: var(--sk-text-2);
}

.small-show {
Expand Down
2 changes: 1 addition & 1 deletion sites/svelte.dev/src/routes/_components/Section.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<style>
section {
padding: 10rem 0;
background: var(--background, white);
background: var(--background, var(--sk-back-2));
}

.inner {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import donors from './donors.js';
</script>

<Section
--background="radial-gradient(circle at top right, rgb(230, 233, 236), rgb(244, 245, 247))"
>
<Section>
<p class="intro">
Svelte is free and open source software, made possible by the work of hundreds of supporters.
</p>
Expand Down Expand Up @@ -50,7 +48,7 @@

<style>
h3 {
color: var(--text);
color: var(--sk-text-2);
}

.intro {
Expand Down Expand Up @@ -112,7 +110,7 @@
}

.intro {
font-size: var(--h3);
font-size: var(--sk-text-m);
}

h3 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
align-items: center;
justify-content: center;
padding: 0;
color: var(--text);
color: var(--sk-text-2);
filter: grayscale(1) contrast(4) opacity(0.4) invert(var(--invert, 0));
grid-column: span 2;
}
Expand Down Expand Up @@ -73,4 +73,11 @@
--row-size: 5;
}
}

@media (prefers-color-scheme: dark) {
a {
--invert: 1;
filter: grayscale(1) contrast(4) opacity(0.7) invert(var(--invert, 0));
}
}
</style>
Loading