segmentio / evergreen

🌲 Evergreen React UI Framework by Segment
https://evergreen.segment.com
MIT License
12.39k stars 832 forks source link

Code component not forwarding className #1351

Closed salolivares closed 2 years ago

salolivares commented 3 years ago

I am currently having trouble applying a css property via className to the <Code> component. Seems like they aren't being "forwarded" and any css class specified in className does not appear in the rendered html (the css property fullstory-exclude I am applying does not appear).

image

My workaround so far has been wrapping <Code> in a <div> See https://codesandbox.io/s/funny-dust-hbts2?file=/index.js

@brandongregoryscott suggested it's most likely due to the ordering of the props being spread after the className prop (comparing to Text where the class name is properly forwarded).

https://github.com/segmentio/evergreen/blob/master/src/typography/src/Text.js#L27-L30 https://github.com/segmentio/evergreen/blob/master/src/typography/src/Code.js#L15