[css-houdini-drafts] [css-properties-values-api] named parameters in custom values

brucelawson has just created a new issue for https://github.com/w3c/css-houdini-drafts:

== [css-properties-values-api] named parameters in custom values ==

my chums and I at Wix are working on a pre-processor that extends CSS [1]
and we want to pass named parameters in a custom value, like this:

.root {
   -st-mixin:
       --Theme(
           color1 green,
           color2 red
       )

     display: flex;
  }


 We're somewhat uncomfortable with assigning "color1" with the value
"green" with only a space between them. It feels like we should use some
other assigment marker, such a colon similar to SASS [2]:

 .root {
   -st-mixin:
       --Theme(
           color1:green,
           color2:red
       )

   display: flex;
  }

 or, more weirdly, with an equals sign:

  .root {
   -st-mixin:
       --Theme(
           color1=green,
           color2=red
       )

   display: flex;
  }


We prefer the colon syntax, as it feels more CSS-y, and we're designing our APIs to be as close as possible to CSS, and to adhere to its syntax so that IDEs and code editors don't show  our extensions as errors.

Has something like this been discussed with regards to the CSS Properties
and Values spec (https://drafts.css-houdini.org/css-properties-values-api-1/ -I think this is the spec that's most likely to be the one that would define such syntax), so we can use the same syntax and thereby future-proof our
project?

 Hang loose and stay groovy

 [1] https://stylable.io
 [2] http://vanseodesign.com/css/custom-sass-functions/#keywordarguments

Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/551 using your GitHub account

Received on Saturday, 30 December 2017 10:12:08 UTC