Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Bulma variables changes accordint to color-mode #35

Closed
pedropcruz opened this issue Sep 28, 2020 · 2 comments
Closed

Using Bulma variables changes accordint to color-mode #35

pedropcruz opened this issue Sep 28, 2020 · 2 comments
Labels
question Further information is requested

Comments

@pedropcruz
Copy link

Hey guys 👋

I have the problem of changing bulma variables according to each color mode. Example:

| assets
-- | scss
-- -- | override
-- -- -- | bulma.scss
-- -- | themes
-- -- -- | dark.scss
-- -- -- | light.scss

On my bulma file i have this:

@import '~bulma/sass/utilities/initial-variables';
@import '~bulma/sass/utilities/functions';

// Here nothing happens. Any solutions for this?

html {
	&.light-mode {
		@import '../themes/light';
	}

	&.dark-mode {
		@import '../themes/dark';
	}
}

// here i can change any variable i want;

$navbar-item-img-max-height: $size-2;
$navbar-background-color: transparent;

@import '~bulma';

the dark.scss and light.scss have bulma variables inside (assuming they are the opposite) for example:

$primary: $secondary-color;

// customize styles
$body-color: $secondary-color;

I already try the solution with prefers-color-scheme but nothing happens as well. Any solution?

Thanks!

@pedropcruz pedropcruz added the question Further information is requested label Sep 28, 2020
@pedropcruz
Copy link
Author

I found a solution, but i think it's a little bit hacky. but share your thoughts about this:

image

thanks

@Atinux
Copy link
Contributor

Atinux commented Oct 1, 2020

Thank you for sharing your solution @pedropcruz

I believe using CSS variable is the way to go here 😄

@Atinux Atinux closed this as completed Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants