Skip to content

[css-contain-4] Make content-visibility animatable #8627

Closed

Description

@flackr

css-contain Section 4 currently defines the content visibility property to be Animation type: not animatable. Most likely this was done for simplicity since like display it can affect which animations are running. However, as with display where we are better refining the ways in which it is safe to animate (See #6429), we should figure out in which ways content-visibility can be animated.

In particular, just like display it should be possible for an animation to extend the application of content-visibility: visible in order to allow content to stay visible while an animation is completing. This would be useful for elements like <details> whose contents are content-visibility: hidden when closed.

Activity

  1. chrishtr commented on Mar 21, 2023

    @chrishtr
    Contributor

    content-visibility was mentioned here, but we just reailzed it wasn't explicitly covered during the CSSWG agenda on the topic. I don't think it will be at all controversial, so propose an async resolution

  2. flackr commented on Mar 21, 2023

    @flackr
    ContributorAuthor

    My simple proposal would be that auto and hidden are both not allowed by owned animations (e.g. CSS animations), and these two values would be treated as revert, as either of these values could result in a CSS animation no longer running. We would also prefer the visible value in interpolation - consistent with our resolution to avoid none in display interpolations.

  3. astearns commented on Mar 29, 2023

    @astearns
    Member

    @flackr can you put a bit more detail into your proposal? I am not entirely sure how to summarize the above for an async resolution.

  4. flackr commented on Mar 30, 2023

    @flackr
    ContributorAuthor

    The three main points are:

    1. Make content-visibility animateable
    2. Adjust interpolation behavior (similar to display) to avoid the possibly hidden values auto and hidden. Meaning that when interpolating to/from visible the interpolated result for any intermediate progress is visible.
    3. Follow the same pattern as display for ensuring that css animations cannot deactivate themselves. Currently following that pattern would mean treating auto and hidden as revert.
  5. astearns commented on Apr 4, 2023

    @astearns
    Member

    Thanks for explaining further. This seems like a good thing to get in the spec for more review.

    The CSSWG will automatically accept this resolution one week from now if no objections are raised here. Anyone can add an emoji to this comment to express support. If you do not support this resolution, please add a new comment.

    Proposed Resolution: Make content-visibility animateable as above

  6. astearns commented on Apr 11, 2023

    @astearns
    Member

    RESOLVED: Make content-visibility animateable as above

  7. added a commit that references this issue on Apr 19, 2023
    2112e92
  8. added a commit that references this issue on Apr 20, 2023
    64fa7b9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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