[wp-trac] [WordPress Trac] #60450: Button component is missing has-text class when text prop is used
WordPress Trac
noreply at wordpress.org
Tue Feb 6 22:03:34 UTC 2024
#60450: Button component is missing has-text class when text prop is used
--------------------------+-----------------------------
Reporter: mmcalister | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 6.4.3
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
When using the [Button](https://developer.wordpress.org/block-editor
/reference-guides/components/button/) component, adding text to the button
will output the `has-text` class on the button.
Alternatively, the Button component has a text prop that displays the
given text inside the button, but when used, the prop does not output the
`has-text` class on the button.
{{{
<Button
variant="secondary"
text={__('Click Me', 'example')}
/>
}}}
For those who use the `text` prop, this creates a styling inconsistency
and does not take advantage of the core `has-text` styling. The expected
outcome would be that using the `text` prop outputs the `has-text` class
on the button.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60450>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list