Skip to content

Add CSS ident() function - #4658

Open
nt1m wants to merge 5 commits into
web-platform-dx:mainfrom
nt1m:ident-function
Open

nt1m wants to merge 5 commits into
web-platform-dx:mainfrom
nt1m:ident-function

Conversation

@nt1m

@nt1m nt1m commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #4043

@github-actions github-actions Bot added the feature definition Creating or defining new features or groups of features. label Nov 17, 2026
@ddbeck

ddbeck commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Did you see #4043 before opening this PR? And do you intend to do anything about the non-existent compat data referenced here?

Updated the description of the ident() CSS function for clarity and conciseness.
@nt1m

nt1m commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

The compat data just needed a new BCD release, which I think should have this now. Thanks for pointing out the issue!

@ddbeck ddbeck left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is close to done. A couple little suggestions for the description. Thank you!

Comment thread features/ident-function.yml Outdated
@@ -0,0 +1,6 @@
name: ident()
description: The `ident()` CSS function makes a custom identifier from strings, numbers, or other identifiers. You can use it to create dynamic names for CSS variables, view transitions, animations, and others.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple little ideas here:

  • Explicitly name the type involved, to incorporate Lea's note from the originating issue
  • Let's use the official name for CSS variables
Suggested change
description: The `ident()` CSS function makes a custom identifier from strings, numbers, or other identifiers. You can use it to create dynamic names for CSS variables, view transitions, animations, and others.
description: The `ident()` CSS function makes a custom `<ident>` from strings, numbers, or other identifiers. You can use it to create dynamic names for custom properties, view transitions, animations, and others.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw Lea's note, but I'm not sure <ident> is super readable to the average developer, it is more spec jargon. I don't feel too strongly so I'm happy to use it though

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the spec jargon is <custom-ident>, not custom <ident>. I suggest using either that or custom identifier.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, though the function itself is named after the exact same spec jargon 😅 But if we want to avoid it, how about "a CSS identifier"?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ddbeck "CSS variables" is perfectly acceptable btw. The spec itself is named css-variables 😅

nt1m and others added 2 commits November 26, 2026 09:12
@nt1m
nt1m requested a review from ddbeck November 26, 2026 19:11
Comment thread features/ident-function.yml Resolved

@LeaVerou LeaVerou left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I submitted a suggestion but generally LGTM!

Co-authored-by: Lea Verou <lea@verou.me>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature definition Creating or defining new features or groups of features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSS ident()

3 participants