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;
+2
View File
@@ -85,6 +85,7 @@ 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 (
<div class={tw`bg-green-200`}>
<header class={header}> <header class={header}>
<div class={tw`p-4 flex`}> <div class={tw`p-4 flex`}>
<Logo /> <Logo />
@@ -109,6 +110,7 @@ function Header() {
</svg> </svg>
</label> </label>
</header> </header>
</div>
); );
} }