#I'd like to change the background colour of the `body` element in Fresh. How do I do that simply?

7 messages · Page 1 of 1 (latest)

eager matrix
#

(see title)

proper tartan
#

could you elaborate on why you need the body element specifically?

eager matrix
#

When the user scrolls past the full height of the page, the background of the outer part of the page must match the inner part of the page. Does that make sense?

vale crescent
eager matrix
vivid radish
#

If you're using CSS files to style, couldn't you just use the body selector and do something like:

body {
  background-color: pink;
}

If you don't have a CSS file somewhere for styling, I think you can pull them in like this:

import { Head } from "$fresh/runtime.ts";

// in your JSX
<Head>
  <link href="path/to/your/styles.css" rel="stylesheet" />
</Head>
lapis igloo
# vivid radish If you're using CSS files to style, couldn't you just use the `body` selector an...

If I'm not mistaken, the _app.tsx would have to because it would have to be in the static folder https://fresh.deno.dev/docs/concepts/static-files

import { Head, asset } from "$fresh/runtime.ts";

<Head>
  <link href={asset("/global.css")} rel="stylesheet" />
</Head>