Active-CSS / active-css

The epic event-driven browser language for UI with functionality in one-liner CSS. Over 100 incredible CSS commands for DOM manipulation, ajax, reactive variables, single-page application routing, and lots more. Could CSS be the JavaScript framework of the future?
https://activecss.org
Other
42 stars 7 forks source link

New element property reference variable needed #102

Closed bob2517 closed 3 years ago

bob2517 commented 3 years ago

Problem: I'm working on the todoMVC app equivalent in Active CSS and specifically on saving the double-clicked edited field, the attribute value is being substituted into the original label instead of the property which is the up-to-date version of the value attribute referenced by {@value}.

Solution: A new property variable is indicated, so that this can be compared to the original attribute variable if required.

Originally I was thinking of keeping the {@} syntax and that when getting the property that it should take precedence over the attribute, but being able to compare original to new values is a useful concept. It also keeps things backwards compatible.

Syntax: {@@property}, eg: {@@value}

That would be in comparison to the original attribute variable syntax, which is {@attributename}. Property is the dynamic version of the attribute, sort-of, so that should be easy enough to remember for people.

So a possible conditional could be :if-var({@value} {@@value}) to check if the value has changed in the event selector since the original drawing of the element.