Skip to content

Commit

Permalink
fix: add init background gradient (#2502)
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinhagemeister authored Jun 5, 2024
1 parent 7eb9a9b commit f09130c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions init/src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ export default {
await writeFile("tailwind.config.ts", TAILWIND_CONFIG_TS);
}

const GRADIENT_CSS = `
.fresh-gradient {
background-color: rgb(134, 239, 172);
background-image: linear-gradient(to right bottom, rgb(219, 234, 254), rgb(187, 247, 208), rgb(254, 249, 195));
}
`;

const NO_TAILWIND_STYLES = `
*,
*::before,
Expand Down Expand Up @@ -330,11 +337,15 @@ html {
.tabular-nums {
font-variant-numeric: tabular-nums;
}
${GRADIENT_CSS}
`;

const TAILWIND_CSS = `@tailwind base;
@tailwind components;
@tailwind utilities;`;
@tailwind utilities;
${GRADIENT_CSS}
`;

const cssStyles = useTailwind ? TAILWIND_CSS : NO_TAILWIND_STYLES;
await writeFile("static/styles.css", cssStyles);
Expand Down Expand Up @@ -412,7 +423,7 @@ export default define.page(function Home() {
const count = useSignal(3);
return (
<div class="px-4 py-8 mx-auto bg-[#86efac]">
<div class="px-4 py-8 mx-auto fresh-gradient">
<div class="max-w-screen-md mx-auto flex flex-col items-center justify-center">
<img
class="my-6"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export async function withBrowser(fn: (page: Page) => void | Promise<void>) {
try {
const browser = await launch({
args: ["--no-sandbox"],
// headless: false,
headless: !Deno.args.includes("--headful"),
});

const page = await browser.newPage();
Expand Down

0 comments on commit f09130c

Please sign in to comment.