fix(BBBModal, BBButton): follow the BBB client dark theme and border color when colors are overridden - #94
Merged
Conversation
BBBModal and its sticky footer take their background from colorWhite, which resolves to --color-neutral-white. The BBB client does not know that variable: its own palette and its dark theme are built on --color-white, so in dark mode the modal keeps a white background, or at best gets darkreader's generic inversion, which does not match the client's native modals. The background is also set through react-modal's inline `style`, so consumers can only override it with `!important` on the modal id. Map colorWhite to --color-white, falling back to --color-neutral-white, following the same "mapped to core css vars" pattern used by colorBrand1 and colorError. This makes every library use of colorWhite follow the client's --color-white, which is what BBB's own components already do. Move the modal background out of the inline style into a styled(ReactModal) class. Passing a className makes react-modal drop its default content styles, including a 1px #ccc border; that border is not restated, matching BBB's native BaseModal, which has none. A dedicated token used only by the modal was considered, but it would leave the rest of the library out of sync with the client theme.
The border of the secondary (outlined) BBButton stays blue even when the client overrides --color-primary, while the button's text and outline already follow it. The border comes from colorBorderSelected, which falls back straight to the library's base brand color (--color-brand-1, #0F70D7), skipping --color-primary. Fall back to colorBrand1 instead, so the chain becomes --color-border-selected -> --color-primary -> --color-brand-1 -> #0F70D7. The border-specific variable still wins when set, and otherwise the border follows the client's primary color. colorBorderSelected is also used for the focus/selected borders of BBBSelect, BBBSearch, BBBInput and BBBTextInput, which now follow --color-primary the same way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
colorWhitenow maps to the client's--color-white, falling back to--color-neutral-white.--color-whiteis the variable the client remaps in dark mode.styleinto astyled(ReactModal)class, so regular CSS can override it.secondaryvariant now follows--color-primary.colorBorderSelectednow falls back tocolorBrand1instead of the base brand color.Closes Issue(s)
Closes #89