sdxc

Type to search, or start from one of these:

[ @sdxc/ui/styles ]

legendToggle

Position-keyed visibility rules pairing a chart root with a later legend.

import { legendToggle } from "@sdxc/ui/styles";

Usage

Composes the categorical legend-toggle visibility rules as a css() mixin covering every CHART_COLOR_SLOT_COUNT color slot. The general sibling combinator requires the legend to follow the chart root.

Signature

legendToggle<Node extends Element = Element>(): MixinDescriptor<
	Node,
	[styles: CSSStyles],
	ElementProps
>

Returns a css() mixin ready for a host element's mix prop.

Examples

<svg
	mix={[
		legendToggle(),
		css({ display: "block", inlineSize: "100%", blockSize: "auto" }),
	]}
>
	{content}
</svg>;

Written by Sergio Xalambrí. Follow @sergiodxa for new packages, or sponsor the work.