Theme & Assets Reference
Complete reference for Blender theme synchronization (BlenderTheme, --bl-* CSS custom properties), SVG icon utilities, font loaders, and the blendcss:// live image registry.
Live Theme Variables (--bl-*)
Injected automatically into every UICssDocument when sync_theme = True.
Surfaces & Backgrounds
| Variable | Description |
|---|---|
--bl-bg | Active N-Panel background color |
--bl-bg-header | Panel header background |
--bl-bg-sub | Sub-panel / recessed background |
--bl-bg-card | Elevated card background |
--bl-bg-card-top | Card gradient top stop |
--bl-bg-card-bottom | Card gradient bottom stop |
--bl-bg-box | Blender box container background |
--bl-bg-inset | Number/text input field background |
--bl-bg-inset-focus | Focused or hovered input field background |
--bl-bg-button | Default button background |
--bl-bg-button-hover | Hovered button background |
--bl-bg-tab | Inactive tab background |
--bl-bg-tab-active | Active tab background |
Text & Borders
| Variable | Description |
|---|---|
--bl-text | Primary panel body text |
--bl-text-title | Panel & card title text |
--bl-text-widget | Button & widget label text |
--bl-text-muted | Secondary / helper text |
--bl-border | Primary widget border |
--bl-border-subtle | Soft divider and card border |
--bl-outline | Panel / editor outline |
--bl-shadow | Theme-aware shadow color (RGBA hex) |
Accents, Status & Geometry
| Variable | Description |
|---|---|
--bl-accent | Blender primary selection/accent color |
--bl-accent-hover | Accent hover color |
--bl-accent-text | Text color on accent backgrounds |
--bl-accent-alpha | Translucent accent color (34% alpha) |
--bl-progress | Progress bar fill color |
--bl-info, --bl-success, --bl-warning, --bl-error | Semantic state colors |
--bl-axis-x, --bl-axis-y, --bl-axis-z | Blender X / Y / Z axis colors |
--bl-radius | Widget corner radius (matches Blender theme roundness) |
--bl-radius-panel | Panel/card corner radius |
BlenderTheme class methods
BlenderTheme.read_live_theme() -> dict: Reads live RGBA tuples and radii from Blender 4.x or 5.x.BlenderTheme.is_dark_theme() -> bool: ReturnsTruewhen the active Blender sidebar is dark.BlenderTheme.get_css_vars(use_dp=True, overrides=None) -> dict: Returns the--bl-*variable map.BlenderTheme.get_ui_scale() -> float: Returns Blender's combined UI scale (OS DPI × Resolution Scale).BlenderTheme.scale(val) -> float: Scales a pixel value byget_ui_scale().
SVG Icon Helpers
Built-in icons (blendcss.BUILTIN_ICONS)
camera, check, cube, dots, eye, folder, image, layers, palette, refresh, sliders, sparkles, star, star-outline, sun, zap
Functions
python
blendcss.svg_icon(
name: str, # Built-in name, registered name, or direct .svg path
*,
size=None,
width=None,
height=None,
color=None, # Applied via CSS image-color
css_class="",
elem_id="",
style="",
stroke_width=None,
tintable=True,
) -> strblendcss.register_svg_icon(name: str, svg_markup: str): Registers a custom inline SVG icon globally.blendcss.register_svg_dir(directory: str, prefix: str = "") -> int: Indexes all.svgfiles in a folder recursively understemorprefix/stem; returns the count registered.blendcss.load_svg_file(file_path: str, **kwargs) -> str: Loads (with mtime caching) and normalizes a.svgfile from disk.blendcss.normalize_svg(svg_markup: str, **kwargs) -> str: Normalizes raw<svg>markup for RmlUi + LunaSVG and CSSimage-colortinting.
Font Loading Helpers
Supported formats: .woff2, .ttf, .otf, .ttc.
blendcss.load_font(file_path, fallback_face=False, family=None, style="normal", weight="auto", face_index=0) -> boolblendcss.load_font_bytes(data: bytes, family: str, style="normal", weight="auto", fallback_face=False, face_index=0) -> boolblendcss.load_font_dir(directory: str, family=None, recursive=False, fallback_face=False) -> intblendcss.get_loaded_font_families() -> list[str]blendcss.get_default_ui_font() -> str
Live GPU Image Registry (blendcss://)
blendcss.register_image(name: str, source, width=None, height=None, flip_y=None, premultiply=True) -> str- Accepts
bpy.types.Image, NumPyHxWx3/HxWx4arrays (uint8orfloat32), or raw RGBA8bytes/bytearray/memoryview(withwidthandheight). - Returns the normalized
"blendcss://<name>"URI.
- Accepts
blendcss.unregister_image(name: str): Removes a registered image from GPU memory.