sphinx-carbon-theme
A Sphinx theme implementing the IBM Carbon Design System.
# conf.py
html_theme = "carbon"
Design
- Base theme: Sphinx's built-in
basic. Its templates ship with Sphinx itself, so they are the most stable thing a theme can build on.layout.htmlextends it and only replaces the page body;<head>stays Sphinx's. - Chrome: Carbon UI shell web components (
@carbon/web-components:cds-header,cds-side-nav, header actions and panel), bundled with esbuild. Only the components used are imported. - Content:
@carbon/stylescompiled with Sass. Theme tokens are emitted as CSS custom properties for all four Carbon themes (white, g10, g90, g100), so light/dark mode is a class change on<body>. Sphinx's HTML is mapped onto Carbon tokens and type styles; where Carbon component markup fits (search field, breadcrumb, link) the component CSS is used as is. - Fonts and icons: IBM Plex and
@carbon/icons, copied into the theme at build time. Nothing is loaded from a CDN. - Navigation: the Sphinx toctree is rendered as plain nested lists inside
cds-side-nav, so it works at any depth and without JavaScript; JavaScript adds expand/collapse buttons.
Building documentation
Install the released wheel; no Node.js is needed:
pip install sphinx-carbon-theme
Developing the theme
Node.js is needed only to build the theme itself.
npm ci
npm run build # or: npm run watch
uv venv && uv pip install -e . --group test
nox -s docs # build the kitchen-sink demo
nox -s docs_live # live-reloading demo
nox -s tests # tests against several Sphinx versions
The compiled assets (src/sphinx_carbon_theme/theme/carbon/static/ and
partials/icons/) are git-ignored and shipped in the wheel. Building a wheel
runs npm run build through a hatch build hook if they are missing.
CI and releases
.github/workflows/ci.yml builds the sdist and wheel once, tests the wheel
against the oldest supported and current Sphinx releases (and Sphinx main,
non-blocking), and on a v* tag publishes those same files to PyPI.
To release, tag and push; the version comes from the tag:
git tag v0.1.0
git push origin v0.1.0
Publishing uses PyPI trusted publishing, so no API token is stored. One-time setup:
- On PyPI, add a trusted publisher for project
sphinx-carbon-theme(as a "pending publisher" before the first release): ownerimphil, repositorysphinx-carbon-theme, workflowci.yml, environmentpypi. - On GitHub, create the environment
pypi(Settings → Environments). Optionally add yourself as a required reviewer so each upload needs a click.
Dependabot (.github/dependabot.yml) proposes updates to the Carbon packages,
build tools and the pinned actions.
Updating Carbon
Bump the @carbon/* versions in package.json, run npm install && npm run build, then review the kitchen-sink pages in all four themes.
Licence
Apache-2.0. IBM Plex fonts are under the SIL Open Font License
(static/fonts/LICENSE-IBM-Plex.txt).
Metadata
Release files for sphinx-carbon-theme 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sphinx_carbon_theme-0.1.1.tar.gz | 671.5 kB | With provenance | Details for sphinx_carbon_theme-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sphinx_carbon_theme-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for sphinx_carbon_theme-0.1.1-py3-none-any.whl |
Total release size: 1.3 MB
Release files / sphinx_carbon_theme-0.1.1.tar.gz
| Download URL | sphinx_carbon_theme-0.1.1.tar.gz |
|---|---|
| Size | 671.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee84235104bed341f7fa6fac4c009746110b89f141b1480da5e81d0a73ef4730
|
|
BLAKE2b-256 checksum How to use checksums |
3cdff4f4cffa07ce942c456fbbf0a33563f099a4c14743a11c8ea0fd7abb4ec6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.
Transparency logRelease files / sphinx_carbon_theme-0.1.1-py3-none-any.whl
| Download URL | sphinx_carbon_theme-0.1.1-py3-none-any.whl |
|---|---|
| Size | 654.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
043042bd8b7b9890b594b0881199f65312b82346ef9ee90c1bcac330e229fb04
|
|
BLAKE2b-256 checksum How to use checksums |
410a72640bbbfed0126c5447d875f16e4f99ca81c3ba480270958ac73a20ca86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.
Transparency logSecurity for sphinx-carbon-theme 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sphinx_carbon_theme-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.