Skip to content

Commit

Permalink
fix(docs): dark mode styles
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed May 27, 2023
1 parent 74afcc3 commit f10638c
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apps/www/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<body
data-sveltekit-preload-data="hover"
class="min-h-screen bg-background antialiased font-sans"
class="min-h-screen bg-background antialiased font-sans dark"
>
<div style="display: contents" class="flex min-h-screen flex-col">
%sveltekit.body%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script lang="ts">
import { Terminal } from "lucide-svelte";
import { AlertCircle } from "lucide-svelte";
import { Alert, AlertDescription, AlertTitle } from "$components/ui/alert";
</script>

<Alert variant="destructive">
<Terminal class="h-4 w-4" />
<AlertTitle>Heads up!</AlertTitle>
<AlertCircle class="h-4 w-4" />
<AlertTitle>Error</AlertTitle>
<AlertDescription>
You can add components to your app using the cli.
Your session has expired. Please login again.
</AlertDescription>
</Alert>
1 change: 1 addition & 0 deletions apps/www/src/lib/components/docs/mdsvex/mdsvex.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!-- MDsveX Layout Component -->
<script context="module">
import "../../../../styles/mdsvex.css";
import {
a,
blockquote,
Expand Down
6 changes: 5 additions & 1 deletion apps/www/src/lib/components/docs/nav/MobileLink.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { page } from "$app/stores";
import { cn } from "$lib/utils";
export let href: string;
Expand All @@ -11,7 +12,10 @@
<a
{href}
on:click={() => (open = false)}
class={cn(className)}
class={cn(
$page.url.pathname === href ? "text-foreground" : "text-foreground/60",
className
)}
{...$$restProps}
>
<slot />
Expand Down
6 changes: 5 additions & 1 deletion apps/www/src/lib/components/docs/nav/MobileNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
</Button>
</SheetTrigger>
<SheetContent size="xl" position="left" class="pr-0">
<MobileLink href="/" class="flex items-center" bind:open>
<MobileLink
href="/"
class="flex items-center !text-foreground"
bind:open
>
<Icons.logo class="mr-2 h-4 w-4" />
<span class="font-bold">{siteConfig.name}</span>
</MobileLink>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Beautifully designed components that you can copy and paste into
your apps. Accessible. Customizable. Open Source.
</PageHeaderDescription>
<p class="text-sm text-red-600">
<p class="text-sm text-red-600 dark:text-red-400">
This is an unofficial port of <a
href={siteConfig.links.shadGithub}
target="_blank"
Expand Down
1 change: 0 additions & 1 deletion apps/www/src/routes/docs/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script lang="ts">
import "../../styles/mdsvex.css";
import DocsSidebarNav from "$components/docs/nav/DocsSidebarNav.svelte";
import { docsConfig } from "$lib/config/docs";
</script>
Expand Down
20 changes: 20 additions & 0 deletions apps/www/src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,26 @@
@apply bg-background text-foreground;
font-feature-settings: "rlig" 1, "calt" 1;
}

* {
scrollbar-width: auto;
scrollbar-color: #7f8ea3;
}

/* Chrome, Edge, and Safari */
*::-webkit-scrollbar {
width: 10px;
height: 10px;
}

*::-webkit-scrollbar-track {
background: transparent;
}

*::-webkit-scrollbar-thumb {
background-color: #7f8ea3;
border: 3px none #ffffff;
}
}

@layer utilities {
Expand Down
1 change: 1 addition & 0 deletions apps/www/src/styles/mdsvex.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

.dark [data-theme="dark"] {
display: flex;
flex-direction: column;
}

[data-rehype-pretty-code-fragment] {
Expand Down

1 comment on commit f10638c

@vercel
Copy link

@vercel vercel bot commented on f10638c May 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.