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

[Feature/Question] How to use CSS variables? #2749

Closed
super2ni opened this issue Dec 22, 2019 · 2 comments
Closed

[Feature/Question] How to use CSS variables? #2749

super2ni opened this issue Dec 22, 2019 · 2 comments

Comments

@super2ni
Copy link

This is about Bulma.

Overview of the problem

This is about the Bulma CSS framework

I'm using Bulma 0.7.5.
My browser is: Chrome

Description

I do not know if it's a Feature request or a Question, but I would like to be able to override the Sass variables by CSS variables. The final goal is to offer the end user to be able to customize the theme of the site by updating some CSS variables using Javacript.
Right now, I'm pretty sure it's not possible, but I am ok do discuss the subject, offer solutions and even implement them.

Steps to Reproduce

  1. Set CSS variables, for instance:
    :root { --primary: red; }
  2. Using SCSS, override Bulma variables. For instance:
    $primary:var(--primary, blue) !default;
    `
  3. Import Bulma SASS files:
    @import "~bulma/sass/utilities/_all";

Expected behavior

Be able to compile and update CSS variables using Javascript syntax:
document.documentElement.style .setProperty('--primary', 'pink');

Actual behavior

Compile and see a Sass-loader error.

@Grovkillen
Copy link

#1837 and scroll down

@stale
Copy link

stale bot commented Jul 10, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 10, 2020
@stale stale bot closed this as completed Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants