You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/ui/packages/consul-ui/app/modifiers/css-prop.mdx

26 lines
749 B

# 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 preview-template
<div
{{css-prop '--token-color-foreground-critical' returns=(set this 'red')}}
>
<code>--token-color-foreground-critical: {{this.red}}</code>
</div>
```
## Positional Arguments
| Argument | Type | Default | Description |
| --- | --- | --- | --- |
| `property` | `string` | | The name of the CSS property to fetch from the element |
| `returns` | `function` | | Usually `set` or `mut` or similar |
## Named Arguments
| Argument | Type | Default | Description |
| --- | --- | --- | --- |
| `returns` | `function` | | See the `returns` positional argument |