W3C home > Mailing lists > Public > public-houdini@w3.org > December 2017

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

From: Bruce Lawson <bruce@brucelawson.co.uk>
Date: Mon, 18 Dec 2017 17:06:05 +0200
Message-ID: <CAHm4haiuoj6J9zi0TiG_y96nb51royKAD7uGMF7USptmB1moEw@mail.gmail.com>
To: public-houdini@w3.org
Dear Houdarlings,

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're designing our APIs to be as close as possible to CSS, and to adhere
to its syntax so that devtools don't show errors.

 Has something like this been discussed with regards to the CSS Proprties
and Values spec, 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

-- 
Bruce Lawson
www.brucelawson.co.uk
www.twitter.com/brucel
Received on Monday, 18 December 2017 15:07:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:53:28 UTC