www: use green as accent color on docs page (#163)

This commit is contained in:
Luca Casonato
2022-04-24 22:33:26 +02:00
committed by GitHub
parent 53c1e0d112
commit b563646c8f
5 changed files with 39 additions and 27 deletions
+11 -1
View File
@@ -1,7 +1,17 @@
export * from "../runtime.ts"; export * from "../runtime.ts";
import { IS_BROWSER } from "../runtime.ts"; import { IS_BROWSER } from "../runtime.ts";
import { apply, setup, tw } from "https://esm.sh/twind@0.16.16"; import { apply, setup, tw } from "https://esm.sh/twind@0.16.16";
import * as colors from "https://esm.sh/twind@0.16.16/colors";
export { apply, setup, tw }; export { apply, setup, tw };
export const theme = {
colors: {
black: colors.black,
gray: colors.gray,
green: colors.green,
white: colors.white,
yellow: colors.yellow,
},
};
if (IS_BROWSER) { if (IS_BROWSER) {
setup({}); setup({ theme: { colors } });
} }
+1 -1
View File
@@ -18,7 +18,7 @@ export default function DocsSidebar(props: { path: string }) {
} }
const link = apply`text(gray-900 hover:gray-600)`; const link = apply`text(gray-900 hover:gray-600)`;
const linkActive = apply`text(blue-600 hover:blue-500)`; const linkActive = apply`text(green-600 hover:green-500)`;
export function SidebarCategory(props: { export function SidebarCategory(props: {
path: string; path: string;
+1 -1
View File
@@ -15,7 +15,7 @@ export default function NavigationBar(props: { active: string }) {
]; ];
return ( return (
<nav class={tw`bg(gray-50) py-2 border(t-2 b-2 gray-100)`}> <nav class={tw`bg-green-100 py-2`}>
<ul class={tw`flex justify-center gap-8 mx-4`}> <ul class={tw`flex justify-center gap-8 mx-4`}>
{items.map((item) => ( {items.map((item) => (
<li> <li>
+2 -2
View File
@@ -1,11 +1,11 @@
// This module adds twind support. // This module adds twind support.
import { setup } from "../client_deps.ts"; import { setup, theme } from "../client_deps.ts";
import { RenderContext, RenderFn, virtualSheet } from "../server_deps.ts"; import { RenderContext, RenderFn, virtualSheet } from "../server_deps.ts";
const sheet = virtualSheet(); const sheet = virtualSheet();
sheet.reset(); sheet.reset();
setup({ sheet }); setup({ sheet, theme });
export function render(ctx: RenderContext, render: RenderFn) { export function render(ctx: RenderContext, render: RenderFn) {
const snapshot = ctx.state.get("twindSnapshot") as unknown[] | null; const snapshot = ctx.state.get("twindSnapshot") as unknown[] | null;
+24 -22
View File
@@ -85,30 +85,32 @@ function Header() {
const sidebarButton = tw const sidebarButton = tw
`px-4 py-4 md:hidden border(l-2 gray-100) flex items-center hover:bg-gray-50`; `px-4 py-4 md:hidden border(l-2 gray-100) flex items-center hover:bg-gray-50`;
return ( return (
<header class={header}> <div class={tw`bg-green-200`}>
<div class={tw`p-4 flex`}> <header class={header}>
<Logo /> <div class={tw`p-4 flex`}>
<div> <Logo />
<Title /> <div>
<Title />
</div>
</div> </div>
</div> <label for="docs_sidebar" class={sidebarButton}>
<label for="docs_sidebar" class={sidebarButton}> <svg
<svg class={tw`h-6 w-6`}
class={tw`h-6 w-6`} stroke="currentColor"
stroke="currentColor" fill="none"
fill="none" viewBox="0 0 24 24"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M4 6h16M4 12h16M4 18h7"
> >
</path> <path
</svg> strokeLinecap="round"
</label> strokeLinejoin="round"
</header> strokeWidth="2"
d="M4 6h16M4 12h16M4 18h7"
>
</path>
</svg>
</label>
</header>
</div>
); );
} }