Skip to content

[css-anchor-position-1] How to style anchor based on anchored's chosen fallback? #13534

@lukewarlow

Description

@lukewarlow

I have the following select element:

Image

I can easily style it such that the picker has a flat top edge, and that the select has a flat bottom edge. BUT if the select then renders such that the picker uses a fallback position where it's above the select, these styles now long weird.

Image

I believe that using the @container anchored(fallback: ...) we can change the styles of the picker (or a wrapper child within the picker I guess). I don't think there's any such mechanism to style the select itself based on the pickers location though?

I realise this might just not be possible with CSS due to cycles but thought I'd raise the use case.

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