Skip to content

[css-variables] support the var() function in @page blocks #3058

@ondras

Description

@ondras

According to the discussion at https://bugs.chromium.org/p/chromium/issues/detail?id=763298, the var() function is not specced to work inside @page at-rule. However, using custom properties inside these blocks might be a reasonable requirement:

:root {
  --margin: 3cm;
  --width: 1024;
  --height: 768;
}

@page {
  margin: var(--margin);
  size: calc(var(--width) * 1px) calc(var(--height) * 1px)
}

Relevant spec: https://drafts.csswg.org/css-variables/#funcdef-var

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