Skip to content

Conversation

@andruud
Copy link
Member

@andruud andruud commented Jun 23, 2025

With @function, it becomes possible to have a "type mismatch" between an "outer" custom property and an "inner" custom property:

@property --x {
  syntax: "auto | red";
  /* ... */
}

@function --f(--x <color>: inherit) {
  result: var(--x);
}

div {
  --x: red;
  --result: --f(); /* => ? */
}

We have to address this somehow, and the obvious way seems to be making 'inherit' behave like "a var(--x) that resolves in the parent stack frame". This is essentially what inherit() does, which already exists in the spec.

With @function, it becomes possible to have a "type mismatch"
between an "outer" custom property and an "inner" custom property:

  @Property --x {
    syntax: "auto | red";
    /* ... */
  }

  @function --f(--x <color>: inherit) {
    result: var(--x);
  }

  div {
    --x: red;
    --f(); /* => ? */
  }

We have to address this somehow, and the obvious way seems to be
making 'inherit' behave like "a var(--x) that resolves in the parent
stack frame". This is essentially what inherit() does, which already
exists in the spec.
@tabatkins tabatkins merged commit f040a65 into w3c:main Jun 23, 2025
1 check passed
@andruud andruud deleted the inherit_function branch June 24, 2025 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants