Overview
Plugins can inject CSS into the document. By default, CSS is scoped to the plugin’s container for safety. Opt-in to global injection when needed.api.injectCSS(pluginId, css, options?)
Inject a<style> element for a plugin.
Signature
Returns:
HTMLStyleElement — the created <style> element
Scoping Behavior
Whenglobal is false (default), CSS is wrapped:
If called again with the same
pluginId, the previous style element is replaced — not duplicated.api.removeCSS(pluginId)
Remove a plugin’s injected styles.Teardown
Always clean up CSS in yourteardown() function: