Skip to content

[css-align] Add percentage values for alignment #9556

Open
@fantasai

Description

@fantasai

As @annevk and I were looking into styling of switch and range controls, it became obvious that it would be useful to be able to position things partway between start and end. So opening this issue to add <percentage> values to align-self and justify-self (and maybe also align-content and justify-content, although I'm less convinced that's necessary). These would interpolate between 0% = start and 100% = end, just like for background-position.

Open questions:

  • Do we want to allow keywords to combine with percentages, to allow interpolation along the various directional axes besides start/end?
  • Do we want to allow values outside of the 0-100% range (which has pretty weird results in some cases, but might be useful) or clamp to that range?

(This has been on my "potential extensions to alignment" list for awhile, but now there's an obvious use case, so filing it for consideration...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Agenda+ LaterLower-priority items that are flagged for CSSWG discussioncss-align-4

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions