Back to Consul

css-prop

ui/packages/consul-ui/app/modifiers/css-prop.mdx

1.22.7748 B
Original Source

css-prop

Get the value for a single specific CSS Property from the modified element. returns can be specified either as a second parameter or an option.

hbs
<div
  {{css-prop '--token-color-foreground-critical' returns=(set this 'red')}}
>
  <code>--token-color-foreground-critical: {{this.red}}</code>
</div>

Positional Arguments

ArgumentTypeDefaultDescription
propertystringThe name of the CSS property to fetch from the element
returnsfunctionUsually set or mut or similar

Named Arguments

ArgumentTypeDefaultDescription
returnsfunctionSee the returns positional argument