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";
import { IS_BROWSER } from "../runtime.ts";
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 const theme = {
colors: {
black: colors.black,
gray: colors.gray,
green: colors.green,
white: colors.white,
yellow: colors.yellow,
},
};
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 linkActive = apply`text(blue-600 hover:blue-500)`;
const linkActive = apply`text(green-600 hover:green-500)`;
export function SidebarCategory(props: {
path: string;
+1 -1
View File
@@ -15,7 +15,7 @@ export default function NavigationBar(props: { active: string }) {
];
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`}>
{items.map((item) => (
<li>
+2 -2
View File
@@ -1,11 +1,11 @@
// 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";
const sheet = virtualSheet();
sheet.reset();
setup({ sheet });
setup({ sheet, theme });
export function render(ctx: RenderContext, render: RenderFn) {
const snapshot = ctx.state.get("twindSnapshot") as unknown[] | null;
+24 -22
View File
@@ -85,30 +85,32 @@ function Header() {
const sidebarButton = tw
`px-4 py-4 md:hidden border(l-2 gray-100) flex items-center hover:bg-gray-50`;
return (
<header class={header}>
<div class={tw`p-4 flex`}>
<Logo />
<div>
<Title />
<div class={tw`bg-green-200`}>
<header class={header}>
<div class={tw`p-4 flex`}>
<Logo />
<div>
<Title />
</div>
</div>
</div>
<label for="docs_sidebar" class={sidebarButton}>
<svg
class={tw`h-6 w-6`}
stroke="currentColor"
fill="none"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M4 6h16M4 12h16M4 18h7"
<label for="docs_sidebar" class={sidebarButton}>
<svg
class={tw`h-6 w-6`}
stroke="currentColor"
fill="none"
viewBox="0 0 24 24"
>
</path>
</svg>
</label>
</header>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M4 6h16M4 12h16M4 18h7"
>
</path>
</svg>
</label>
</header>
</div>
);
}