Skip to main content

splent_feature_theme

The public shell of a SPLENT product (public_base.html), the design tokens it is drawn with, a library of composable blocks, and the Appearance and Menus editors of the admin panel.

The theme never hardcodes a product name, palette or font. The product gives its identity through configuration, and its palette through THEME_TOKENS or a skin feature; the admin panel can change both at runtime. What this feature provides and requires is listed in the [tool.splent.contract] section of pyproject.toml, which splent feature:contract --write keeps in sync with the source.

Menu entries

The editors register two entries in the Administration section of the application shell's menu registry. Neither names roles: each takes the ones its screen asks for (routes.PANEL_ROLES, administrators), so nobody is offered a door that answers 403.

Key Label Order Icon Opens
theme_appearance Appearance 40 sliders theme.admin_appearance
theme_menus Menus 50 menu theme.admin_menus

A product hides or reorders them by key in [tool.splent.layout.menu].

# the product's pyproject.toml
[tool.splent.layout.menu]
hide = ["theme_menus"]

The layout.authenticated_sidebar hooks that drew the same two entries stay for one minor, for the shells that still render slots. A shell draws the registry or the slots, never both.

Configuration

Declared in [tool.splent.config]. A product overrides them in its own [tool.splent.config]. The Appearance editor wins over all of them where it has a field for the value.

Key Default What it does
SITE_NAME the package name What the site calls itself in the header, the browser tab and the footer.
SITE_TAGLINE empty The line under the name.
SITE_LOGO empty The header logo, a path inside the product's static folder. Empty draws no logo.
SITE_BRAND_MODE both How the header brand renders: logo, text or both.
SITE_LOGO_SIZE 40 The logo height in pixels.
SITE_BREADCRUMBS deep Where the automatic breadcrumb trail appears: deep, all or off.
THEME_TOKENS the theme's defaults The palette and fonts, a JSON object of token name to CSS value.

THEME_TOKENS takes the names of DEFAULT_TOKENS in tokens.py and goes over them, so a product writes only what it changes. An empty font_url loads no web font, and the fonts named in font_body, font_heading and font_display then come from the reader's system.

# the product's pyproject.toml
[tool.splent.config]
SITE_NAME = "uvlhub"
SITE_LOGO = "media/logos/default.svg"
SITE_BRAND_MODE = "logo"
THEME_TOKENS = '{"primary": "#287FB9", "font_url": "", "font_body": "system-ui, sans-serif"}'

A THEME_TOKENS that is not valid JSON, is not an object, names a token the theme does not have or gives one a value that is not a string stops the boot with a message that says which. A skin that sets THEME_TOKENS in its init_feature replaces the product's whole.

Use it in a product

splent feature:add splent_feature_theme

Develop

splent feature:test splent_feature_theme
splent feature:contract splent_feature_theme

Metadata

Release files for splent-feature-theme 0.14.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 splent-feature-theme 0.14.0
File Size Uploaded Provenance
splent_feature_theme-0.14.0.tar.gz 66.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for splent-feature-theme 0.14.0
File Interpreter ABI Platform
splent_feature_theme-0.14.0-py3-none-any.whl Python 3 none any Details

Total release size: 144.3 kB

Release files / splent_feature_theme-0.14.0.tar.gz

Download URL splent_feature_theme-0.14.0.tar.gz
Size 66.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e900dc7a2ef3dd44de51eaad1bc795abf5eed5b94a1e79a5ac68b561136360df
BLAKE2b-256 checksum
How to use checksums
a7221f5523db0b1ac7f374b5247a466cc0c38bf639db896cf2e083d7c406d6e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.16

Release files / splent_feature_theme-0.14.0-py3-none-any.whl

Download URL splent_feature_theme-0.14.0-py3-none-any.whl
Size 77.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d27622c3ba7df31e2cd5e2aace32c88611602abec477ada9037980f24a67de18
BLAKE2b-256 checksum
How to use checksums
c97011385686f3b436fb8ee65e36c5b7ecf7d36eba72f507668288fd142865f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.16

Security for splent-feature-theme 0.14.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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