sdxc

Type to search, or start from one of these:

[ @sdxc/ui/styles ]

rtlAwareGradientDirection

The custom-property declarations behind a linear-gradient direction that a rangeable gradient track shares with its own &:dir(rtl) mirror.

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

Usage

Composes the custom property pairing a gradient direction's "right" default with its "left" mirror under &:dir(rtl), ready to compose alongside a host's own remaining, genuinely local declarations.

Signature

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

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

Parameters

ParameterTypeDescription
propertyNamestringThe custom property the gradient direction reads from.

Examples

<div
	mix={[
		rtlAwareGradientDirection("--ui-color-slider-track-direction"),
		css({ ...ownStyles }),
	]}
/>;

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