Skip to content

[css-conditional-5] Match scroll-state(scrollable) for root element on viewport #11542

Open
@lilles

Description

@lilles

For the following:

<!DOCTYPE html>
<style>
  @container scroll-state(scrollable: bottom) {
    #target { color: green; }
  }
  :root {
    container-type: scroll-state;
  }
  #target {
    height: 10000px;
  }
</style>
<div id="target">This text should be green</div>

The query will not match unless we match the state of the viewport instead of the root element, since the root element never gets scrollbars.

We should add to the spec that queries that query features of a scroll container should consider the viewport for the root element.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Regular agenda items

    Status

    Regular agenda

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions