CSS transitions should allow binary styles to be changed

It would be nice to be able to do this:

#menuToggle input~#menu {
     /* Hide menu */
     display: none;
     transition: display 0ms 0.5s;
}
#menuToggle input:checked~#menu {
     /* Display menu */
     display: unset;
     transition: display 0ms 0ms;
}

A major thing CSS transitions are lacking right now is the ability to 
transition "binary" properties such as display, where there is no 
clear way to gradually transition them.  However, this doesn't mean it 
wouldn't be useful to be able to simply delay their being changed. 
Being able to slide a pure CSS menu off the page, for example, is 
currently supported, but it then needs to be set to display:none to 
take it out of the document flow.  When this is specified as a 
transition, the transition should simply do nothing until the delay 
has passed and then transition instantly.

-- 
Best regards,
Jeremy Morton (Jez)

Received on Saturday, 24 September 2022 12:05:58 UTC