Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button elements: text decoration isnot applying in the frontend on the button block #42292

Closed
MaggieCabrera opened this issue Jul 10, 2022 · 2 comments · Fixed by #42545
Closed
Assignees
Labels
[Block] Buttons Affects the Buttons Block CSS Styling Related to editor and front end styles, CSS-specific issues. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended

Comments

@MaggieCabrera
Copy link
Contributor

Description

The text decoration settings for the button elements are not applying for the Button block on the frontend (they work on the editor).

Step-by-step reproduction instructions

Add this to theme.json inside styles:

"elements": {
	"button": {
		"typography": {
			"textDecoration": "underline"
		}
	},
}

Insert a button and check the editor and the frontend. Empty theme works fine for this.

Screenshots, screen recording, code snippet

Editor

Screenshot 2022-07-10 at 13 26 01

Frontend

Screenshot 2022-07-10 at 13 26 08

Environment info

No response

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

Yes

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

Yes

@carolinan
Copy link
Contributor

carolinan commented Jul 11, 2022

When I add the typography setting above I see:
Comments form button -no underline on front
Search button -underline on front
Button block -no underline on front

@kathrynwp kathrynwp added [Block] Buttons Affects the Buttons Block [Type] Bug An existing feature does not function as intended labels Jul 11, 2022
@t-hamano
Copy link
Contributor

The problem seems to be that .wp-block-button__link styles override the style by theme.json.
It may be effective to use :where to set the specificity to zero.

button

@t-hamano t-hamano added Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json CSS Styling Related to editor and front end styles, CSS-specific issues. labels Jul 20, 2022
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jul 20, 2022
@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Buttons Affects the Buttons Block CSS Styling Related to editor and front end styles, CSS-specific issues. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants