Skip to main content
Write [data-nameless-widget] as your root selector. At inject time the host rewrites every occurrence to [data-nameless-widget="{bundleId}"], so each bundle’s CSS can only touch its own widget:
The CSS and the renderer are one unit: every class the CSS targets must be emitted by the renderer, and vice versa. Pick one vocabulary (BEM-ish nb-block__element--modifier works well) and keep both assets in sync. If CSS fails to load, the JS asset is not executed and the widget does not render. Still write semantic, labelled markup so the widget survives a styling regression. See Renderer function.