-
Notifications
You must be signed in to change notification settings - Fork 63
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
fix: adjust data attributes pattern on multiple components #1093
Conversation
✔️ Deploy Preview for faststoreui ready! 🔨 Explore the source changes: a32eb01 🔍 Inspect the deploy log: https://app.netlify.com/sites/faststoreui/deploys/61ce30e7f75e52000735bd4a 😎 Browse the preview: https://deploy-preview-1093--faststoreui.netlify.app |
✔️ Deploy Preview for faststore ready! 🔨 Explore the source changes: a32eb01 🔍 Inspect the deploy log: https://app.netlify.com/sites/faststore/deploys/61ce30e7c8ffb8000887e5a8 😎 Browse the preview: https://deploy-preview-1093--faststore.netlify.app |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit a32eb01:
|
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.
uhuull! Niceee 🚀
What's the purpose of this pull request?
This PR implements the patterns mentioned below on a few components that (I think) were not following them. I'm not sure if my interpretation of the patterns is 100% correct, especially when the components are compound, so everything here is open for discussion. Test were also updated accordingly, and a possible future work for a PR is to enforce the same pattern on all tests (some of them test for the presence of correct data attributes/values, and some of them do not).
How it works?
It enforces the following patterns:
Names for data attributes
The data attribute for the outermost component/element must be in the format
data-store-my-attribute-name-kebab-case
. All other data attributes for the inner components/elements must be in the formatdata-my-attribute-name-kebab-case
.Example:
GOOD:
BAD:
Values for data attributes
For data attributes that can hold multiple values, the values should be assigned to the data attribute itself instead of creating another data attribute to represent the value.
Example:
GOOD:
BAD:
How to test it?
yarn test
References
Faststore design principles
@igorbrasileiro