Join the Webstudio community

Updated last year

Reject multiple IDs

At a glance
Within the property settings, you can add IDs that are the same wherever you like.

With your token system, you can only add the token name once. Could that be mimicked on the ID section so a user couldn't duplicate them?
A
J
4 comments
Hey Jeremy, thanks for the suggestion πŸ”₯!

Tokens are like this because they are tied to other things (like styles), as to ID's aren't.

But maybe I'm misunderstanding the goal here.

Why do you want to prevent a user from duplicating IDs?
Simply because the IDs should be unique. πŸ™‚

The first sentence in the Mozilla docs. https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
Thanks J.

I understand why to have them be unique (especially for anchor links) though I personally also find it useful to be able to add multiple instances of the same ID. Sometimes I like to target multiple elements in my scripts by ID and just use the same over over and over.

Though might not be best practice. 🀷

I'm sure the product team will have more insights on this when they start their day.
haha yep, not the best practice. But at least you own it. πŸ˜‰

I could see this being somewhat of a pain to implement for the dev team.
Add a reply
Sign up and join the conversation on Discord