Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-values-5] Invalidation of ident() #11424

Open
bramus opened this issue Dec 31, 2024 · 0 comments
Open

[css-values-5] Invalidation of ident() #11424

bramus opened this issue Dec 31, 2024 · 0 comments

Comments

@bramus
Copy link
Contributor

bramus commented Dec 31, 2024

This is a follow-up to #9141 which introduces ident(). Something that is not defined yet is what should happen when the input for ident() is invalid.

E.g. what happens if you do the following:

@property --length {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

.target {
  --length: 120px;
  anchor-name: ident("--anchor-" var(--length));
}

Because --length is a <length>, ident() can’t generate a valid <custom-ident>. I assume that in this case the declaration should become Invalid At Computed Value Time (IACVT) and the value should be considered to be unset.

Additionally, we might consider adding an extra argument to ident(), to allow a fallback value in case the constructed value is not a valid <custom-ident> – this similar to var().

The definition for ident() would then become the following:

<ident-fn> = ident(<ident-args>, <declaration-value>?);
<ident-args> = [<string> | <integer> | <ident>]+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant