This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Fix inconsistent button styling with TT3 #7516
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d69ee87
fix inconsistent button styling with TT3
gigitux a00e4e6
use wc_wp_theme_get_element_class_name
gigitux 81f3a2a
add check to be sure that wc_wp_theme_get_element_class_name function…
gigitux 673ff72
Merge branch 'trunk' into fix/add_to_cart_button_TT3
gigitux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we should use
wp_theme_get_element_class_name( 'button' )
to get the correct class name, instead of directly usingwp-element-button
. Similar to what WC core does here: https://github.com/woocommerce/woocommerce/pull/35306/files#diff-3582a823c079f0c8354f3171ce608961ae6b224dd0182f7e4bb14e82278b05abR527-R543.I don't know if there is an equivalent one for the JS side, but might be good investigating as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Thanks for sharing this! I used
wc_wp_theme_get_element_class_name
to be more consistent with WC core a00e4e6I searched, but I didn't find any JS equivalent.
wp_theme_get_element_class_name
reads data from theme.json that isn't accessible on the JS side.https://github.com/WordPress/WordPress/blob/44881d209b2f37cccdbd1f9a8713ba782bbdb65f/wp-includes/theme.php/#L4231-L4233