Skip to content

feat(html5): add static bbb-* CSS classes to key components for theming - #26193

Merged
ramonlsouza merged 1 commit into
bigbluebutton:v4.0.x-developfrom
gustavotrott:html5-static-css-classes
Oct 28, 2026
Merged

ramonlsouza merged 1 commit into
bigbluebutton:v4.0.x-developfrom
gustavotrott:html5-static-css-classes

Conversation

@gustavotrott

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds static, prefixed CSS classes to key elements of the HTML5 client, so themes, plugins and custom.css can target them without relying on data-test attributes or on the DOM structure.

Naming follows a BEM-like scheme with a bbb- prefix, to avoid collisions with plugin and custom styles:

  • bbb-block for a component (bbb-avatar, bbb-navigation)
  • bbb-block__element for a part of it (bbb-navigation__item, bbb-chat-message__time)
  • bbb-block--state for a state (bbb-avatar--presenter, bbb-mute-toggle--muted)

State classes are derived only from props and state each component already had. No queries, subscriptions or hooks were added, and no component re-renders more than before. data-test attributes and ids are untouched.

Classes added

Area Classes
Avatar (user-avatar) bbb-avatar, --moderator, --presenter, --you, --talking
Navigation sidebar bbb-navigation (--collapsed on mobile), __bar, __list, __separator, __logo
Navigation button bbb-navigation__item, --active, --notification, --disabled, --locked
Sidebar content bbb-sidebar-content, bbb-sidebar-content--{panel} (chat, userlist, poll, generic-content-sidekick...), bbb-sidebar-content__panel
Panel header (control-header) bbb-panel-header, bbb-panel-header__title
Chat bbb-chat (message area), bbb-chat-form, bbb-chat-form__input
Chat message bbb-chat-message, --own, --system, __name, __time
User list bbb-user-list, bbb-user-list__search, bbb-user-list-item, bbb-user-list-item__name
Button (common/button) bbb-button, bbb-button--{color}, bbb-button--circle, bbb-button__icon (the colored span of circle buttons)
Actions bar bbb-actions-bar, __left, __center, __right, __media-buttons
Microphone / camera bbb-mute-toggle, --muted; bbb-video-toggle, --off
Nav bar bbb-navbar, __left, __center, __right, __bottom, __title
Nav bar items bbb-recording-indicator (--recording), bbb-connection-status-button (--normal, --warning, --danger, --critical, --offline), bbb-leave-button, bbb-options-button
Talking indicator bbb-talking-indicator, bbb-talking-indicator__item, --talking, --muted, --moderator, --you
Presentation bbb-presentation, bbb-presentation__content, bbb-presentation-toolbar, __slide-controls, __zoom-controls
Webcams bbb-webcam, --talking, bbb-webcam__name (with and without the user menu), bbb-webcam__presenter-badge
Others bbb-timer-indicator (--running), bbb-notifications-bar

Closes Issue(s)

Closes #

Motivation

styled-components generates new class names on every build, so anyone customizing the client today has to write selectors such as:

#layout > div:has(> [data-test="navigationSidebarContainer"]) { ... }
[data-test="navigationSidebarContainer"] div[role="button"][aria-expanded="true"] { ... }
#ActionsBar div:has(> [data-test="mediaAreaButton"]) button > span[color="primary"]:first-child { ... }
[data-test="presentationContainer"] > div:nth-child(2) { ... }

These break whenever markup or test ids change, and data-test was never meant to be a styling API. Some states can't be reached at all. For example, the presenter's avatar carries no marker, so a theme plugin has to subscribe to the users list and inject a stylesheet keyed by user id to draw a presenter badge. With this PR, the same rules become:

.bbb-navigation { ... }
.bbb-navigation__item--active { ... }
.bbb-actions-bar__media-buttons .bbb-button--primary > .bbb-button__icon { ... }
.bbb-presentation__content { ... }
.bbb-user-list-item > .bbb-avatar--presenter::after { ... }

A real use case: bbb-plugin-flat-theme

This PR came out of bbb-plugin-flat-theme, a theme plugin for the 4.0 client. It ships pure CSS as a plugin: full-height flat sidebars, round avatars with a moderator crown and a presenter badge, Lucide icons in the icon bar and actions bar, and red mic/camera icons when they are off. Its main branch works on today's client, so it is built on the selectors shown above. Some of its features exist only as workarounds, for example:

  • Presenter badge: the avatar carries no presenter marker, so the plugin subscribes to the users list and injects a <style> with [data-id="<userId>"] selectors for the current presenter.
  • Active icon bar item: found through div[role="button"][aria-expanded="true"].
  • Actions bar colors: read from the color attribute styled-components leaves on a <span>.
  • Webcam name tag: only the variant with a user menu has a data-test, so the one without a menu stayed unstyled.

The bbb-static-classes branch of the plugin is already ported to the classes in this PR and is just waiting for it to be merged. It has been tested against a client built from this branch:

  • data-test selectors go from 108 to 20 (the rest are menu items and inner buttons not covered here), and all :has() and nth-child workarounds on the layout are gone.
  • The plugin no longer needs any JavaScript: the presenter badge becomes .bbb-user-list-item > .bbb-avatar--presenter::after.
  • The CSS reads as what it styles (.bbb-navigation__item--active, .bbb-mute-toggle--muted), so it is much cleaner, and it no longer breaks when markup or test ids change.

As soon as this PR is merged, that branch becomes the plugin's main.

Static classes can also help e2e tests: selectors for these elements and their states could move from data-test variants (webcamItem / webcamItemTalkingUser, muteMicButton / unmuteMicButton) to a single class plus a state modifier. This PR doesn't change any test.

How to test

  1. Build and deploy the client, then join a meeting as a moderator.
  2. In DevTools, check that the classes appear and follow state:
    • the user list avatar has bbb-avatar bbb-avatar--moderator bbb-avatar--presenter bbb-avatar--you; making another user presenter moves --presenter.
    • opening a panel sets bbb-navigation__item--active on its button and bbb-sidebar-content--{panel} on the sidebar.
    • muting and unmuting toggles bbb-mute-toggle--muted; enabling the camera removes bbb-video-toggle--off.
    • a message you send has bbb-chat-message--own, and system messages have --system.
    • starting recording adds bbb-recording-indicator--recording.
  3. Check that the client looks exactly as before. The PR only adds class names and changes no styles.

Quick check from the console:

[...new Set([...document.querySelectorAll('[class*="bbb-"]')]
  .flatMap((e) => [...e.classList].filter((c) => c.startsWith('bbb-'))))].sort()

More

  • 31 files, about +116/−27 lines. Each change adds a className, built with classnames where there is a state.
  • common/control-header now accepts and merges className, so styled wrappers keep working.
  • Not covered: the modal (BBBModal, from @bigbluebutton/bbb-ui-components-react) and the MUI dropdown menus, which already expose stable MuiMenu-* / MuiMenuItem-* classes. The modal would need the classes in that library.
  • ESLint shows no new errors on the changed files, and tsc --noEmit passes.
  • Added/updated documentation (a list of the classes could go to the customization docs, next to customStyleUrl)

Styled-components class names change on every build, so themes, plugins
and custom.css had to target data-test attributes, ids and DOM structure
(:has(), nth-child, span[color]). Key elements now carry stable classes
named bbb-block, bbb-block__element and bbb-block--state.

State modifiers come only from props and state the components already
had: no new queries, subscriptions or hooks. The avatar, for instance,
gets bbb-avatar--moderator, --presenter, --you and --talking from the
props UserAvatar already receives.

Covered: navigation sidebar, sidebar content and panel header, chat
(form and messages), user list, avatar, common Button, actions bar
(mute and camera toggles), nav bar (title, recording, connection
status, leave, talking indicator), presentation and its toolbar,
webcam tiles, timer indicator and notifications bar.

data-test attributes are untouched.
@gustavotrott gustavotrott added this to the Release 4.0 milestone Oct 22, 2026
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 73a80eb6-a2bd-47d4-89d8-f91217c4007e
📥 Commits

Reviewing files that changed from the base of the PR and between 16b4b9a and 012fc66.

📒 Files selected for processing: 31
  • bigbluebutton-html5/imports/ui/components/actions-bar/component.jsx
  • bigbluebutton-html5/imports/ui/components/audio/audio-graphql/audio-controls/input-stream-live-selector/buttons/muteToggle.tsx
  • bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-form/component.tsx
  • bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/component.tsx
  • bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-header/component.tsx
  • bigbluebutton-html5/imports/ui/components/chat/chat-graphql/component.tsx
  • bigbluebutton-html5/imports/ui/components/common/button/component.jsx
  • bigbluebutton-html5/imports/ui/components/common/control-header/component.jsx
  • bigbluebutton-html5/imports/ui/components/connection-status/button/component.jsx
  • bigbluebutton-html5/imports/ui/components/nav-bar/component.jsx
  • bigbluebutton-html5/imports/ui/components/nav-bar/leave-meeting-button/component.jsx
  • bigbluebutton-html5/imports/ui/components/nav-bar/nav-bar-graphql/recording-indicator/component.tsx
  • bigbluebutton-html5/imports/ui/components/nav-bar/nav-bar-graphql/talking-indicator/component.tsx
  • bigbluebutton-html5/imports/ui/components/nav-bar/options-dropdown/component.jsx
  • bigbluebutton-html5/imports/ui/components/notifications-bar/component.jsx
  • bigbluebutton-html5/imports/ui/components/presentation/component.jsx
  • bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/component.jsx
  • bigbluebutton-html5/imports/ui/components/sidebar-content/component.tsx
  • bigbluebutton-html5/imports/ui/components/sidebar-navigation/component.tsx
  • bigbluebutton-html5/imports/ui/components/sidebar-navigation/custom-logo/component.tsx
  • bigbluebutton-html5/imports/ui/components/sidebar-navigation/sidebar-navigation-button/component.tsx
  • bigbluebutton-html5/imports/ui/components/timer/indicator/component.tsx
  • bigbluebutton-html5/imports/ui/components/user-avatar/component.jsx
  • bigbluebutton-html5/imports/ui/components/user-list/component.tsx
  • bigbluebutton-html5/imports/ui/components/user-list/user-list-participants/list-item/component.tsx
  • bigbluebutton-html5/imports/ui/components/user-list/user-list-participants/list-item/user-name-with-subs/component.tsx
  • bigbluebutton-html5/imports/ui/components/user-list/user-search/component.tsx
  • bigbluebutton-html5/imports/ui/components/video-provider/video-button/component.tsx
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsx
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/pin-area/component.tsx
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/user-actions/component.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

Walkthrough

Meeting UI components across controls, navigation, chat, presentation, participant lists, and video now receive CSS classes. Several components also receive conditional modifier classes based on states such as muted, offline, recording, or collapsed. The changes do not alter rendering conditions or child components except where class names depend on existing state.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: arthurk12, tainan404, atilau19

Merge Risk: ⚪ Minimal · up to 012fc

The PR adds static theming hooks while preserving the inspected rendering behavior, with no established functional or availability risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: adding static, prefixed CSS classes to key HTML5 components for theming.
Description check Passed The description is directly related to the changeset. It explains the class naming scheme, covered components, motivation, testing steps, and stated validation results.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 31 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gustavotrott

Copy link
Copy Markdown
Contributor Author

Once it's merged, we can update the automated tests to take advantage of it and remove the data-test attributes from all these UI elements.

@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@antobinary

Copy link
Copy Markdown
Member

and remove the data-test attributes from all these UI elements.

I rely on data-test attributes for various css overrides (mostly hiding element X or Y) on deployments. Maybe I misunderstood but do you really intend on removing the data-test from the source OR remove its reliance inside of some playwright tests?

@gustavotrott

Copy link
Copy Markdown
Contributor Author

and remove the data-test attributes from all these UI elements.

I rely on data-test attributes for various css overrides (mostly hiding element X or Y) on deployments. Maybe I misunderstood but do you really intend on removing the data-test from the source OR remove its reliance inside of some playwright tests?

Indeed, a lot of people might be relying on data-test attributes, and this PR won't touch them at all.

My comment was more of a long-term idea. Ideally, once we have proper CSS classes for these elements, people can start using them instead of data-test, and eventually we could remove those attributes.

For automated tests, we could stop relying on data-test pretty soon. But for removing them from the source, we should first let people know which attributes we plan to remove and which CSS classes they should migrate to.

Then, once we're confident people have had enough time to migrate, we can finally remove them. Maybe in BBB 4.2? lol

@ramonlsouza
ramonlsouza merged commit a334881 into bigbluebutton:v4.0.x-develop Oct 28, 2026
36 checks passed
antobinary added a commit that referenced this pull request Oct 29, 2026
Documents the part of the 4.0.1 delta that landed on v4.0.x-develop
after the first sync (#26290) audited cd89568: cd89568..410727c,
the PRs that go to v4.0.x-release with #26309, plus #25775.

new-features.md
- Other notable changes: "Static CSS classes for custom styles" for the
  bbb-* classes from #26193.
- bbb-web properties changes / Added: tag the maxPresentationsPerRequest,
  insertDocument* and presentationConversion* entries from #25786 with
  "added in BBB 4.0.1", and link the insertDocument entry to its
  customize.md section.
- bbb-apps-akka settings changes: the same tag on the two #25786 entries.

development/api.md, "Updated in 4.0", each item "(added in 4.0.1)"
- create: the maxPresentationsPerRequest cap and documentsDropped
  (#25786), and the recordingmarks and meetingID parameters on the
  meetingEndedURL callback (#26243; 4.0.0 called the URL unchanged).
- insertDocument (new item): the same cap, the per-meeting rate limit
  (rateLimitExceeded), and the messageKey every FAILED response now
  carries (notFound, invalidFilename, presentationDisabled, noDocuments
  are new; the messages are unchanged).

administration/customize.md
- "Static CSS classes for client elements" after the custom-style
  section: the naming scheme, what the classes cover, an example, and
  public.app.customStyleUrl for loading a stylesheet for every user.

Not documented: the fixes (#26215; #26289, which brought its own docs;
#26278, since SVG was already refused on every upload path), the
dependency bumps (#26296 and the dependabot PRs) and the CI changes
(#26190, #26295, #26297, #26307, and #25775, which documents itself in
.github/ci-tested-plugins.md). settings.yml, ApiParams.java,
LockSettingsParams.java, create.tsx and join.tsx are unchanged in the
range, and resources.xml only gains entries, so there is no upgrade
warning to add.
gustavotrott added a commit to gustavotrott/bbb-plugin-flat-theme that referenced this pull request Oct 30, 2026
…ement

The classes landed in 4.0.1 (bigbluebutton/bigbluebutton#26193), so this is
now main. The README asks for 4.0.1 or later and points 4.0.0 servers to the
bbb-4.0.0 branch, which keeps the data-test selectors; the parts about the
presenter badge and the selectors describe the classes. Version 0.4.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dk5p3LePeVSvoN8vYvza8y
antobinary pushed a commit that referenced this pull request Nov 18, 2026
Follow-up to #26193. Adds classes to elements that themes still had to
reach through data-test attributes, ids or the DOM structure:

- bbb-avatar__talking: the avatar layer the client animates while the
  user talks
- bbb-chat-message__bubble, bbb-chat-message__notice, and
  bbb-chat-message__time on the time shown on hover in the bubble's
  corner (follow-up messages and system notices)
- bbb-chat__list, bbb-chat-form__textarea, bbb-chat-form__send,
  bbb-chat-reply-intention
- bbb-user-list-item__toolbar, bbb-crowd-actions (__item, __label)
- bbb-webcam__name-wrapper, bbb-webcam__pin-area

Classes only; no markup, styles, data-test attributes or ids change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants