Skip to content

Position::Static for non-positioned elements #828

@BrandonDyer-Disney

Description

@BrandonDyer-Disney

What problem does this solve or what need does it fill?

The docs for Position::Absolute state

The offset is computed relative to this item’s closest positioned ancestor, if any.

In CSS terms, an element that ISN'T "positioned" would be position: static, which is the default for elements. Looking at taffy::Position though, I don't see a way to style something as not positioned. There's only Relative and Absolute.

What solution would you like?

Add a Position::Static variant, which would be the new default and have the same duties position: static has in CSS.

What alternative(s) have you considered?

Making Style::inset an Option could also satisfy this, but seems unintuitive.

Additional Context

MDN docs: https://developer.mozilla.org/en-US/docs/Web/CSS/position#static

Notes

Perhaps I missed something? Maybe there is a way to differentiate a positioned element vs non-positioned element that I'm not seeing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions