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

Allow to disable auto prefixng for extracted CSS #57

Closed
satya164 opened this issue Aug 29, 2017 · 15 comments
Closed

Allow to disable auto prefixng for extracted CSS #57

satya164 opened this issue Aug 29, 2017 · 15 comments
Milestone

Comments

@satya164
Copy link
Member

Currently the CSS will be autoprefixed to support as far as IE8. We need to be able to customize the browser target to reduce any extra code we don't need.

Perhaps we should switch to PostCSS instead of stylis as the parser so we have finer control over the extraction.

@satya164 satya164 added this to the Version 1 milestone Aug 29, 2017
@thymikee
Copy link
Member

With stylis it's not configurable?

@satya164
Copy link
Member Author

@thymikee doesn't look like that - https://github.com/thysultan/stylis.js

@zamotany zamotany modified the milestones: Version 1, Backlog Oct 10, 2017
@thymikee
Copy link
Member

How about switching to PostCSS? We're already using it to extract critical CSS.
What's more, we could make Linaria work by default with Stylis, and as soon as one wants finer control over outputted CSS, switch to PostCSS.

@zamotany
Copy link
Contributor

Closing this in favour of #142. There is nothing we can do about stylis. With custom preprocessor (eg PostCss) this will be achievable.

@satya164 satya164 reopened this Nov 10, 2017
@satya164
Copy link
Member Author

Stylis now has an option disable vendor prefixing with stylis.set({ prefix: false }). We should also expose the option prefix: false in our babel preset to disable vendor prefixing. For fine grained control over prefixing, consumers can use a tool like autoprefixer.

@satya164 satya164 changed the title Allow customizing browser target for extracted CSS Allow to disable auto prefixng for extracted CSS Nov 10, 2017
@zamotany
Copy link
Contributor

We should allow to write custom preprocessor for advanced use cases, exposing each stylis option in babel preset is not a good idea.

@satya164
Copy link
Member Author

Not suggesting to expose each stylis option. Disabling auto-prefixing is a common enough case and needed to avoid shipping more code than necessary to the browsers.

Custom pre-processor is nice, but will require too much setup for just disabling prefixing.

@zamotany zamotany removed this from the Backlog milestone Nov 22, 2017
@zamotany zamotany added this to the 0.6.0 milestone Jan 8, 2018
@kryops
Copy link
Contributor

kryops commented Feb 28, 2019

Just adding the following to my webpack configuration file seems to have done the trick for me:

import stylis from 'stylis'

stylis.set({ prefix: false })

@buzinas
Copy link
Contributor

buzinas commented Mar 5, 2019

Not sure why this issue is closed, since it was not fixed and there is still no easy way to disable this annoying auto-prefixing provided by linaria by default. I shouldn't have to use change the pre-processor to achieve that, imo.

@satya164
Copy link
Member Author

satya164 commented Mar 5, 2019

@buzinas you should be able to do this in your webpack config:

const stylis = require('stylis');

...

stylis.set({ prefix: false });

@buzinas
Copy link
Contributor

buzinas commented Mar 5, 2019

Yep, that's what I did… Thanks, @satya164!

@nstepien
Copy link
Contributor

Would be nice if this was documented and not buried in the issues. 🤔

@scornwell-meta
Copy link

This still doesn't work for me. Nothing I do can disable it so far, guess it's time to go digging through source code.

@victordidenko
Copy link

Still not possible to disable auto prefixing, Stylis doesn't exports set function, maybe it worked in the past, but now I don't see any configuration in it...

I've encountered issue with auto prefixing and variable name generating:
thysultan/stylis#330

If not possible to disable prefixing, maybe it is possible to adjust variable name generating rules, so variable name will not match prefixing regular expressions in Stylis?

@victordidenko
Copy link

Found an option variableNameSlug and set it to '_[componentSlug]_[index]'.
But this is hideous ._.

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

No branches or pull requests

8 participants