Skip to content

Converting inset to top, right, bottom, left breaks with custom properties #1570

Closed
@craftedsystems

Description

@craftedsystems

Bug description

If a custom property is used for inset that represents the value for multiple offsets, the converted CSS is broken.

Actual CSS showing the translated custom property value:

p {
  top: 0 1rem 2rem 1rem;
  right: 0 1rem 2rem 1rem;
  bottom: 0 1rem 2rem 1rem;
  left: 0 1rem 2rem 1rem;
}

Source CSS

p {
--offset: 0 1rem 2rem 1rem;
inset: var(--offset);
}

Expected CSS

p {
--offset: 0 1rem 2rem 1rem;
inset: var(--offset);
}

Actual CSS

p {
--offset: 0 1rem 2rem 1rem;
top: var(--offset);
right: var(--offset);
bottom: var(--offset);
left: var(--offset);
}

Playgound example

playground example

Does it happen with npx @csstools/csstools-cli <plugin-name> minimal-example.css?

None

Debug output

No response

Extra config

This is the browserslist we use: ["> 1%", "last 3 versions", "not IE < 12", "not dead"]

What plugin are you experiencing this issue on?

No response

Plugin version

10.1.4

What OS are you experiencing this on?

No response

Node Version

23.7.0

Validations

  • Follow our Code of Conduct
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Would you like to open a PR for this bug?

  • I'm willing to open a PR

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