-
Notifications
You must be signed in to change notification settings - Fork 142
Description
I just don't understand why CSS files would be extended from JS files instead of by the CSS files themselves. If the behaviors are defined in CSS files, then there is a natural scope for which the custom behaviors would be defined, puts the behavior closer to where it is used, and makes delivering the stylesheets with their dependencies much easier (via css @import or inline).
Furthermore, when we put code that is essential to the CSS developer's experience in a file of a completely different type, we create a boundary that can feel scary for them to cross. If we put the logic for custom behaviors in CSS we are telling those developers "This is for you. you can do this." which is very empowering.
Lastly, I think it would be great if the scripting ability that is used for extending css was not JavaScript, but actually a scripting language that is designed and allowed to be used throughout the CSS file, but also within the extensible constructs provided by houdini. I'm sure this is a non-starter, but we've seen this approach be very successful in Sass, and the scripting syntax we've developed there would make a good starting point for a CSS-specific script.