palantir / blueprint

A React-based UI toolkit for the web
https://blueprintjs.com/
Apache License 2.0
20.63k stars 2.16k forks source link

Exposing SASS variables as custom properties #5181

Open jbmikk opened 2 years ago

jbmikk commented 2 years ago

Environment

Any

Feature request

Have you considered exposing SASS variables as custom properties so users can write custom CSS in their applications using the values blueprint uses internally?

This could be optional and probably prefixed.

Examples

For instance, variables like $pt-grid-size could be exposed like this:

:root {
  --pt-grid-size: #{$pt-grid-size};
}
adidahiya commented 2 years ago

Haven't really considered this yet, but I'm open to it. This could be useful. Accepting PRs.

arniebradfo commented 2 years ago

I would love if yall would do this natively. I can't make PRs to your codebase due to my organization's relationship with Palantir, BUT I did make a hacked version of the Blueprint css so my teams can style blueprint as a system. I had to jump through a lot of hoops to get this to work. Have a look and +1 for this as a feature.

PS Keep up the good work. This component library is by far the best available for creating desktop web apps. Thanks!

switz commented 2 years ago

@arniebradfo This is great work! I'm going to use this, will report back with any issues. Thanks for the effort!