-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Regression: -webkit-box-orient rules removed #776
Comments
Is it a really issue if you ask Autoprefixer to remove old prefix? ;) |
@ai How to preserve -webkit-box-orient? |
Add any flexbox 2009 browser to |
Thank you |
@ai This still happens even if I add |
Are you sure that it does from Autoprefixer? Maybe some other tool (like minification in webpack’s |
tested out with css-loader remain the same version, Autoprefixer is the only factor remains that causing this |
Oh, I was passing remove:false to postcss-cssnext. Passing it on to autoprefixer results in -webkit-box-orient not being removed. var postcss = require('postcss');
var css = postcss([
require('postcss-cssnext')({
browsers: 'chrome >= 42, safari >= 8',
features: {
autoprefixer: {remove: false}
}
})
]).process(`
.foo {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-align: stretch;
}`).css;
console.log(css); I thought the behavior of the (default) remove:true option was to only remove outdated rules if the modern rule was specified too. So that |
Disabling the remove option or adding a flexbox 2009 browser to browsers list are both fairly coarse workarounds for this type of scenario. Any interest in adding an option to opt-out of removal at the rule level? |
Extra option is not a solution, because most of developers will not read docs. If you want to fix it, send a PR removing this hack |
@ai thanks - will do |
Possibly helpful for anyone reading up on this thread and problem, least intrusive option to prevent the removal of the line in question is to just disable the autoprefixer for this line/section
|
@Lars-Weber best option is just add old Safari to |
@Lars-Weber: awesome, thank you so much! |
@Lars-Weber @plamitgma |
|
@shizitou create
|
@Lars-Weber Works man.
not works man. |
@kmvan do you created Browsersllist config? |
@ai Yes.
|
@kmvan what is your input CSS, output, and expected output? |
@ai The output result |
@kmvan what is CSS input? ;) |
@ai Sorry, not CSS. Just SCSS input: |
@kmvan give me full rule (everything between |
@Lars-Weber
|
thanks @Lars-Weber .box-vertical {
/*! autoprefixer: off */
-webkit-box-orient: vertical;
} I put it inside the rule, so that only that rule would be affected. |
the best solution is the follow, if you use less |
@xuanGetit it is wrong since |
/*! autoprefixer: off */
-webkit-box-orient: vertical;
/*! autoprefixer: on */ Works, but needs to remove |
@kmvan check my comment above |
|
/* autoprefixer: ignore next */
-webkit-box-orient: vertical; It works, thank you very much. |
But it doesn't show up after packaging |
@jinglf000 I removed your comment since it is wrong to put off and on comments. Autoprefixer apply these comments to whole block, NOT next lines (Autoprefixer even show a warning about it). In Sass use |
I've been trying to use
|
@ai In my Vue project( use vue-cli init), I had tried many ways, such as
That not useful,only by this way
|
@jinglf000 my autoprefixer version 7.2.6 work,tks. |
@meigesir you use very outdated Autoprefixer. The current version is 9. |
Can anyone please make a PR to fix this by default? This css rule is used together with
|
Is it the same in less? I used it in less, but it didn't work |
@zuobaiquan nope, |
I am closing this issue because many developers suggest wrong solution. The only right solution: a {
line-height: 1em;
max-height: 2em;
display: -webkit-box;
/* autoprefixer: ignore next */
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
} |
While upgrading my dependencies on a project with some pretty old css (and which includes some webkit-specific hacks), I noticed an issue. Autoprefixer version 6.7.0 now entirely removes "-webkit-box-orient" rules. Version 6.6.1 did not have this issue.
->
Here's the code I've tested with:
The text was updated successfully, but these errors were encountered: