Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

[Prefix] Add an option to prefix for all user agent #552

Closed
wants to merge 1 commit into from
Closed

[Prefix] Add an option to prefix for all user agent #552

wants to merge 1 commit into from

Conversation

oliviertassinari
Copy link
Contributor

My use case for this, is to prefix for all user agent on the server side
and only for the browser agent on the client side. As pointed out here facebook/react#1979
I think that it's a very good trade-off.
This allow me to remove the user agent from the memoization I use on the renderToString method.

The test fails because of robinweser/inline-style-prefixer#58.
I'm gonna address it.

Fix #546.

@oliviertassinari
Copy link
Contributor Author

I have just realized that we can use https://github.com/rofrischmann/radium-plugin-prefix-all for the same use case. Do you still want this PR?

const style = getElement(output, 'style');
expectCSS(style, `
div {
-ms-transform: rotate(90);
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem right, I would have expected transform, -webkit-transform and others to be here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, I had no way to know the output order of the prefixes with the Symbol fail. Fixed!

@ianobermiller
Copy link
Contributor

Thank you for the PR!

The plugin, while nice for basic cases, is not quite ideal, because the prefixer isn't fully pluggable. It is used directly by keyframes, style, and media queries, so none of those would be affected by swapping the plugin.

The only thing your PR is missing is support for keyframes prefix, more details in the comment.

My use case for this, is to prefix for all user agent on the server side
and only for the browser agent on the client side. As pointed out here facebook/react#1979
I think that it's a very good trade-off.
This allow me to remove the user agent from the memoization I use on the `renderToString` method.

The test fails because of robinweser/inline-style-prefixer#58.
I'm gonna address it.

Fix #546.
@ianobermiller
Copy link
Contributor

We'll have to wait until the fix for robinweser/inline-style-prefixer#58 is release to merge this.

@ianobermiller
Copy link
Contributor

inline-style-prefixer has released an update, so I merged this: d0b3289

@oliviertassinari oliviertassinari deleted the prefix-all branch January 27, 2016 08:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autoprefix for all user agent
2 participants