wagtail-deprecated / react-streamfield

Powerful field for inserting multiple blocks with nesting. (NO LONGER MAINTAINED - See Wagtail 2.13 Release Notes)
https://wagtail.github.io/react-streamfield/public/
35 stars 12 forks source link

add support for wagtail's css variables #14

Closed JNaftali closed 3 years ago

JNaftali commented 3 years ago

Related to https://github.com/wagtail/wagtail/pull/6409

As noted in this comment, the streamfield buttons don't respect changes to wagtail's css variables. This PR is intended to fix that, if appropriate.

What I've included here is the minimum viable fix - just duplicate the declarations! No changes to build tools, no loss of IE support, very simple. Will not scale well (would need 2 declarations every time the $teal color is used)... but maybe it doesn't need to?

If instead I were to solve this like the Wagtail PR does, I would have to re-declare the --color-primary variable in this repo and trust that this stylesheet would always be imported before (and thus, overridden by) Wagtail's stylesheet.

The main reason I'm opening this is to ask: is this good enough? If not, what kinda solution would make the maintainers most comfortable?

cc @thibaudcolas

thibaudcolas commented 3 years ago

We can provide default values for the variables in Wagtail directly, so this shouldn’t be needed. I’ve updated https://github.com/wagtail/wagtail/pull/6409 directly:

@use '../../../../node_modules/react-streamfield/src/scss/index' with (
    $teal: $color-teal,
    $error-color: $color-red,
);