-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
6998: fix for the pseudo class ":first-child" is potentially unsafe #7000
6998: fix for the pseudo class ":first-child" is potentially unsafe #7000
Conversation
This pull request is automatically deployed with Now. Latest deployment for this branch: https://monorepo-git-fork-yasharzolmajdi-6998-pseudo-class-fix.storybook.now.sh |
Thanks so much for fixing this! Do you mind updating the snapshots?
|
@shilman sure, they are updated now |
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.
LGTM!!! 🙇
the problem with first-of-type is that if you have <div>
<span/>
<i/>
<b/>
</div> All 3 inner elements match first-of-type. first-child only matches the first element. It's totally different. Though we can try to make a concerted effort to make them do the same by making sure all element in the container are of the same type: <div>
<span/>
<span/>
<span/>
</div> this is actually incredibly hard to enforce when things like Fragments, and render-props come into play. Since we're not using SSR and have no plans to do so, I'd rather be able to turn off this warning tbh. |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook! |
changed ':first-child' to ':first-of-type' in tabs
Issue: #6998
What I did
changed the pseudo class for tabs from ':first-child' to ':first-of-type'
How to test
Check to see if any error is present in development console.