You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just saw #61 and I like that #15 might be supported.
Do I understand correctly, that #61 might add some kind of runtime css parsing?
I'm not sure if necessary, but I was thinking, maybe some kind of runtime css parsing could help to add some form of "observable" primitiv, so that a css property would be auto-updated, whenever the observable variable changes.
The idea would be, that - maybe similar to a minimal version of styletron , every part of the stylesheet that uses an "observable" is put into a <style> tag that is as minimal as possible and internally, csjs subscribes generated functions to changes of all "observables" to update those <style> tags.
example:
functiono(value){// or something elsevarsubscribers=[]returnfunctionvariable(val){if(typeofval==='function')subscribers.push(val)elseif(val===undefined)returnvalueelse(value=val,subscribers.forEach(fn=>fn(value)))}}varcolor='red'varcolor$=o()color$(function(x){// observe the valueconsole.log('color$ changed to',x)})color$('green')//set the valuecolor$()//get the value - e.g. can be used when initializing cssvarcss=csjs` .title { color: ${color}; background-color: ${color$}; }`color$('blue')// update the value
The text was updated successfully, but these errors were encountered:
I just saw #61 and I like that #15 might be supported.
Do I understand correctly, that #61 might add some kind of runtime css parsing?
I'm not sure if necessary, but I was thinking, maybe some kind of runtime css parsing could help to add some form of "observable" primitiv, so that a css property would be auto-updated, whenever the observable variable changes.
The idea would be, that - maybe similar to a minimal version of
styletron
, every part of the stylesheet that uses an "observable" is put into a<style>
tag that is as minimal as possible and internally,csjs
subscribes generated functions to changes of all "observables" to update those<style>
tags.example:
The text was updated successfully, but these errors were encountered: