Skip to content

[css-spatial] How does inset-back interact with parent transforms and transform-style #155

Open

Description

@khufu-dev
.page {spatial: page}

.parent {
  transform: rotateY(30deg);
  transform-style: preserve-3d;
}

.child {
  position: relative;
  inset-back: 2cm;
}

In this example, does the child move 2cm along the parent's rotated direction, or towards the user along the original page direction,

And also, if the parent uses transform-style: flat , or opacity: 0.5, should the child keep its independent physical inset-back, or be flattened onto the parent's plane?

Related

Spec: https://webkit.github.io/explainers/css-spatial/

Activity

  1. fantasai commented on Oct 27, 2026

    @fantasai
    Contributor

    It would move along the parent's rotated direction, because transformed elements create new coordinate orientation for the z-axis insets, just like they do for the horizontal and vertical insets.

    transform-style: flat flattens the contents. I'm unsure about opacity.

  2. parthpatelsj commented on Oct 27, 2026

    @parthpatelsj

    Thanks for clarifying how inset-back follows the parent's transformed coordinate system, and how transform-style: flat behaves!

    So, on opacity, trying to understand how spatial css should interact with existing CSS flattening rules.

    CSS Transforms Level 2, §7.1 specifies certain properties (i.e. opacity <1, filter, clip-path, etc.) force used value of transform-style to flat.

    Since Spatial CSS allows spatially positioned descendants to participate in a 3D rendering context independently of preserve-3d, should these grouping properties also flatten their inset-back depth?

    For example, if a parent has opacity: 0.5 and its child has inset-back: 2cm, should the child be flattened onto the parent's plane, or retain its independent physical depth?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions