React-styleguidist: Font color in examples being overwritten in Safari

Created on 19 Dec 2017  Â·  28Comments  Â·  Source: styleguidist/react-styleguidist

I'm noticing that since v6.1.0 font colors inside of component examples are being overwritten by theme.color.base. From what I can tell it only seems to be an issue in Safari (tested in 11.0.2)

Code editor is being overwritten as well.

https://github.com/corygibbons/styleguidist-example/tree/font-color

Chrome (working):
chrome

Safari (broken):
safari

bug

Most helpful comment

Out in 6.2.0!

@swashcap @austin94

All 28 comments

Thanks for bug reports! I’ll have a look. (Feel free to send a pull request if have time to do so ;–)

I can verify this even though I believe this is a safari bug

I had to do -webkit-text-fill to be able to override and put the actual colors

@SaraVieira Have you tried to debug what’s the issue?

We have a bigger issue: syntax highlighting in CodeMirror doesn’t work at all in Safari in Styleguidist 6.1.

And it happens only in JSS 9 (f16a8d3b6b26b47ee3322720ad52427b53b36274). @kof any ideas?

I try to debug it in collaboration with Fez and this were the findings :

https://twitter.com/NikkitaFTW/status/942754647009349632

https://github.com/yldio/joyent-portal/pull/943

Nope, we’re not going to add a giant hack like this ;-|

Duuude no, please don't! Even I was ashamed of that PR

This is just a link for historical porpuses and the reason I think this is a safari bug

Any online example that demonstrates the bug?

@kof The repo in the ticket description, any example in this repo. Reverting JSS and all plugins back to 8.x fixes the issue.

Old version of our styleguide before the fix
https://styleguide-wwgijwjrui.now.sh/

@kof

Yes, -webkit-text-fill-color causes this, now the question is why suddenly? I don't think initize has changed in this between those versions.

actually what version of initize has been used before?

So it is the update to the latest jss-isolate!

  1. What we can do now - overwrite those trouble making props during jss-isolate setup:
jss.use(isolate({
  reset: ['all', {
    boxSizing: 'border-box'
  }]
}))
  1. Create a separate, isolated issue regarding those props on jss-isolate. Ideally find all of the problematic props. I am still not sure why they behave differently on safari. We will probably have to remove them from initize.

We actually don’t set all and have a custom list:

https://github.com/styleguidist/react-styleguidist/blob/2556b519a9b8be1540818b2ffad4f108bed69466/src/styles/setupjss.js#L19-L33

As I understand docs, it shouldn’t use the all list in this case.

Oh yes, in that case it extends inherited initials object with your object https://github.com/cssinjs/jss-isolate/blob/master/src/index.js#L29 and those problematic props are comming from the inherited list are https://github.com/iamstarkov/initize/blob/master/inherited.js

Initize is generating those props from mdn database, I will have to check if we have flag for non-standard properties and remove them all in one go, otherwise will just have to blacklist them specifically.

yes, "all" means inherited properties and non-inherited in one list, you require the list you want.

Fixed css-initials package, removed all non-standard props.

released css-initials and jss-isolate

please update jss-isolate to 5.1.0 and I hope this can be closed

Experiencing some _super strange_ Safari styling and found this issue. Could someone publish the package so this fix is available?

Publishing a patch for this would be very helpful. Currently viewing components in Safari is pretty unpredictable.

Out in 6.2.0!

@swashcap @austin94

Was this page helpful?
0 / 5 - 0 ratings