Open jviereck opened 9 years ago
As always, if you have any questions or want me to explain details in more depth, please let me know.
Aka, if you want, I am happy to write up more about the composer idea and turn it into a blog post :)
Two small changes that I've just pushed:
:BASE:
to !BASE
: This is much easier to read (because there are no two colons at the end of the JSON definition):INHERIT-PARENT:
). This is as this feature complicates the design and for now I want to focus on a simple solution that is easier to prototype first.
Just pushed a few more changes. These changes move the code further away from
react-style
. I tried to come up with a good way to solve the problem of extending existing styles like inand ended up introducing what I call "composer" functions, such that the above becomes now:
The points 3) onwards in the README.md should hopefully give you and idea about the changes and the last point 7) covers the idea behind the composer functions.
The idea about composer functions is highly inspired by the blog post Mixins Are Dead. Long Live Composition, which talks about the trend in React to move away from mixins and towards composition, and the linearization concept in type systems like Scala. In fact, many of the latest changes came to my mind when thinking about extending CSS classes as a problem in other object oriented programming languages.
As always, if you have any questions or want me to explain details in more depth, please let me know.
Do you think the idea about the "composer functions" is too far fetched or do you think they actually make sense? I personally like the idea very much but I am not sure if my love for type systems makes me biased here.