Skip to content
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

[WIP] Support transition prefix #6

Closed
wants to merge 1 commit into from

Conversation

cvle
Copy link
Member

@cvle cvle commented Nov 11, 2016

This PR fixes cssinjs/jss#317 and cssinjs/jss#300 by adding support for prefixing properties inside transition and transition-property.

This PR uses a regular expression to match and replace properties with their prefixed version. Tests were added that should pass in browsers needing to prefix the transform property: Android stock browsers, UC Browser on Android, Safari IOS 8, and IE9.

Note: IE9 doesn't support css transitions, but the tests will pass because the tests only check for correctly prefixing the values.

The test setup is currently not ideal see cssinjs/jss#89. Maybe we should do something like detecting the browser (e.g. using bowser) and giving out only relevant tests.

@cvle
Copy link
Member Author

cvle commented Nov 11, 2016

I realized that supportedValue in its current form is broken, see cssinjs/jss#354. We might need to rethink this.

@kof
Copy link
Member

kof commented Nov 11, 2016

Lets check what others do, for e.g. radium used initially this package as well.

@cvle
Copy link
Member Author

cvle commented Nov 11, 2016

They switched to inline-style-prefixer, as far as I know.

@cvle
Copy link
Member Author

cvle commented Nov 11, 2016

I'll make another revision after #8 lands.


const cache = {}
const transitionProperties = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if transition is unique in this, maybe we need a more general solution for all similar cases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where else are we putting property names into a css value?

const transitionProperties = [
'transition',
'transition-property',
'-webkit-transition',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not also other prefixes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to http://caniuse.com/#feat=css-transitions this covers 99.98% of all browsers used.

  • Opera is prefix free since Nov 2012
  • Firefox is prefix free since Aug 2012
  • IE & Edge never used a prefix

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@cvle cvle changed the title Support transition prefix [WIP] Support transition prefix Nov 20, 2016
@kof
Copy link
Member

kof commented Nov 23, 2016

Now this needs a merge from master

@kof
Copy link
Member

kof commented Nov 29, 2016

@cvle any updates?

@cvle
Copy link
Member Author

cvle commented Nov 29, 2016

I'll update this tomorrow.

@cvle
Copy link
Member Author

cvle commented Nov 30, 2016

While working on this, I got caught up in incorrect property prefixes. I'm currently enhancing our current test suites to test all property vendor prefixes and fix the issues.

@kof
Copy link
Member

kof commented Nov 30, 2016 via email

@cvle
Copy link
Member Author

cvle commented Dec 1, 2016

blocking #11

@kof
Copy link
Member

kof commented Dec 9, 2016

Is there something I need/can do?

@cvle
Copy link
Member Author

cvle commented Dec 9, 2016

I still need to get #11 done, to have reliable property prefixes which this feature depends on. If you have spare time you can create a PR at the folks at autoprefixer to export the caniuse feature name here https://github.com/postcss/autoprefixer/blob/master/data/prefixes.coffee.

Got a nasty food poisoning last week and just got better. Going through piled up work now. Will continue the work here soon too.

@kof
Copy link
Member

kof commented Dec 9, 2016

Don't worry its all fine, just wanted to know if I am blocking something. We are in the middle of 3 parallel big things in general, this one, new site and almost finished big core refactoring with flowtype and jss-global.

@AleshaOleg
Copy link
Member

@cvle hey, could you explain if transition it's a property - why you changing supported-value.js file?

@cvle
Copy link
Member Author

cvle commented Sep 2, 2017

@AleshaOleg Yes because you need to prefix the properties that are inside the value e.g. it could be transition: transform(...) and in some browsers this should become -webkit-transition: -webkit-transform(...) and in others it should transition: -webkit-transform(...), while some accept everything unprefixed.

@AleshaOleg
Copy link
Member

@cvle hey, thanks for your support!
@cvle, @kof could you review my PR please?
#6

@kof
Copy link
Member

kof commented Oct 6, 2017

@AleshaOleg we already handled this one in the other PR, right? can be closed?

@AleshaOleg
Copy link
Member

@kof yes, this one implemented in #26

@kof kof closed this Oct 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[jss-vendor-prefixer] Weird prefix bug with transitions in IE
3 participants