Skip to content

UICssDocument & CSS Support Reference ​

UICssDocument wraps an RmlUi 6.4 HTML/CSS document and renders it onto Blender's GPU. Inside a blendcss.Panel, access the mounted document via self.doc.

DOM & Event Methods ​

MethodSignatureDescription
doc[elem_id] / doc.elel(elem_id: str) -> ElementHandleReturns a live ElementHandle proxy for elem_id.
doc.get_element_by_idget_element_by_id(elem_id: str)Returns the raw RmlUi element wrapper, or None.
doc.onon(elem_id: str, event_type: str, callback) -> boolAttaches an event listener (supports 0-arg or 1-arg callbacks).
doc.set_text / doc.get_textset_text(elem_id, text) / get_text(elem_id, default="")Sets or gets escaped plain text (dirty-checked).
doc.set_html / doc.get_htmlset_html(elem_id, html) / get_html(elem_id, default="")Sets or gets inner HTML/RML markup with px → dp preprocessing.
doc.set_styleset_style(elem_id, prop=None, value=None, **styles)Sets inline CSS properties (accepts (prop, val), a dict, or kwargs).
doc.set_attr / doc.get_attrset_attr(elem_id, name, value) / get_attr(elem_id, name, default="")Sets or reads an HTML attribute.
doc.set_classset_class(elem_id, class_name, activate: bool)Activates or removes a CSS class (dirty-checked).
doc.add_class / doc.remove_classadd_class(elem_id, name) / remove_class(elem_id, name)Adds or removes a CSS class.
doc.toggle_class / doc.is_class_settoggle_class(elem_id, name) -> bool / is_class_set(elem_id, name) -> boolToggles or queries a CSS class.
doc.set_visible / doc.show / doc.hideset_visible(elem_id, visible, display=None)Shows or hides an element while remembering its previous display mode.

Document Lifecycle, Theme & Images ​

MethodSignatureDescription
doc.load_contentload_content(rml="", rml_file=None, css="", css_file=None, base_dir=None, html=None, html_file=None)Loads or reloads HTML/RML and CSS content.
doc.sync_bindingssync_bindings()Synchronizes all registered numeric, toggle, choice, text, and operator bindings.
doc.unbind_allunbind_all()Clears all registered bindings on the document.
doc.sync_themesync_theme(force: bool = False)Syncs Blender's live --bl-* CSS custom properties and Dark/Light rules.
doc.set_theme_overrideset_theme_override(overrides: dict = None)Overrides specific --bl-* variables (pass None to clear).
doc.register_imageregister_image(name, source, width=None, height=None, flip_y=None, premultiply=True) -> strRegisters or updates an in-memory image (bpy.types.Image, NumPy array, or RGBA bytes) and returns "blendcss://...".
doc.unregister_imageunregister_image(name: str)Releases a registered in-memory GPU image.
doc.tag_updatetag_update()Marks the document for layout recomputation and redraw.
doc.destroydestroy()Releases RmlUi context, document, and offscreen GPU buffer.

Supported CSS Features ​

Layout & Box Model ​

  • Flexbox: display: flex, flex-direction, flex-wrap, justify-content, align-items, align-self, gap, flex, flex-grow, flex-shrink
  • Box Model: width, height, min-width, max-width, min-height, max-height, margin, padding, box-sizing: border-box, overflow: hidden
  • Positioning: position: relative | absolute, top, right, bottom, left, z-index

Visuals & GPU Shaders ​

  • Colors & Variables: Hex (#rgb, #rrggbb, #rrggbbaa), rgb(), rgba(r, g, b, 0..255), CSS custom properties (var(--bl-*))
  • Borders & Corners: border: 1px #color, border-top/right/bottom/left, border-radius (with rounded overflow: hidden clipping)
  • Gradients: linear-gradient(...), radial-gradient(...), conic-gradient(...), and repeating-* variants
  • Effects: box-shadow, backdrop-filter: blur(...), opacity, text-shadow

Typography & Icons ​

  • Fonts: font-family, font-size, font-weight (100–900 or keywords like medium, semibold, bold), font-style, letter-spacing, line-height, text-align, text-overflow: ellipsis, @font-face
  • SVGs: image-color for tinting normalized inline <svg> icons

Supported CSS Cursors ​

CSS cursor valueBlender cursor
auto, defaultDefault
pointer, handHAND_POINT
grab / grabbingHAND / HAND_CLOSED
text, vertical-textTEXT
ew-resize, col-resize, e-resize, w-resizeSCROLL_X
ns-resize, row-resize, n-resize, s-resizeSCROLL_Y
move, all-scroll, nesw-resize, nwse-resizeSCROLL_XY
crosshair / cellCROSSHAIR / CROSS
wait, progressWAIT
not-allowed, no-dropSTOP
copyCOPY
zoom-in / zoom-outZOOM_IN / ZOOM_OUT
noneNONE

Released under the GNU GPL v3.0 License.