-
Notifications
You must be signed in to change notification settings - Fork 187
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
prefixed versions of rules are appearing after non-prefixed rules in generated styles #100
Comments
Genuinely curious here. What's the problem with having the vendor-prefix version overwrite the non-prefix version? THe result is the same right? I'm probably missing something. |
The vendor-prefix versions are not always the same as the final W3C compliant implementation. |
@danhayden Thanks for the report! I wasn't really convinced by this, but I found this CSS Tricks article explaining how It sounds like we need to ensure that the unprefixed versions come last. I think this might be most easily accomplished with a change to the auto-prefixer? |
Seems that inline-style-prefixer generate the {
// ...
display: ['-webkit-box', '-moz-box', '-ms-flexbox', '-webkit-flex', 'flex'],
//...
}
AutoprefixerMaybe this is for a separate issue, but take the opportunity to say that switch to autoprexier should be pretty useful, since allows to control the userAgent by queries provided by browserslist. Seems that inline-style-prefixer don't handle browser versions using Just saying this because I'm having generated styles with |
I'm currently running into a similar issue with the export const canvas = {
backgroundColor: '#f5f5f5',
cursor: [
'default',
'-webkit-grab'
]
};
export default StyleSheet.create({
canvas
}); .canvas_1bt2tmf {
background-color: #f5f5f5;
cursor: -webkit-grab;
cursor: default;
} In this case, I want webkit browsers to use the vendor-prefixed version of the rule, so I can make use of the grab cursor, but it does not look like the order I specify the rules in has any bearing on the generated CSS. |
This change attempt to solve Khan#100.
Hmm. It looks like this problem might have been fixed by v2.0.5 in inline-style-prefixer (which is coincidentally causing our tests to fail https://travis-ci.org/Khan/aphrodite/builds/194582952). In #123 we were trying to decide if this is worth a major version bump, because it might have broken behaviour for other people. Looks like inline-style-prefixer released this as a bugfix though, so maybe we shouldn't make a major version for this? I'm going to fix the tests and then the next time we release this will be fixed. |
Hmmm... I'm not sure that I understand how this impacts things, but normally if you have to fix tests it means that other people will have to fix code (breaking change), unless you're shielding us from these changes in some way... |
Looks like this was fixed with the release of version 1.2.0 👍 |
Sample output:
As you can see in the the image below from Chrome dev tools this is causing non-prefixed rules to be overwritten in the browser by prefixed ones
The text was updated successfully, but these errors were encountered: