docs: port over to TailwindCSS (#2058)

This commit is contained in:
Marvin Hagemeister
2023-11-22 11:12:21 +01:00
committed by GitHub
parent f105f19005
commit bb035ae8da
26 changed files with 145 additions and 145 deletions
+1
View File
@@ -1,3 +1,4 @@
_fresh/ _fresh/
tmp/ tmp/
vendor/ vendor/
node_modules/
+3 -1
View File
@@ -17,6 +17,8 @@
"$marked-mangle": "https://esm.sh/marked-mangle@1.0.1", "$marked-mangle": "https://esm.sh/marked-mangle@1.0.1",
"$fresh-testing-library": "https://deno.land/x/fresh_testing_library@0.11.1/mod.ts", "$fresh-testing-library": "https://deno.land/x/fresh_testing_library@0.11.1/mod.ts",
"$fresh-testing-library/": "https://deno.land/x/fresh_testing_library@0.11.1/", "$fresh-testing-library/": "https://deno.land/x/fresh_testing_library@0.11.1/",
"tailwindcss": "npm:tailwindcss@3.3.5" "tailwindcss": "npm:tailwindcss@3.3.5",
"tailwindcss/": "npm:/tailwindcss@3.3.5/",
"tailwindcss/plugin": "npm:/tailwindcss@3.3.5/plugin.js"
} }
} }
+49 -44
View File
@@ -5,60 +5,65 @@ import cssnano from "npm:cssnano@6.0.1";
import * as path from "https://deno.land/std@0.207.0/path/mod.ts"; import * as path from "https://deno.land/std@0.207.0/path/mod.ts";
import { walk } from "https://deno.land/std@0.207.0/fs/walk.ts"; import { walk } from "https://deno.land/std@0.207.0/fs/walk.ts";
const CONFIG_EXTENSIONS = ["ts", "js", "mjs"];
async function findTailwindConfigFile(directory: string): Promise<string> {
let dir = directory;
while (true) {
for (let i = 0; i < CONFIG_EXTENSIONS.length; i++) {
const ext = CONFIG_EXTENSIONS[i];
const filePath = path.join(dir, `tailwind.config.${ext}`);
try {
const stat = await Deno.stat(filePath);
if (stat.isFile) {
return filePath;
}
} catch (err) {
if (!(err instanceof Deno.errors.NotFound)) {
throw err;
}
}
}
const parent = path.dirname(dir);
if (parent === dir) {
throw new Error(
`Could not find a tailwind config file in the current directory or any parent directory.`,
);
}
dir = parent;
}
}
async function initTailwind( async function initTailwind(
config: ResolvedFreshConfig, config: ResolvedFreshConfig,
): Promise<postcss.Processor> { ): Promise<postcss.Processor> {
const root = path.dirname(config.staticDir); const root = path.dirname(config.staticDir);
let tailwindConfig: Config | null = null; const configPath = await findTailwindConfigFile(root);
console.log({ configPath, cwd: Deno.cwd() });
const url = path.toFileUrl(configPath).href;
const tailwindConfig = (await import(url)).default as Config;
const configFilePaths = [ if (!Array.isArray(tailwindConfig.content)) {
path.join(Deno.cwd(), "tailwind.config.ts"), throw new Error(`Expected tailwind "content" option to be an array`);
path.join(Deno.cwd(), "tailwind.config.js"), }
path.join(Deno.cwd(), "tailwind.config.mjs"),
path.join(root, "tailwind.config.ts"),
path.join(root, "tailwind.config.js"),
path.join(root, "tailwind.config.mjs"),
];
for (const configFile of configFilePaths) {
let importedConfig: Config | null = null;
try {
const url = path.toFileUrl(configFile).href;
importedConfig = (await import(url)).default as Config;
} catch (_err) {
// ignore
}
if (importedConfig !== null) { tailwindConfig.content = tailwindConfig.content.map((pattern) => {
if (!Array.isArray(importedConfig.content)) { if (typeof pattern === "string") {
throw new Error(`Expected tailwind "content" option to be an array`); const relative = path.relative(Deno.cwd(), path.dirname(configPath));
if (!relative.startsWith("..")) {
return path.join(relative, pattern);
} }
importedConfig.content = importedConfig.content.map((pattern) => {
if (typeof pattern === "string") {
return path.join(
path.relative(Deno.cwd(), path.dirname(configFile)),
pattern,
);
}
return pattern;
});
tailwindConfig = importedConfig;
break;
} }
} return pattern;
});
if (tailwindConfig === null) { // PostCSS types cause deep recursion
throw new Error( // deno-lint-ignore no-explicit-any
`Could not find tailwind config file. Searched the following locations:\n\n${ const plugins: any[] = [
configFilePaths.map((p) => `- ${p}`).join("\n")
}`,
);
}
const plugins: postcss.AcceptedPlugin[] = [
tailwindCss(tailwindConfig), tailwindCss(tailwindConfig),
]; ];
-1
View File
@@ -207,7 +207,6 @@ export async function withPageName(
}); });
try { try {
await delay(100);
const browser = await puppeteer.launch({ args: ["--no-sandbox"] }); const browser = await puppeteer.launch({ args: ["--no-sandbox"] });
try { try {
+4 -2
View File
@@ -1,8 +1,10 @@
import { waitForText, withPageName } from "$fresh/tests/test_utils.ts"; import { runBuild, waitForText, withPageName } from "../test_utils.ts";
Deno.test("www - docs navigation", async () => { Deno.test("www - docs navigation", async () => {
await runBuild("./www/dev.ts");
await withPageName("./www/main.ts", async (page, address) => { await withPageName("./www/main.ts", async (page, address) => {
await page.goto(`${address}`, { waitUntil: "networkidle2" }); await page.goto(`${address}`);
await page.click(`a[href="/docs"]`); await page.click(`a[href="/docs"]`);
await waitForText(page, "h1", "Introduction"); await waitForText(page, "h1", "Introduction");
+1 -1
View File
@@ -7,7 +7,7 @@ export function RoundedButton(props: JSX.HTMLAttributes<HTMLButtonElement>) {
touchAction: "manipulation", touchAction: "manipulation",
}} }}
{...props} {...props}
class="p-3 border border-transparent rounded-full text-white bg-green(500 hover:600) focus:(outline-none ring(2 offset-2 green-500)) disabled:(bg-green-200 cursor-default)}" class="p-3 border border-transparent rounded-full text-white bg-green-500 hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:bg-green-200 disabled:cursor-default"
/> />
); );
} }
+2 -2
View File
@@ -54,7 +54,7 @@ export function SidebarCategory(props: {
<li class="my-2 block"> <li class="my-2 block">
<a <a
href={href} href={href}
class="text(gray-900 hover:gray-600) [data-current]:text-green-700 [data-current]:hover:underline font-bold" class="text-gray-900 hover:text-gray-600 data-[current]:text-green-700 data-[current]:hover:underline font-bold"
> >
{title} {title}
</a> </a>
@@ -78,7 +78,7 @@ export function SidebarEntry(props: {
<li class="py-[1px]"> <li class="py-[1px]">
<a <a
href={href} href={href}
class="[data-current]:text-green-700 [data-current]:border-green-600 [data-current]:bg-green-50 border-l-4 border-transparent px-4 py-0.5 transition-colors hover:text-green-500 font-normal block" class="data-[current]:text-green-700 data-[current]:border-green-600 data-[current]:bg-green-50 border-l-4 border-transparent px-4 py-0.5 transition-colors hover:text-green-500 font-normal block"
> >
{title} {title}
</a> </a>
+1 -1
View File
@@ -3,7 +3,7 @@ export default function DocsTitle() {
<> <>
<a <a
href="/" href="/"
class="text(2xl gray-900) flex items-center" class="text-2xl text-gray-900 flex items-center"
aria-label="Top Page" aria-label="Top Page"
> >
<svg <svg
+2 -2
View File
@@ -18,8 +18,8 @@ const LINKS = [
export default function Footer() { export default function Footer() {
return ( return (
<footer class="border-t-2 border-gray-200 md:h-16 flex my-8 justify-center"> <footer class="border-t-2 border-gray-200 md:h-16 flex my-8 justify-center">
<div class="flex flex-col sm:flex-row gap-4 justify-between items-center max-w-screen-xl mx-auto w-full px(4 sm:6 md:8) p-4"> <div class="flex flex-col sm:flex-row gap-4 justify-between items-center max-w-screen-xl mx-auto w-full sm:px-6 md:px-8 p-4">
<div class="text(gray-600 center)"> <div class="text-gray-600 text-center">
<span>© {new Date().getFullYear()} the Fresh authors</span> <span>© {new Date().getFullYear()} the Fresh authors</span>
</div> </div>
+1 -1
View File
@@ -31,7 +31,7 @@ export default function NavigationBar(
href={item.href} href={item.href}
class={`p-1 sm:p-2 ${ class={`p-1 sm:p-2 ${
isHome ? "text-green-900" : "text-gray-600" isHome ? "text-green-900" : "text-gray-600"
} hover:underline [data-current]:font-bold [data-ancestor]:font-bold`} } hover:underline data-[current]:font-bold data-[ancestor]:font-bold`}
> >
{item.name} {item.name}
</a> </a>
+2 -2
View File
@@ -29,11 +29,11 @@ export default function Projects(props: ProjectProps) {
width={600} width={600}
height={337} height={337}
style={{ aspectRatio: "16/9" }} style={{ aspectRatio: "16/9" }}
class="object-cover shadow-lg group-hover:(shadow-xl opacity-70) rounded-lg" class="object-cover shadow-lg group-hover:shadow-xl group-hover:opacity-70 rounded-lg"
/> />
</a> </a>
<div class="mt-4 flex items-center"> <div class="mt-4 flex items-center">
<div class="text(lg gray-600) flex-1 group-hover:text-underline"> <div class="text-lg text-gray-600 flex-1 group-hover:text-underline">
<a href={project.link}>{project.title}</a> <a href={project.link}>{project.title}</a>
</div> </div>
{project.github && ( {project.github && (
+1 -2
View File
@@ -1,4 +1,3 @@
import { tw } from "twind";
import { asset } from "$fresh/runtime.ts"; import { asset } from "$fresh/runtime.ts";
import { useSignal } from "@preact/signals"; import { useSignal } from "@preact/signals";
import { useEffect, useRef } from "preact/hooks"; import { useEffect, useRef } from "preact/hooks";
@@ -83,7 +82,7 @@ const Carousel = (props: CarouselProps) => {
if (outgoingSlide === idx) return "-translate-x-full z-10"; if (outgoingSlide === idx) return "-translate-x-full z-10";
return "translate-x-full"; return "translate-x-full";
}; };
return tw`slide absolute top-0 left-0 transition-all ease-in-out duration-700 transform ${TRANSITION_CLASS}`; return `slide absolute top-0 left-0 transition-all ease-in-out duration-700 transform ${TRANSITION_CLASS}`;
}; };
const nextSlide = () => { const nextSlide = () => {
+5 -3
View File
@@ -1,5 +1,6 @@
{ {
"lock": false, "lock": false,
"nodeModulesDir": true,
"tasks": { "tasks": {
"start": "deno run -A --watch=static/,routes/,../src dev.ts", "start": "deno run -A --watch=static/,routes/,../src dev.ts",
"build": "deno run -A dev.ts build", "build": "deno run -A dev.ts build",
@@ -7,8 +8,6 @@
}, },
"imports": { "imports": {
"$fresh/": "../", "$fresh/": "../",
"twind": "https://esm.sh/twind@0.16.19",
"twind/": "https://esm.sh/twind@0.16.19/",
"preact": "https://esm.sh/preact@10.15.1", "preact": "https://esm.sh/preact@10.15.1",
"preact/": "https://esm.sh/preact@10.15.1/", "preact/": "https://esm.sh/preact@10.15.1/",
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3", "@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
@@ -17,7 +16,10 @@
"$ga4": "https://raw.githubusercontent.com/denoland/ga4/main/mod.ts", "$ga4": "https://raw.githubusercontent.com/denoland/ga4/main/mod.ts",
"$marked-mangle": "https://esm.sh/marked-mangle@1.0.1", "$marked-mangle": "https://esm.sh/marked-mangle@1.0.1",
"$fresh-testing-library": "https://deno.land/x/fresh_testing_library@0.8.0/mod.ts", "$fresh-testing-library": "https://deno.land/x/fresh_testing_library@0.8.0/mod.ts",
"$fresh-testing-library/": "https://deno.land/x/fresh_testing_library@0.8.0/" "$fresh-testing-library/": "https://deno.land/x/fresh_testing_library@0.8.0/",
"tailwindcss": "npm:tailwindcss@3.3.5",
"tailwindcss/": "npm:/tailwindcss@3.3.5/",
"tailwindcss/plugin": "npm:/tailwindcss@3.3.5/plugin.js"
}, },
"compilerOptions": { "compilerOptions": {
"jsx": "react-jsx", "jsx": "react-jsx",
+2 -3
View File
@@ -1,10 +1,9 @@
import twindPlugin from "$fresh/plugins/twind.ts";
import twindConfig from "./twind.config.ts";
import { defineConfig } from "$fresh/server.ts"; import { defineConfig } from "$fresh/server.ts";
import tailwind from "$fresh/plugins/tailwind.ts";
export default defineConfig({ export default defineConfig({
build: { build: {
target: "safari12", target: "safari12",
}, },
plugins: [twindPlugin(twindConfig)], plugins: [tailwind()],
}); });
+2
View File
@@ -4,6 +4,7 @@
import * as $_404 from "./routes/_404.tsx"; import * as $_404 from "./routes/_404.tsx";
import * as $_500 from "./routes/_500.tsx"; import * as $_500 from "./routes/_500.tsx";
import * as $_app from "./routes/_app.tsx";
import * as $_middleware from "./routes/_middleware.ts"; import * as $_middleware from "./routes/_middleware.ts";
import * as $components from "./routes/components.tsx"; import * as $components from "./routes/components.tsx";
import * as $docs_slug_ from "./routes/docs/[...slug].tsx"; import * as $docs_slug_ from "./routes/docs/[...slug].tsx";
@@ -24,6 +25,7 @@ const manifest = {
routes: { routes: {
"./routes/_404.tsx": $_404, "./routes/_404.tsx": $_404,
"./routes/_500.tsx": $_500, "./routes/_500.tsx": $_500,
"./routes/_app.tsx": $_app,
"./routes/_middleware.ts": $_middleware, "./routes/_middleware.ts": $_middleware,
"./routes/components.tsx": $components, "./routes/components.tsx": $components,
"./routes/docs/[...slug].tsx": $docs_slug_, "./routes/docs/[...slug].tsx": $docs_slug_,
+2 -2
View File
@@ -31,14 +31,14 @@ export default function CopyArea(props: { code: string }) {
}, [copied.value]); }, [copied.value]);
return ( return (
<div class="bg(gray-800) rounded text-white flex items-center min-w-0"> <div class="bg-gray-800 rounded text-white flex items-center min-w-0">
<pre class="overflow-x-auto flex-1 py-2 px-4"> <pre class="overflow-x-auto flex-1 py-2 px-4">
{props.code} {props.code}
</pre> </pre>
<div class="relative my-2 mr-4"> <div class="relative my-2 mr-4">
<div <div
class={`hidden transition ease-in-out absolute pointer-events-none bg-gray-900 text-white absolute p-2 -top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-full box-border rounded opacity-0 ${ class={`hidden transition ease-in-out absolute pointer-events-none bg-gray-900 text-white p-2 -top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-full box-border rounded opacity-0 ${
copied.value && "block opacity-100" copied.value && "block opacity-100"
}`} }`}
> >
+1 -1
View File
@@ -99,7 +99,7 @@ function LemonDrop() {
viewBox="0 0 100 300" viewBox="0 0 100 300"
fill="none" fill="none"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
class="mt-36" class="mt-32"
role="img" role="img"
aria-label="Fresh logo" aria-label="Fresh logo"
> >
+2 -2
View File
@@ -10,11 +10,11 @@ export function ServerCodePage(
<LemonDrop /> <LemonDrop />
</div> </div>
<div class="text-center"> <div class="text-center">
<h1 class="text(6xl) md:text(9xl) font-extrabold"> <h1 class="text-6xl md:text-9xl font-extrabold">
{props.serverCode} {props.serverCode}
</h1> </h1>
<p class="p-4 text(2xl) md:text(3xl)"> <p class="p-4 text-2xl md:text-3xl">
{props.codeDescription} {props.codeDescription}
</p> </p>
+17
View File
@@ -0,0 +1,17 @@
import { AppProps } from "$fresh/server.ts";
export default function App({ Component }: AppProps) {
return (
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Fresh app</title>
<link rel="stylesheet" href="/styles.css" />
</head>
<body>
<Component />
</body>
</html>
);
}
+4 -4
View File
@@ -57,8 +57,8 @@ export default function Home(props: PageProps<HomeProps>) {
</Head> </Head>
<Header title="components" active="/components" /> <Header title="components" active="/components" />
<section class="my-16 px(4 sm:6 md:8) mx-auto max-w-screen-lg space-y-4"> <section class="my-16 px-4 sm:px-6 md:px-8 mx-auto max-w-screen-lg space-y-4">
<h2 class="text(3xl gray-600) font-bold"> <h2 class="text-3xl text-gray-600 font-bold">
Fresh Components Fresh Components
</h2> </h2>
<p class="text-gray-600"> <p class="text-gray-600">
@@ -71,7 +71,7 @@ export default function Home(props: PageProps<HomeProps>) {
<a class="block" href="https://tabler-icons-tsx.deno.dev/"> <a class="block" href="https://tabler-icons-tsx.deno.dev/">
<div <div
style="background-image: url(/gallery/banner-tabler-icons.png)" style="background-image: url(/gallery/banner-tabler-icons.png)"
class="h-48 bg(cover no-repeat white) hover:opacity-50 hover:underline rounded" class="h-48 bg-cover bg-no-repeat bg-white hover:opacity-50 hover:underline rounded"
> >
<h2 class="text-4xl font-bold p-4">Icons</h2> <h2 class="text-4xl font-bold p-4">Icons</h2>
</div> </div>
@@ -80,7 +80,7 @@ export default function Home(props: PageProps<HomeProps>) {
<a class="block" href="https://github.com/denoland/fresh_charts"> <a class="block" href="https://github.com/denoland/fresh_charts">
<div <div
style="background-image: url(/gallery/banner-chart.png)" style="background-image: url(/gallery/banner-chart.png)"
class="h-48 bg(cover no-repeat white) hover:opacity-50 hover:underline rounded" class="h-48 bg-cover bg-no-repeat bg-white hover:opacity-50 hover:underline rounded"
> >
<h2 class="text-4xl font-bold p-4">Charts</h2> <h2 class="text-4xl font-bold p-4">Charts</h2>
</div> </div>
+3 -3
View File
@@ -190,7 +190,7 @@ function MobileSidebar(props: { page: Page }) {
class="absolute inset-0 bg-gray-600 opacity-75" class="absolute inset-0 bg-gray-600 opacity-75"
for="docs_sidebar" for="docs_sidebar"
/> />
<div class="relative flex-1 flex flex-col w-[18rem] h-full bg-white border(r-2 gray-100)"> <div class="relative flex-1 flex flex-col w-[18rem] h-full bg-white border-r-2 border-gray-100">
<nav class="pt-0 pb-16 px-4 overflow-x-auto"> <nav class="pt-0 pb-16 px-4 overflow-x-auto">
<DocsSidebar <DocsSidebar
mobile mobile
@@ -244,7 +244,7 @@ function Content(props: { page: Page }) {
<div>Table of Contents</div> <div>Table of Contents</div>
</label> </label>
</div> </div>
<h1 class="text(4xl gray-900) tracking-tight font-extrabold md:mt-0 px-4"> <h1 class="text-4xl text-gray-900 tracking-tight font-extrabold md:mt-0 px-4">
{props.page.title} {props.page.title}
</h1> </h1>
<div <div
@@ -277,7 +277,7 @@ function ForwardBackButtons(props: {
const lower = "text-gray-900 font-medium"; const lower = "text-gray-900 font-medium";
return ( return (
<div class="px-4 mt-8 flex flex(col md:row) gap-4"> <div class="px-4 mt-8 flex flex-col md:flex-row gap-4">
{prev && ( {prev && (
<a href={prev.href} class={`${button} text-left`}> <a href={prev.href} class={`${button} text-left`}>
<span class={upper}>{"←"} Previous</span> <span class={upper}>{"←"} Previous</span>
+12 -12
View File
@@ -76,7 +76,7 @@ export default function MainPage(props: PageProps) {
function HelloBar() { function HelloBar() {
return ( return (
<a <a
class="bg-green-400 text-black border(b green-500) p-3 text-center group" class="bg-green-400 text-black border-b border-green-500 p-3 text-center group"
href="https://deno.com/blog/fresh-1.5" href="https://deno.com/blog/fresh-1.5"
> >
<b>Fresh v1.5</b> has been released with <b>Partials</b>,{" "} <b>Fresh v1.5</b> has been released with <b>Partials</b>,{" "}
@@ -151,11 +151,11 @@ function Features() {
function Intro(props: { origin: string }) { function Intro(props: { origin: string }) {
return ( return (
<section class="max-w-screen-xl mx-auto my-8 sm:my-16 px(4 sm:6 md:8) space-y-8 sm:space-y-16 lg:mb-32"> <section class="max-w-screen-xl mx-auto my-8 sm:my-16 px-4 sm:px-6 md:px-8 space-y-8 sm:space-y-16 lg:mb-32">
<div class="max-w-screen-xl mx-auto sm:my-8 md:my-16 sm:space-y-12 w-full"> <div class="max-w-screen-xl mx-auto sm:my-8 md:my-16 sm:space-y-12 w-full">
<div class="md:flex items-center"> <div class="md:flex items-center">
<div class="flex-1 text-center md:text-left"> <div class="flex-1 text-center md:text-left">
<h2 class="py-2 text(5xl sm:5xl lg:6xl gray-900) sm:tracking-tight sm:leading-[1.1]! font-extrabold lg:max-w-lg mx-auto sm:mx-0"> <h2 class="py-2 text-5xl sm:text-5xl lg:text-6xl text-gray-900 sm:tracking-tight sm:leading-[1.1]! font-extrabold lg:max-w-lg mx-auto sm:mx-0">
The <span class="text-green-600">next-gen</span> web framework. The <span class="text-green-600">next-gen</span> web framework.
</h2> </h2>
@@ -166,7 +166,7 @@ function Intro(props: { origin: string }) {
<div> <div>
<a <a
href="/docs/getting-started" href="/docs/getting-started"
class="inline-flex w-auto shrink-0 px-3 py-2 bg-white rounded border(gray-500 2) hover:bg-gray-200 active:bg-gray-300 disabled:(opacity-50 cursor-not-allowed) whitespace-nowrap" class="inline-flex w-auto shrink-0 px-3 py-2 bg-white rounded border-gray-500 border-2 hover:bg-gray-200 active:bg-gray-300 disabled:opacity-50 disabled:cursor-not-allowed whitespace-nowrap"
> >
Get started Get started
</a> </a>
@@ -198,10 +198,10 @@ function Intro(props: { origin: string }) {
function Example() { function Example() {
return ( return (
<section class="max-w-screen-xl mx-auto my-8 sm:my-16 md:my-24 px(4 sm:6 md:8) space-y-16"> <section class="max-w-screen-xl mx-auto my-8 sm:my-16 md:my-24 px-4 sm:px-6 md:px-8 space-y-16">
<div class="flex gap-4 md:gap-16 flex-col md:flex-row justify-between items-center"> <div class="flex gap-4 md:gap-16 flex-col md:flex-row justify-between items-center">
<div class="md:basis-1/2"> <div class="md:basis-1/2">
<h2 id="example" class="text(4xl gray-600) font-bold mb-4"> <h2 id="example" class="text-4xl text-gray-600 font-bold mb-4">
<a href="#example" class="hover:underline"> <a href="#example" class="hover:underline">
Interactive islands Interactive islands
</a> </a>
@@ -223,8 +223,8 @@ function Example() {
function Showcase() { function Showcase() {
return ( return (
<section class="max-w-screen-xl mx-auto space-y-16 px(4 sm:6 md:8) space-y-4"> <section class="max-w-screen-xl mx-auto px-4 sm:px-6 md:px-8 space-y-4">
<h2 id="showcase" class="text(4xl gray-600) font-bold mb-4"> <h2 id="showcase" class="text-4xl text-gray-600 font-bold mb-4">
<a href="#showcase" class="hover:underline"> <a href="#showcase" class="hover:underline">
Showcase Showcase
</a> </a>
@@ -245,18 +245,18 @@ function Showcase() {
function StartJourney() { function StartJourney() {
return ( return (
<section class="max-w-screen-xl mx-auto py-16 px(4 sm:6 md:8) space-y-4 md:mb-16"> <section class="max-w-screen-xl mx-auto py-16 px-4 sm:px-6 md:px-8 space-y-4 md:mb-16">
<h2 class="text(4xl gray-600) md:text-5xl font mb-4 mt-0"> <h2 class="text-4xl text-gray-600 md:text-5xl font mb-4 mt-0">
Start your Fresh journey Start your Fresh journey
</h2> </h2>
<div class="flex flex-col md:flex-row justify-start items-center gap-4"> <div class="flex flex-col md:flex-row justify-start items-center gap-4">
<p class="text(xl gray-600)"> <p class="text-xl text-gray-600">
Jump right in and build your website with Fresh. Learn everything you Jump right in and build your website with Fresh. Learn everything you
need to know in seconds. need to know in seconds.
</p> </p>
<a <a
href="/docs/getting-started" href="/docs/getting-started"
class="inline-block px-3 py-2 bg-white rounded border(gray-500 2) hover:bg-gray-200 active:bg-gray-300 disabled:(opacity-50 cursor-not-allowed) whitespace-nowrap" class="inline-block px-3 py-2 bg-white rounded border-gray-500 border-2 hover:bg-gray-200 active:bg-gray-300 disabled:opacity-50 disabled:cursor-not-allowed whitespace-nowrap"
> >
Get started Get started
</a> </a>
+4 -4
View File
@@ -28,8 +28,8 @@ export default function ShowcasePage(props: PageProps) {
<div class="flex-1"> <div class="flex-1">
<Showcase items={projects} /> <Showcase items={projects} />
<section class="max-w-screen-lg mx-auto my-16 px(4 sm:6 md:8) space-y-4"> <section class="max-w-screen-lg mx-auto my-16 px-4 sm:px-6 md:px-8 space-y-4">
<h2 class="text(3xl gray-600) font-bold"> <h2 class="text-3xl text-gray-600 font-bold">
Badge Badge
</h2> </h2>
@@ -77,8 +77,8 @@ export default function ShowcasePage(props: PageProps) {
function Showcase({ items }: { items: Project[] }) { function Showcase({ items }: { items: Project[] }) {
return ( return (
<section class="max-w-screen-lg mx-auto my-16 px(4 sm:6 md:8) space-y-4"> <section class="max-w-screen-lg mx-auto my-16 px-4 sm:px-6 md:px-8 space-y-4">
<h2 class="text(3xl gray-600) font-bold"> <h2 class="text-3xl text-gray-600 font-bold">
Showcase Showcase
</h2> </h2>
<p class="text-gray-600"> <p class="text-gray-600">
+3
View File
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
+21
View File
@@ -0,0 +1,21 @@
import { type Config } from "tailwindcss";
import plugin from "tailwindcss/plugin";
export default {
content: [
"{routes,islands,components}/**/*.{ts,tsx}",
],
plugins: [
plugin((api) => {
api.addUtilities({
".form-select-bg": {
"background-image":
`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3e%3cpath d='M7 7l3-3 3 3m0 6l-3 3-3-3' stroke='%239fa6b2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e")`,
"background-position": "right 0.5rem center",
"background-size": "1.5em 1.5em",
"background-repeat": "no-repeat",
},
});
}),
],
} as Config;
-52
View File
@@ -1,52 +0,0 @@
import { Options } from "$fresh/plugins/twind.ts";
import * as colors from "twind/colors";
export default {
selfURL: import.meta.url,
theme: {
colors: {
blue: colors.blue,
black: colors.black,
gray: colors.gray,
green: colors.green,
white: colors.white,
yellow: colors.yellow,
transparent: "transparent",
},
},
plugins: {
// Basic workaround for old twind version not supporting
// the `basis-*` keyword
basis: (parts) => {
let value;
const arr = parts[0].split("/");
if (arr.length === 2) {
value = `${(+arr[0] / +arr[1]) * 100}%`;
} else if (parts.length === 1) {
value = parts[0];
}
return {
"flex-basis": value,
};
},
"rounded-full": () => {
return {
"border-radius": "9999px",
};
},
"form-select-bg": () => {
return {
"background-image":
`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3e%3cpath d='M7 7l3-3 3 3m0 6l-3 3-3-3' stroke='%239fa6b2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e")`,
"background-position": "right 0.5rem center",
"background-size": "1.5em 1.5em",
"background-repeat": "no-repeat",
};
},
"grow": () => {
return {
"flex-grow": "1",
};
},
},
} as Options;