wintercms / wn-blocks-plugin

Block based content management plugin for Winter CMS.
MIT License
21 stars 5 forks source link

Improve hierarchical context #16

Closed bennothommo closed 1 year ago

bennothommo commented 1 year ago

I have a scenario where I am creating top-level container blocks, for example, single or double columns, that have a specific theme - let's say either a light, dark, or white theme. As far as I can tell, there's no way for me to populate this "theme" to all blocks, child blocks, grandchild blocks, etc. so I can use differing colours for textual content, buttons, etc.

Ideally, this could be some sort of variable "bag" which can be set at the top most level, and either remain the same or change as it goes down the heirarchy. Each child could potentially add new variables to this bag as it passes down too.

LukeTowers commented 1 year ago

@bennothommo isn't that what the "cascading" part of CSS is for? 😉

bennothommo commented 1 year ago

@LukeTowers sure, but I put this scenario up because it was the easiest to explain. I have scenarios that need variables for condition blocks and things like that - outside of the scope of CSS.

LukeTowers commented 1 year ago

Could you submit your idea as a PR?

bennothommo commented 1 year ago

Not going to go ahead with this, at this stage.