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

Let 2.9.0 fading commands work without a selector #208

Closed bob2517 closed 2 years ago

bob2517 commented 2 years ago

I ran into this myself the other day. I forgot that you needed to add a selector to fade-in and I thought it was busted.

Solution: allow fade-in, fade-to and fade-out to work on the target selector if no selector specified. Will add this in for 2.9.0 as it shouldn't take very long.

bob2517 commented 2 years ago

Makes me wonder if there are other action commands that could do with having a selector added to expand the syntax. Will look at this later though.

bob2517 commented 2 years ago

This is functional offline. Just a couple of error checks to put in place and that should be that.

bob2517 commented 2 years ago

This is done offline. It means you'll be able to do this when it goes live (assuming the img was pre-rendered with display set to none, or opacity at 0:

img:draw {
    fade-in: 1s inline-block;
}
bob2517 commented 2 years ago

It is now officially a thing of beauty. Hopefully I've covered all scenarios now.

bob2517 commented 2 years ago

Will work with any display option, like table-cell or whatever. Eg.

img:draw {
    fade-in: 1s table-cell;
}
bob2517 commented 2 years ago

Closing in preparation for release.