Add support for dark theme
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 30/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
Direzione di ricerca
The issue body is a template with no specific details. First, understand the existing UI components in the repository, likely in src/components. Look for theming or styling systems (CSS, CSS-in-JS, design tokens). Determine how dark theme would be implemented across components. Check for existing documentation or discussions about theming. 'Done' means a consistent dark theme across all components with proper documentation and usage examples.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
bigbluebutton/bigbluebutton#25763 (merged into v4.1.x-develop) replaces DarkReader with a native CSS dark theme: data-theme="dark" on <html>, plus public/stylesheets/theme-dark.css, which redefines CSS custom properties under :root[data-theme='dark']. Until now, plugins didn't have to think about dark mode, because DarkReader inverted the whole rendered document, plugin DOM included. Once 4.1 ships, plugins stop getting that inversion and render with light colors on a dark client, unless their styles react to the theme. Plugins don't get React context from the client, so each plugin has to be dark-aware on its own.
Current state of this library:
- Library components are only partly covered, and by accident.
src/stylesheets/palette.tsresolves every color asvar(--<token>, <light fallback>).theme-dark.cssoverrides some of those tokens (--color-background-white,--color-light-gray,--color-text-default,--color-neutral-3,--color-neutral-2,--default-border,--color-blue-aux,--color-overlay,--color-gray), but not others, and those keep their light values in dark mode. Some examples:--color-neutral-white,--color-neutral-4,--color-hover-light,--color-hover-dark,--color-background-blue,--color-brand-aux,--color-text-light,--color-icon-default,--color-icon-white,--color-border-focus-ring,--color-shadow-default. - The dark values live in the wrong repo. The only dark values for this library's tokens are in a "BBButton Library" section of the client's
theme-dark.css. Adding a token or component here means a coordinated change in the core, and the library can't be checked in dark mode on its own (Storybook has no dark theme). - Plugin-owned UI gets no help at all. Plugins also have their own styled-components (containers, cards, lists, text). With no dark palette exported here, every plugin will hand-roll its own
[data-theme='dark']overrides and hex values. That means duplicated work, inconsistent colors across plugins, and a bug for every plugin that doesn't do it before 4.1. - Theme detection is inconsistent.
Toggle/styles.tsusestheme.applyStyles('dark', …)(MUI color scheme). That depends on the host's MUI theme, not ondata-themeon<html>, so it doesn't follow the new client mechanism.
Describe the solution you'd like
The library should own a light + dark palette that follows the core's data-theme contract, so dark mode is solved once for every plugin:
- Dark values for every token in
palette.ts, applied under[data-theme='dark']. The library would ship this as a stylesheet or a global style/injector that plugins mount once. - Keep the host-override chain. Each dark token should still resolve the client's variable first (e.g.
var(--color-background-white, <lib dark default>)), so the client, or a custom-branded deployment, can still restyle both themes. - Split tokens by role like the core (
surface/text/border) wherever one light color maps to different dark colors depending on how it's used, and rewrite the components to use the role-specific token. - Document the palette as the way plugins style their own UI.
colorsis already exported (package root and@bigbluebutton/bbb-ui-components-react/colors) but undocumented; plugins that build on it get dark mode for free. - Replace ad-hoc dark handling (
theme.applyStyles('dark', …)in Toggle) with the token-based approach, so there's only one source of truth. - Add a Storybook dark-mode toggle (set
data-theme="dark"on the preview<html>) so every component can be checked in both themes.
Acceptance criteria:
- Every color token exported by the library has a dark value that applies when
<html data-theme="dark">is set, without needing DarkReader or client-side overrides. - Host CSS variables still take precedence in both themes.
- All components render correctly in dark mode in Storybook.
- Palette usage for plugins is documented in the README.
- No component depends on the MUI color scheme to detect dark mode.
Describe alternatives you've considered
- Each plugin handles dark mode itself (
[data-theme='dark']overrides or listening todarkmodechange): duplicated effort, colors drift between plugins, and every plugin that doesn't do it before 4.1 regresses. - Keep the library's dark values in the core's
theme-dark.css(as it is today): it couples library releases to core changes, leaves plugin-owned UI uncovered, and makes dark mode impossible to check in this repo.
Affected component(s)
All components (shared palette in src/stylesheets/palette.ts / colors.ts); BBBToggle in particular because of its MUI-based dark handling.
Proposed API / Usage Example
import { colors } from '@bigbluebutton/bbb-ui-components-react/colors';
// Plugin-owned styles follow the client theme automatically
const Card = styled.div`
background: ${colors.background.white};
color: ${colors.text.default};
border: 1px solid ${colors.border.default};
`;
Screenshots or mockups
N/A
Additional context
- bigbluebutton/bigbluebutton#25763: refactor(html5): replace DarkReader with a native CSS dark theme
bigbluebutton-html5/public/stylesheets/theme-dark.css(v4.1.x-develop)- Once the library ships its own dark defaults, the "BBButton Library" section of
theme-dark.cssin the core can be dropped or slimmed down (follow-up there).
- Lingua principale
- TypeScript
- Stelle
- 2
- Fork
- 5
- Merge medio
- 2g 5h
- PR unite (30g)
- 9
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bigbluebutton/bbb-ui-components-react
-
BBButton: subtle variant with neutral color has an opaque white background, so it renders white on white in dark modeForse già presa @nisatsama l’ha presa 2 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
bigbluebutton/bbb-ui-components-react#100 · 1 commento ·
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Add standard component for notifications (BBBToast)Forse già presa @Arthurk12 l’ha presa 33 giorni fa. Apertaenhancement
bigbluebutton/bbb-ui-components-react#72 · 1 assegnatario ·
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Tutte le issue di bigbluebutton/bbb-ui-components-react
Issue simili
-
DB-plane provider_chat_options.* is accepted by config set but never merged into the loaded configAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Bump Firebase JS SDK (12.19.0 → 13.0.0)Forse già presa @SelaseKay l’ha presa oggi. ApertaNeeds Attention type: enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
invertase/react-native-firebase#9364 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
clouflaure de fernandoApertaenhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
cloudflare/mcp#271 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 4 giorni
-
[fullsend] E2E: rhdh-version-override — run-e2e.sh overrides RHDH_VERSION to non-existent 2.1Apertae2e-failure ready-to-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
redhat-developer/rhdh-plugin-export-overlays#4261 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno