Skip to content

Confused perspective- and transform-perspective- #5097

@montmorill

Description

@montmorill

UnoCSS version

Describe the bug

So here is the code from preset-mini:

// perspectives
[/^(?:transform-)?perspect(?:ive)?-(.+)$/, ([, s]) => {
  const v = h.bracket.cssvar.px.numberWithUnit(s)
  if (v != null) {
    return {
      '-webkit-perspective': v,
      'perspective': v,
    }
  }
}],

Which means it will treat both perspective- and transform-perspective- to the property perspective instead of the transform function perspective.

For forward compatibility, maybe we can name the real transform function perspective as something like t-perspective for example, IMO. Future discussion are really welcomed.

The same problem maybe also exists in preset-wind4 but I haven't tested.

Reproduction

System Info

No response

Validations

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