Skip to content

New admin styles are affecting styling of some components #75855

Closed

Description

@t-hamano

As part of a visual refresh of the admin screens, there have been significant changes to the styling of form elements.

https://core.trac.wordpress.org/changeset/61645

These changes appear to have affected some component styles.

For example, the two issues I've identified so far are: We probably need a style to override the core form styles.

cc @WordPress/gutenberg-components @fabiankaegy

FormTokenField

The height is greater than 40px, which is affected by the new line-height value.

Image

SelectControl

The text is misaligned when the size prop is small. This is affected by the new line-height value.

Image

Activity

  1. changed the title [-]New admin style has influenced style of some components.[/-] [+]New admin style has influenced style of some components[/+] on Feb 24, 2026
  2. changed the title [-]New admin style has influenced style of some components[/-] [+]New admin styles are affecting styling of some components[/+] on Feb 24, 2026
  3. mirka commented on Feb 24, 2026

    @mirka
    Member

    Also confirmed in Storybook by using the global style injector:

    Global style injector in Storybook

    I guess I'll keep this my default setting for a while, to increase the chances of catching other issues.

  4. ciampo commented on Feb 24, 2026

    @ciampo
    Contributor

    Given this is quite high-priority as a 7.0 bug fix, should we establish who's going to work on a fix?

  5. aduth commented on Feb 24, 2026

    @aduth
    Member

    It'd be good to get a better understanding of the full scope of potential impact of the change. Since the change seems to be motivated by alignment with many of these components, that would hopefully mitigate some divergence. I'd be curious if @fabiankaegy might be able to weigh in on potential impact, as the author of the original changes.

    In my local investigation, my initial impression is that it may be limited to line-height, and specifically to SelectControl and FormTokenControl. I was also concerned about the min-height and padding changes, but AFAICT the components that would be impacted define their own styles which would supersede those on the bare element selector styles.

    This also seems to reaffirm some past discussion about components being responsible for defining their own typographical styles to be more resilient to outside influence like this. It seems like FormTokenField and SelectControl would already be prone to this, since the line-height already existed in these form styles (and inherited into the component styles), just that the value was changed.

  6. t-hamano commented on Feb 24, 2026

    @t-hamano
    ContributorAuthor

    In my local investigation, my initial impression is that it may be limited to line-height, and specifically to SelectControl and FormTokenControl.

    I'm having the same result. I've tested the entire component, and so fa,r those two seem to be the only issues we need to fix.

  7. ciampo commented on Feb 24, 2026

    @ciampo
    Contributor

    Cool, so it seems like a relatively localized fix, and one that we would apply regardless of this specific report

  8. self-assigned this
    on Feb 24, 2026
  9. moved this from 📥 Todo to 🏗️ In Progress in WordPress 7.0 Editor Taskson Feb 25, 2026
  10. mirka commented on Feb 25, 2026

    @mirka
    Member

    Unfortunately I'm seeing a lot of breakage (not necessarily due to the recent changes) in @wordpress/ui components due to the common and form stylesheets. It's unfortunate that we not only have to continue working with these wildly overscoped styles being loaded everywhere, but that we are going to continue changing them, which can alter all our UIs (not just first-party component libraries) in unexpected ways. This is not very sustainable.

    Aside from making hot fixes on the @wordpress/components side for 7.0, I wonder if we can add an opt-out scope to these common/form stylesheets? For example:

    :where(:not([data-no-forms-css])) {
      /* The current content of forms.css */
    }

    Otherwise, placing them in an @layer may also mitigate specificity issues.

    Without either of these, it's going to be a nightmare to counteract within @wordpress/ui (mostly because we are placing styles in @layers — these will always lose to the unlayered styles in common/forms.css).

  11. ciampo commented on Feb 25, 2026

    @ciampo
    Contributor

    @mirka that could work, it's non-invasive for existing code, and it allows us to easily opt out.

    Still, I believe we should add as many styles as possible to our components to reduce the risk that they render differently dependending on the CSS environment surrounding them

  12. moved this from 🏗️ In Progress to ✅ Done in WordPress 7.0 Editor Taskson Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Package] Components/packages/components[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions