Skip to content

[6.x] Table and lightswitch styling fixes - #19766

Merged
brandonkelly merged 3 commits into
6.xfrom
table-styles
Oct 1, 2026
Merged

brandonkelly merged 3 commits into
6.xfrom
table-styles

Conversation

@brandonkelly

@brandonkelly brandonkelly commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Description

Styling fixes for control panel tables and lightswitches. Follows up on #19765.

Tables

  • AdminTable’s inline padding is now opt-in via an admin-table--padded class, which the full-width admin tables (sections, sites, fields, entry types, workflows, user groups, volumes, image transforms and transformers, and GraphQL schemas and tokens) now use. Tables that sit within a container or pane are no longer padded a second time.
  • .cp-table cells get block padding, row borders only appear between rows, and cells containing a lightswitch keep their padding.
  • Editable tables’ header cells (e.g. a Table field’s “Columns” setting) are no longer centered. They now inherit the table’s alignment rather than the browser’s default for <th>.
  • Editable tables’ header cells and .select-cell cells now share the inputs’ inline padding, so headings line up with the values and dropdowns below them.
  • DataTable header cells with text-center now actually center their content, and the space before the sort icon is only rendered for sortable columns, so it no longer pushes non-sortable headers off-center.
  • The section site settings table’s Homepage column header is centered over its checkboxes.

Lightswitches

  • craft-switch adds a form-field__group-two--switch class to its control group, which lays it out as a flex column, so it’s only as tall as the switch rather than the height of an empty text line (23px for a 16px switch).
  • craft-switch-button’s track no longer has a -1px inline margin, and the thumb offsets that compensated for it are gone. The indeterminate thumb, which sat 2px off-center, is now centered.

🤖 Generated with Claude Code

brandonkelly and others added 2 commits September 30, 2026 21:55
- AdminTable's inline padding is now opt-in via `admin-table--padded`, which the full-width admin tables now use
- `.cp-table` cells get block padding and row borders between rows only, and lightswitch cells keep their padding
- Editable tables' header cells inherit the table's alignment instead of the browser's centered `th` default
- DataTable header cells with `text-center` now center their content, and the sort-icon spacer only renders for sortable columns
- The site settings table's Homepage column header is centered
- `craft-switch` adds `form-field__group-two--switch` to its control group, so it's only as tall as the switch
- `craft-switch-button`'s track no longer has a -1px inline margin, and the indeterminate thumb is now centered

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

📚 Storybook previews

@craftcms/ui — open Storybook

Changed components:

resources/js — open Storybook

No changed components detected in this Storybook.

Header cells and `.select-cell` cells now share the inputs' inline padding, via a private `--_input-padding-inline` property.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brandonkelly
brandonkelly merged commit 6c16ead into 6.x Oct 1, 2026
23 checks passed
@brandonkelly
brandonkelly deleted the table-styles branch October 1, 2026 05:14
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.

1 participant