YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

bcc-ui-theme

One look for the Brenden-Colson Center agent fleet's Gradio apps.

A tiny, behaviour-free package: a gr.themes.Base subclass and a stylesheet. Users reach the specialist agents both through the orchestrator and directly, so the apps are one product's surface and should read as one.

import gradio as gr
from bcc_ui_theme import CSS, theme

with gr.Blocks(title="PDAC Subtype Agent") as demo:
    ...

demo.launch(theme=theme(), css=CSS)  # gradio 6.x

The call site is version-dependent

Measured against both pinned versions β€” corrected 2026-09-22, the first version of this table had 6.18 wrong:

gr.Blocks(...) demo.launch(...)
gradio 5.50 accepted (warns: will be deprecated) TypeError β€” launch() declares neither and has no **kwargs
gradio 6.18 accepted (warns: moved to launch()), and served accepted

Blocks() is therefore the one form that works on both majors, and launch() is the 6.x-only one. Neither is silent β€” both warn.

gradio 6.0 deprecated theme/css on Blocks; it did not remove them. Blocks.__init__ stashes the value in _deprecated_theme / _deprecated_css and launch() back-fills it:

css = css if css is not None else self._deprecated_css   # gradio 6.18 blocks.py:2728

Use launch() on 6.x anyway β€” it is the forward path, it drops a warning from every boot, and the shim will not last. That is a maintenance argument, not a correctness one. Do not diagnose this from demo.css / demo.theme: under the constructor form both read None while the stylesheet is on the page. The only sound check is the served page.

What it is

  • theme() β†’ a fresh BCCTheme (a gr.themes.Base subclass). A function, not a singleton: gradio mutates a theme while rendering.
  • CSS β†’ the shared stylesheet, every selector scoped to .gradio-container.
  • FOOTER_CSS β†’ opt-in, separate. Hides the gradio footer. Not part of CSS, because hiding attribution should be each app's deliberate choice.
  • LIGHT / DARK / CONTRACT / contrast_ratio() β†’ the palette and the accessibility contract, exported so consumers can check their own additions.

What it deliberately is not

  • No brand assets. OHSU's marks are not ours to use, and a neutral palette avoids implying an institutional endorsement of an agent's output. A test enforces that no brand string or embedded asset enters the package.
  • No web fonts. The stack is the platform's own UI face, so a Space renders identically offline and makes no third-party request to display an answer. (gradio 5.50's own page template emits a preconnect to fonts.googleapis.com regardless; gradio 6.18 dropped it.)
  • No forced colour scheme. DecoupleRpy_Agent currently injects JavaScript that strips the dark class and rewrites the URL to ?__theme=light, overriding the user's own choice on that one app. This theme renders correctly in both modes, so that JS should be removed rather than ported. A test asserts the stylesheet contains no __theme and no !important.

Accessibility

Every colour pairing the theme renders is checked against WCAG 2.2 in tests/test_contrast.py β€” SC 1.4.3 for text (4.5:1) and SC 1.4.11 for the visual boundary of a form control (3:1). The tokens live in a data module (_palette.py) precisely so the tests can read them, which is what stops a "make it a bit lighter" edit from quietly dropping a label below AA.

Measured, both modes: body text 17.99:1 / 15.56:1, subdued text 6.66:1 / 8.03:1, links 7.07:1 / 8.78:1, primary-button labels 8.54:1 / 9.21:1, control boundaries 3.11:1 / 3.84:1. A visible :focus-visible ring is added because gradio's default is low contrast on both of our backgrounds.

Compatibility

Verified on gradio 5.50.0 (py3.11) and 6.18.0 (py3.13) β€” 46 tests pass on both, plus a real served-page check that the stylesheet is delivered.

The theme uses only Base.set() keywords present in both. 5.50 accepts 262, 6.18 accepts 267, and 5.50's are a strict subset, so 5.50 is the binding constraint; Base.__init__ is identical across the two.

Distribution

Mirrors biodata-registry: consumers pin an immutable HF resolve URL to a wheel, never a git install (HF's git server cannot serve pip's partial clone, so pip install git+https://huggingface.co/... fails on a Space build).

bcc-ui-theme @ https://huggingface.co/anne-voigt/bcc-ui-theme/resolve/<sha>/bcc_ui_theme-<version>-py3-none-any.whl

scripts/release.sh builds the wheel, commits it as a git-LFS file with its own source in one commit, pushes the LFS object before the ref, and prints the pin line. 0.1.0 is released (6a43c17, tag v0.1.0) β€” see docs/ADOPTION.md.

Testing

make test        # against the venv you are in
make test-both   # throwaway venvs on gradio 5.50 and 6.18
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support