Skip to main content

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.html extends 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/styles compiled 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:

  1. On PyPI, add a trusted publisher for project sphinx-carbon-theme (as a "pending publisher" before the first release): owner imphil, repository sphinx-carbon-theme, workflow ci.yml, environment pypi.
  2. 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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-carbon-theme 0.1.0
File Size Uploaded Provenance Actions
sphinx_carbon_theme-0.1.0.tar.gz 602.1 kB With provenance Details for sphinx_carbon_theme-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-carbon-theme 0.1.0
File Interpreter ABI Platform Actions
sphinx_carbon_theme-0.1.0-py3-none-any.whl Python 3 none any Details for sphinx_carbon_theme-0.1.0-py3-none-any.whl

Total release size: 1.2 MB

Release files / sphinx_carbon_theme-0.1.0.tar.gz

Download URL sphinx_carbon_theme-0.1.0.tar.gz
Size 602.1 kB
Tags Source
SHA-256 checksum
How to use checksums
902e8dd16042b9144dc65430236efbfc7f0a33ee8cf85d1077de1d210754c3c2
BLAKE2b-256 checksum
How to use checksums
8748e5f18587b5fdb1c490bc6bda3f0d6630fd69e48cc63300bc9a98be8ade6e
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 Nov 22, 2026.

Transparency log

Release files / sphinx_carbon_theme-0.1.0-py3-none-any.whl

Download URL sphinx_carbon_theme-0.1.0-py3-none-any.whl
Size 584.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c2bba6946f5e68fea2f804f147a7b32ba69f4a4419dc4af874671d799f5d8e6
BLAKE2b-256 checksum
How to use checksums
fb0c6483a10761ff4b73d526d4b2262a7a7adac17a8db6ab399525dfd6e3ddcf
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 Nov 22, 2026.

Transparency log

Security for sphinx-carbon-theme 0.1.0

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.

Select from 2 files

Attestation for sphinx_carbon_theme-0.1.0.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 Nov 22, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page