linkedin / css-blocks

High performance, maintainable stylesheets.
http://css-blocks.com/
BSD 2-Clause "Simplified" License
6.33k stars 152 forks source link

Add style-of helper for glimmer. #397

Closed chriseppstein closed 4 years ago

chriseppstein commented 4 years ago

There is a new synthetic helper for css-blocks in glimmer and ember applications called style-of.

Original Specification is at: https://github.com/linkedin/css-blocks/issues/383

The parameters and hash arguments to a style-of helper invocation are analyzed as if the helper invocation is an element or component invocation. The arguments to style-of can be dynamic in the same way that attributes can be dynamic.

The return value of the style-of helper is a string that can be set to an html class attribute. This value should be considered opaque. Do not try to manipulate it or depend on the value inside it.

Merging the class names from CSS Blocks with class names from styles not managed by CSS Blocks may result in unexpected behavior, especially with opticss enabled.

Closes #383.