This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
When available, FilterSubmitButton should use the button class name provided by the elements API #6962
Labels
focus: global styles
Issues that involve styles/css/layout structure.
type: bug
The issue/PR concerns a confirmed bug.
type: refactor
The issue/PR is related to refactoring.
Currently, the
FilterSubmitButton
component uses thewp-block-button__link
class name to get styling from the theme. However, I don't think that class is intended to be used like that; I think it's a class specific to the button block.As an alternative approach, Gutenberg is introducing the elements API (see WordPress/gutenberg#41753 and pdnLyh-1kY-p2), which will allow us to get a generic button class name that will apply theme styles.
In other words, I think we should check if
@wordpress/block-editor
includes the__experimentalGetElementClassName()
function (that happens if the store has Gutenberg installed or is in WP >=6.1). If it does, we should get the class returned by__experimentalGetElementClassName( 'button' )
and use that one instead ofwp-block-button__link
.block-editor
in the frontend)What do you think @albarin @dinhtungdu?
The text was updated successfully, but these errors were encountered: