Skip to content

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 ​

VariableDescription
--bl-bgActive N-Panel background color
--bl-bg-headerPanel header background
--bl-bg-subSub-panel / recessed background
--bl-bg-cardElevated card background
--bl-bg-card-topCard gradient top stop
--bl-bg-card-bottomCard gradient bottom stop
--bl-bg-boxBlender box container background
--bl-bg-insetNumber/text input field background
--bl-bg-inset-focusFocused or hovered input field background
--bl-bg-buttonDefault button background
--bl-bg-button-hoverHovered button background
--bl-bg-tabInactive tab background
--bl-bg-tab-activeActive tab background

Text & Borders ​

VariableDescription
--bl-textPrimary panel body text
--bl-text-titlePanel & card title text
--bl-text-widgetButton & widget label text
--bl-text-mutedSecondary / helper text
--bl-borderPrimary widget border
--bl-border-subtleSoft divider and card border
--bl-outlinePanel / editor outline
--bl-shadowTheme-aware shadow color (RGBA hex)

Accents, Status & Geometry ​

VariableDescription
--bl-accentBlender primary selection/accent color
--bl-accent-hoverAccent hover color
--bl-accent-textText color on accent backgrounds
--bl-accent-alphaTranslucent accent color (34% alpha)
--bl-progressProgress bar fill color
--bl-info, --bl-success, --bl-warning, --bl-errorSemantic state colors
--bl-axis-x, --bl-axis-y, --bl-axis-zBlender X / Y / Z axis colors
--bl-radiusWidget corner radius (matches Blender theme roundness)
--bl-radius-panelPanel/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: Returns True when 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 by get_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,
) -> str
  • blendcss.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 .svg files in a folder recursively under stem or prefix/stem; returns the count registered.
  • blendcss.load_svg_file(file_path: str, **kwargs) -> str: Loads (with mtime caching) and normalizes a .svg file from disk.
  • blendcss.normalize_svg(svg_markup: str, **kwargs) -> str: Normalizes raw <svg> markup for RmlUi + LunaSVG and CSS image-color tinting.

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) -> bool
  • blendcss.load_font_bytes(data: bytes, family: str, style="normal", weight="auto", fallback_face=False, face_index=0) -> bool
  • blendcss.load_font_dir(directory: str, family=None, recursive=False, fallback_face=False) -> int
  • blendcss.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, NumPy HxWx3/HxWx4 arrays (uint8 or float32), or raw RGBA8 bytes/bytearray/memoryview (with width and height).
    • Returns the normalized "blendcss://<name>" URI.
  • blendcss.unregister_image(name: str): Removes a registered image from GPU memory.

Released under the GNU GPL v3.0 License.