Re: [css-houdini-drafts] [css-properties-values-api] Make all the descriptors optional (#994)

Well, I disagree that making the syntax more verbose _to force authors think_ is a good idea.

If the intent was for authors to use non-inherited variables more — the default should have been `false` then (I personally would be all for it). Though, I guess, this is one thing that could potentially backfire: I imagine most authors would want to use property registration for transitions after they would already have some code, which could depend on inheritance. But, yes, I don't see anything bad in having a positive value for default, and explicitly disabling inheritance when needed.

But making authors write more when there is no real need is just an invitation for someone to come-up with shortcuts and extra build/runtime JS that would just do this. Add to this the possibility of a human error, where a typo in a “required, but not needed” part would end in everything not working. And — what are other places in CSS where there are _required declarations_ like that?

Overall, I strongly do not like the idea of guiding authors as if they were blind puppies — especially for this kinds of advanced features. It is awesome that we have them, but sometimes the “good intentions” can make the feature much harder to use than it should have been. We need to have more faith in developers, and if we want to enforce good practices, it is the tools like browsers and code editors that could be used. Browsers could add profiling for the CSS variables performance and suggest not inheriting them (maybe it could be also detected automatically — if the inheritance is never used for a certain custom property, for example).

But maiming the syntax just so developers “would know better”? 

-- 
GitHub Notification of comment by kizu
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/994#issuecomment-664815967 using your GitHub account

Received on Tuesday, 28 July 2020 06:58:09 UTC