autoprefixer: ignore next not work bug All In One
autoprefixer: ignore next not work bug All In One
webpack 打包后,样式部分丢失
可能原因
- Node.js 升级 v8.9 => v14.16
- node-sass 换成 dart-sass
- 更新后 CI docker 有缓存
- ...
bug ❌
/* autoprefixer: ignore next */
❌ not work any more
.multText-inline {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
/* autoprefixer: ignore next */
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
}
solution ✅
已验证 OK
.multText-inline {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
/*! autoprefixer: off */
-webkit-box-orient: vertical;
/* autoprefixer: on */
-webkit-line-clamp: 3;
}
/*! autoprefixer: off */
-webkit-box-orient: vertical;
/* autoprefixer: on */
或 ???❌
/*! autoprefixer: off */
-webkit-box-orient: vertical;
/*! autoprefixer: on */
源码
const OLD_LINEAR = /(^|[^-])linear-gradient\(\s*(top|left|right|bottom)/i
const OLD_RADIAL = /(^|[^-])radial-gradient\(\s*\d+(\w*|%)\s+\d+(\w*|%)\s*,/i
const IGNORE_NEXT = /(!\s*)?autoprefixer:\s*ignore\s+next/i
const GRID_REGEX = /(!\s*)?autoprefixer\s*grid:\s*(on|off|(no-)?autoplace)/i
Autoprefixer error
Second Autoprefixer control comment was ignored. Autoprefixer applies control comment to whole block, not to next rules.
二合一 ???
.mult-lines-text-ellipsis {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
/*! autoprefixer: off */
+ /* autoprefixer: ignore next */
-webkit-box-orient: vertical;
/* autoprefixer: on */
-webkit-line-clamp: 3;
}
https://gist.github.com/xgqfrms/f0e0c6f7c8dd55c7a1fa1c1cb51f2d7a
refs
https://github.com/postcss/autoprefixer/issues/1220
https://juejin.cn/post/6844903848599896072
©xgqfrms 2012-2020
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/15848181.html
未经授权禁止转载,违者必究!