feat: Token lock#5678
Conversation
Add a persisted locked flag for token style sources and expose lock/unlock in the style source menu. When a token is locked, prevent style edits across the style panel. Keep token management actions like rename, duplicate, detach, and delete available. Show a lock icon on locked tokens.
|
🚀 Deployed! 📍 Preview: https://pr-5678.development.webstudio.is Note: Adding new commits will remove the |
remove the computed nanostore and instead derive lock state locally using isStyleSourceLocked() utility with $selectedStyleSource where needed
|
@kof refactored components to used a disabled property when the token is locked |
|
🚀 Deployed! 📍 Preview: https://pr-5678.development.webstudio.is Note: Adding new commits will remove the |
|
Seems like the lock icon comes from somewheree else, its not the lucid one |
the icon was pulled from the webstudio figma library. can replace it with lucid one
updating the icon should make the proportions more reasonable |
|
We have a new one, |
|
the icon <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.66667 7.33334V4.66668C4.66667 3.78262 5.01786 2.93478 5.64298 2.30965C6.2681 1.68453 7.11594 1.33334 8 1.33334C8.88406 1.33334 9.7319 1.68453 10.357 2.30965C10.9821 2.93478 11.3333 3.78262 11.3333 4.66668V7.33334M3.33333 7.33334H12.6667C13.403 7.33334 14 7.9303 14 8.66668V13.3333C14 14.0697 13.403 14.6667 12.6667 14.6667H3.33333C2.59695 14.6667 2 14.0697 2 13.3333V8.66668C2 7.9303 2.59695 7.33334 3.33333 7.33334Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
</svg> |
|
Scrub on numeric css value input fields is still working, allowing to change things |
the value resets if the user tries to change it this way, but I agree this should be similar to spacing section where scrub should be disabled as well. missed that one while testing |
|
Here is the review from claude, I haven't really looked into it:
This needs 2. shadow-content.tsx — Redundant
|
|
@kof with the latest commits, the following updates should be in place
|
|
🚀 Deployed! 📍 Preview: https://pr-5678.development.webstudio.is Note: Adding new commits will remove the |
|
I think this is ready! |
|
Another thing I was just wondering if it will be practical to have a single place to find/lock all tokens in some way. Usually you would want to lock the design system for example, but doing it one by one is a lot of work. If I could lock all tokens on that page this would be potentially solving it. Since people usually have design systems on a separate page. Separate PR though. |
|
Merged! Great work! |


Description
This feature is related to #5103. This adds lock/unlock support for token style sources and prevents editing locked tokens from the style panel, including keyboard-focus paths, while keeping token management actions available.
Lock option in token:

Lock icon for token with properties viewable but not editable:

Unlock option for locked token:

Steps for reproduction
Lock token.Code Review
Before requesting a review
Before merging
.envfile