Skip to content

[6.x] Make read-only fields easier to spot - #15663

Merged
jaygeorge merged 9 commits into
6.xfrom
15663-read-only-field-distinction
Oct 16, 2026
Merged

jaygeorge merged 9 commits into
6.xfrom
15663-read-only-field-distinction

Conversation

@jaygeorge

@jaygeorge jaygeorge commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Description of the Problem

Closes #15650

In v5, read-only fields were greyed out and had a "Read Only" note next to the label. In v6 they only get a dashed border, which is easy to miss, and clients have been saying they can't tell which fields they're able to edit.

What this PR Does

Fields configured as read only (visibility: read_only, visibility: computed or read_only: true) now get:

  • a small padlock and "Read Only" note after the label
  • a greyed-out label
  • a grey background in light mode, and dimmer text in dark mode (dark backgrounds stay as they are)

This covers text, textarea, select, date, checkboxes, code, Bard, list, array, colour, entries and assets.

Fields that are read only for other reasons (no permission to edit, another user editing, or synced from the origin site) keep the plain dashed border. They aren't explicitly read only, and on a translated entry most fields would end up with a note.

Why only inside fields

The obvious alternative is to grey out every read-only control. But read-only inputs are also used for things you're meant to copy, like the copy to clipboard modal, the updater command and the 2FA secret, and grey makes those look disabled.

So Field now sets data-ui-field-read-only, and a new read-only-field: Tailwind variant only applies the styles inside it. Each component still styles itself, the same way v6 already handles the dashed border, so addons using @statamic/cms/ui get it too.

Before / After

Before After
Light image image
Dark image image

How to Reproduce

  1. Add a field with visibility: read_only (or read_only: true) to a blueprint
  2. Open an entry that uses it
  3. Before: just a dashed border. After: greyed out with a "Read Only" note
  4. On a multi-site translation, non-localisable fields still look as they do now

- Input, Textarea, Combobox, the date/time pickers and AutocompleteEditor now grey themselves out when read only, alongside their existing dashed border
- Replaces the publish field's style block, which matched any class containing "border-dashed"
- The publish field keeps the greyed label and padlock note
The :read-only selector also matches disabled inputs and textareas, so limit the grey surface to enabled ones.
- Field marks itself with data-ui-field-read-only, and a new read-only-field variant styles controls inside it
- Read-only inputs elsewhere (e.g. the updater command, copy to clipboard) look as they did before
- Read-only selects now lose their shadow too
Fields that are read only because of permissions, locks or syncing with their origin keep the plain v6 read only style.
The greyed label had no dark colour, so it was dimmer than the "Read Only" note beside it.
- Code, Bard, List, Array, Color, Entries and Assets now get the same grey surface as other read-only fields
- Table cells and CodeMirror set their own backgrounds, so those are overridden inside read-only fields
- Read-only inputs also lose the dark inset shadow
Dark mode only dims the text now; backgrounds and shadows match 6.x.
@jaygeorge
jaygeorge merged commit 83ee313 into 6.x Oct 16, 2026
66 checks passed
@jaygeorge
jaygeorge deleted the 15663-read-only-field-distinction branch October 16, 2026 18:02
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.

Read only field dashed border is not visually distinctive enough

1 participant