Styling and inspection
Declare styling to apply validated selector rules and inspection to receive sanitized element events. Fluxer-specific selectors belong in the plugin and may need updating when Fluxer changes.
Apply and remove styles
Section titled “Apply and remove styles”cleanup.push( await api.styling.apply([ { selector: '[data-flx="your.public.marker"]', declarations: { outline: "1px solid #b980ff", "outline-offset": "-1px" }, }, ]),);Replace the illustrative marker with the actual public surface your plugin targets. Rules remain selector-based across rerenders. The returned disposer removes the rule.
Allowed properties are outline, outline-offset, border, border-color, border-radius, color, background-color, opacity, font-size, and font-weight. Values must pass browser validation. URLs, imports, executable expressions, and custom properties are rejected. Each call takes 1 to 32 rules. Selectors are at most 500 characters and may not use :has, :visited, :host, :root or pseudo-elements; values are at most 200 characters and are applied with !important.
FluxPlugs’ privileged surfaces and their ancestors/descendants are excluded from styling.
Inspect elements
Section titled “Inspect elements”cleanup.push( await api.inspection.subscribe((event) => { if (event.kind === "click") { api.logger.debug("Inspected element", { tag: event.tag, role: event.role, }); } }, false),);Events provide kind, sanitized tag/id/classes/role/dataFlx, and geometry. The element’s own text is included only when the plugin also holds message_content; otherwise text is an empty string. They do not expose HTML, DOM references, input values, or privileged surfaces.
Passing true as the second argument synchronously cancels inspected clicks. Use it only while an explicit inspection mode is active. Dispose the subscription when leaving that mode, not just on plugin shutdown.
Outlines demonstrates a plugin-owned inspector, and declares message_content so it can show the text. Avoid logging inspected text, which can contain private conversation content.
FluxPlugs is an independent project, not affiliated with or endorsed by Fluxer.