Skip to content

CSS transitions should allow binary styles to be changed #7804

@jez9999

Description

@jez9999

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions