Skip to content

File: Inherit all styles from buttons #52850

Closed

Description

@hanneslsm

Description

The file block uses some styles (background color), but not all from the button (radius, borders).
The button in the file block should look the same as a regular button.

Additionally und unfortunately, since it is not even a real button, it's not possible to select buttons styles, which is a pitty.

Step-by-step reproduction instructions

  1. Change the global styles of a button
  2. Insert a file block with a opinionated styles

Screenshots, screen recording, code snippet

image

Environment info

  • WP 6.2.2
  • GB 16.2.1
  • custom theme

Please confirm that you have searched existing issues in the repo.

No

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Activity

  1. added
    [Type] Bug
    Needs Testing
    [Block] Buttons
    on Jul 26, 2023
  2. added
    [Block] File
    and removed
    Needs Testing
    on Jul 27, 2023
  3. jordesign commented on Aug 2, 2023

    @jordesign
    Contributor

    Confirmed this in testing - the File block button neither uses the Button styles set in global styles, nor has any controls to customize the styling of it.

  4. added
    [Type] Enhancement
    Needs Design Feedback
    and removed
    [Block] Buttons
    [Type] Bug
    on Aug 2, 2023
  5. t-hamano commented on Aug 2, 2023

    @t-hamano
    Contributor

    I believe this issue is also related to #51272. As #51272 suggests, this issue could also be resolved if we could apply styles via global styles to elements inside individual blocks.

  6. creativecoder commented on Dec 21, 2023

    @creativecoder
    Contributor

    I'm not sure that the File Block should inherit styles from a different block.

    However, maybe the File Block could use an inner Button Block? Then it should naturally inherit Button Block styles, since it would contain that block. I proposed this here: #57314

  7. jasmussen commented on Aug 13, 2026

    @jasmussen
    Contributor

    This appears resolved by #41753 (file download link already carries .wp-element-button so it inherits global Button element color/typography styles) and #64509 (added full border support — radius/color/width/style — to the File block). The remaining gap noted, using an inner Button block instead, is tracked separately in #57314. Closing this one as addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs Design Feedback[Block] File[Type] Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions