Disallow reading a component's public CSS var as a value.
A component's public vars are for overriding it: an app sets them, the
component never does. Reading one as a value gives you nothing unless an app has
set it. To use a component's current value, such as an icon's size or a panel's
padding, read resolvedVars, which falls back to the component's own default.
The rule fixes X.vars.y to X.resolvedVars.y when the component has that
resolved var. When it doesn't, set the value you need directly.
The rule looks at the vars of the style exports imported from
@customerio/pluma-components/css/components, including renamed imports
(PlumaIcon as PlumaIconCss), namespace imports, aliases such as
const iconVars = PlumaIcon.vars, and paths in Ember templates.
A var is allowed where the code uses its name:
{ [PlumaIcon.vars.size]: '20px' } in
style, vars, assignInlineVars or a style prop, and styles[PlumaIcon.vars.size] = '20px';getVarName;PlumaIcon.vars.size.slice(4, -1).Every other use is reported, including a property value, a template literal, a
calc or fallbackVar argument, and an Ember template. A const that holds a
var is reported where it's declared when any of its uses is a value. An exported
const is reported with a suggestion in place of a fix, because another file may
use it to set the var.
A var inside fallbackVar(...) is not fixed automatically. The rule suggests
replacing the whole call with the resolved var, which uses the component's
default in place of yours.