cjss-group / CJSS

A CSS based web framework
https://cjss.js.org/
MIT License
670 stars 20 forks source link

Allow data to cascade #23

Open scottkellum opened 5 years ago

scottkellum commented 5 years ago

This might require registering the custom property and using get computed value for each element, then using that as the data. This way data can be set in the parent component container and cascade into all elements in the component.

c-harding commented 5 years ago

How would this merge with the child's data, if present? Would it be a simple override, or element-wise override?

KargJonas commented 5 years ago

I'd do it with a reserved data.props variable, somewhat like react..

scottkellum commented 5 years ago

I was thinking child data would override parent data, but understand that having both parent and child data might be helpful, especially with nested components.

c-harding commented 5 years ago

This involves changing the render order. Basically BFS of every element in the DOM against the list of all selectors, which sounds pretty inefficient