chromaui / addon-visual-tests

Visual Tests addon for Storybook
MIT License
30 stars 1 forks source link

Fix `first-child` warning in console #183

Closed JReinhold closed 4 months ago

JReinhold commented 5 months ago

Currently the VTA causes a constant warning to be logged in the console (originating from Emotion):

The pseudo class ":first-child" is potentially unsafe when doing server-side rendering.
Try changing it to ":first-of-type".

image

This PR fixes that by following the guideline. To read more about the differences between the two psuedo selectors, see https://www.samanthaming.com/tidbits/46-css-not-selector/#first-child-vs-first-of-type

This change shouldn't cause any actual UI change. The list only contains ListItem's, so they behave the same. If the list one day in the future would contain another first item type, using first-of-type would ensure it still works.

📦 Published PR as canary version: 1.3.0--canary.183.4728757.0
:sparkles: Test out this PR locally via: ```bash npm install @chromatic-com/storybook@1.3.0--canary.183.4728757.0 # or yarn add @chromatic-com/storybook@1.3.0--canary.183.4728757.0 ```