Refactor CSS class naming to follow consistent component pattern#1183
Merged
Refactor CSS class naming to follow consistent component pattern#1183
Conversation
…ate-gatherpress-classes
…al--trigger-open/close) and replace strpos with str_contains.
…-modal--type-login/rsvp).
…p--trigger-update).
…-response--no-responses)..
…ate-gatherpress-classes
Contributor
Preview changes with PlaygroundYou can preview the recent changes for PR#1183 with the following PHP versions: PHP Version 8.3
PHP Version 7.4
Download Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR refactors CSS class naming throughout GatherPress to establish a consistent, maintainable component-based naming pattern. The changes improve code clarity, reduce confusion, and align class names with their corresponding block names.
Key Changes
Modal Classes
Modal triggers:
gatherpress--open-modal→gatherpress-modal--trigger-opengatherpress--close-modal→gatherpress-modal--trigger-closeModal types:
gatherpress--is-rsvp-modal→gatherpress-modal--type-rsvpgatherpress--is-login-modal→gatherpress-modal--type-login--type-pattern to identify modal variants*RSVP Classes
RSVP triggers:
gatherpress--update-rsvp→gatherpress-rsvp--trigger-updateEmpty state:
gatherpress--empty-rsvp→gatherpress-rsvp-response--no-responsesForm Field Classes
gatherpress-field-type-*→gatherpress-form-field--*gatherpress-field-type-checkbox→gatherpress-form-field--checkboxVisibility Classes
gatherpress--is-not-visible→gatherpress--is-hiddenRSVP State Classes
gatherpress--rsvp-attending→gatherpress--is-attendinggatherpress--rsvp-waiting-list→gatherpress--is-waiting-listgatherpress--rsvp-not-attending→gatherpress--is-not-attendingTechnical Improvements
strpos()withstr_contains()throughout PHP codebase (WordPress provides polyfill)wp_template,wp_template_part)Testing
Migration Support
The gatherpress-alpha plugin includes a complete migration system that automatically updates all existing content with the new class names, ensuring no breaking changes for existing installations. That PR can be found here.