Background color of all pages

Hello!

I would like to change the background color of all my pages to white instead light grey.

I tried with

body {
background-color: #f0f0f0;
}

on the stylesheet.css but is not working

Any ideas welcome

White would be #ffffff, not #f0f0f0.

  • Launch your project and use your browser's Development Tools (F12).
  • Use the Inspection Tool (top left on the Developer toolbar) and click the page background.
  • In the Styles tab you will find the following:
.ia_container--root {
    background-color: var(--containerRoot);
}

You could hard-code your #ffffff or white in there but I recommend that you use a built-in theme color such as --neutral-10 which is very close to white but will adjust automatically if you change your theme.

2 Likes

white --white will turn to black in dark mode fwiw, although I wouldn't ever recommend using pure white or black

2 Likes

That's the idea.

They're not in the built-in themes.

1 Like

the word "white" is an in build css color, that turns to black in darkmode (depending on some things, which i dont know if perspective did, cant test atm)

2 Likes

They are, although I think the theme ones area actually --white and --black. Using just white and black will use the standard css colours which may not change with the theme

2 Likes

its possible for it to auto change with themes, but it requires someextra config, which perspective probably didnt do since they have their own colors.

2 Likes

Yes, thanks for the help!
For a white background is probably a good idea to set up the starting theme as light to don´t mess with all themes preconfiguration. Looking for a way to do this. Cheers.

If there is no theme selector in your application then there is no problem.

If there is or was a theme selector then something like this:

now(0) will fire once when the application is loaded.
The transform ignores the now() and just returns "light".

I think there is a simpler way but I can't remember right now.

2 Likes

Thanks Transistor! will try this!

You can just return light as a string in the expression binding, no need for the now

3 Likes