Comments (3)
Wondering whether a "better" approach for me would be to update the CSS vars directly e.g. I found --bulma-body-background-color
and --bulma-scheme-main
but I didn't find a list of CSS vars and their definitions in the docs.
from bulma.
Honestly there's a bunch of different ways to change the background color of the page, however, if I was you I would leave $scheme-main and $scheme-invert alone as those are used throughout and
I think the safest way is to modify $body-background-color, but this would apply the background to both light and dark modes.
$my-awesome-background-color: rgb(0,0,1); // most awesome dark color with ever so slight hint of blue
// Changing the body background-color through *sass/base*
@use "..//node_modules/bulma/sass/base" with (
$body-background-color: $my-awesome-background-color,
);
// Then import the rest using @forweard if not customizing any variables in the corresponding CSS or use @use
@forward "bulma/sass/components/card";
@forward "bulma/sass/components/modal";
@forward "bulma/sass/components/navbar";
@forward "bulma/sass/elements/button";
@forward "bulma/sass/elements/icon";
@forward "bulma/sass/elements/content";
@forward "bulma/sass/elements/notification";
@forward "bulma/sass/elements/progress";
@forward "bulma/sass/elements/tag";
@forward "bulma/sass/layout/footer";
...
You can also change it through derived-variables, but that wouuld definitely upset the built-in themes mechanism. Changing it through $body-background-color is independent, regardless of light mode or dark mode :)
You can also change it manually like:
body {
background-color: rgb(0,0,1);
}
And you can of course do it through CSS variables, but sounds like you want to setup a custom bulma theme, rather than rely on the light or dark presets.
But, $background to my understanding is more of a background for menus, panels, buttons, etc.
from bulma.
Thanks so much for the detailed reply and advice @digitigradeit. In the end, I went for the 'low tech' option of changing the CSS Variables.
:root {
--bulma-body-background-color: #fffcf0;
}
@media (prefers-color-scheme: dark) {
:root {
--bulma-body-background-color: #100f0f;
}
}
from bulma.
Related Issues (20)
- Input Color - CSS Improvement
- element input, with date attribute HOT 2
- button and a tag button alignment problem
- is-NxN does not respect height=N
- Customize is-info inverted color via SASS in 1.0 HOT 1
- figure element together with image classes with img
- dropdown does not support rounded HOT 1
- In Bulma 1 breadcrumbs seem to be broken HOT 2
- v1.0 level is-mobile class does not seem to be horizontal any more HOT 3
- v1.0 breadcrumbs not alligned properly when content is parent container HOT 2
- Columns is-variable not working HOT 2
- Italic font by default HOT 1
- Table "is-striped" and "is-hoverable" modifiers appear to be broken in 1.0.0 HOT 1
- Can we get an example of how to create a simple bulma scss theme? HOT 1
- How do I override the colors in the dark theme?
- Some of the helper classes are missing prefix in the pre-built alternative of "Prefixed" version
- Unable to access Bulma variables despite using the @use keyword HOT 1
- Table Header text color isn't set correctly when a thead is present
- Dead link in the documentation on the Button page
- Combining file input with .has-addons HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bulma.