linkedin / css-blocks

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

feat: style-of helper should allow positional arguments to be passed. #395

Closed chriseppstein closed 4 years ago

chriseppstein commented 4 years ago

right now we require the hash style arguments even for things like block:scope which are just set to true. Because helpers can take positional arguments, we can also accept block:scope without a "value" assigned to it.

chriseppstein commented 4 years ago

@abritinthebay We need to fix the code that analyzes and rewrites mustache and sub expressions to look at the params in addition to the argument hash.

I think the only change that's needed is for this code to examine node.params too: https://github.com/linkedin/css-blocks/blob/master/packages/@css-blocks/glimmer/src/ElementAnalyzer.ts#L145

chriseppstein commented 4 years ago

in params, we should allow <namespace>:scope as well as <namespace>:<state-attribute> but <namespace>:class should be an error because that always requires a value.