xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

autoprefixer: ignore next not work bug All In One

autoprefixer: ignore next not work bug All In One

webpack 打包后,样式部分丢失

可能原因

  1. Node.js 升级 v8.9 => v14.16
  2. node-sass 换成 dart-sass
  3. 更新后 CI docker 有缓存
  4. ...

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

https://github.com/postcss/autoprefixer/blob/69ed8a0d35cd3d8445c1a713f63ccfc32db29bb9/lib/processor.js#L8

https://github.com/postcss/autoprefixer/blob/69ed8a0d35cd3d8445c1a713f63ccfc32db29bb9/lib/processor.js#L551

https://github.com/postcss/autoprefixer/blob/69ed8a0d35cd3d8445c1a713f63ccfc32db29bb9/lib/processor.js#L665

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://stackoverflow.com/questions/56105499/attribute-webkit-box-orient-in-css-not-working-when-build-in-vuejs

https://github.com/postcss/autoprefixer/issues/1220

https://juejin.cn/post/6844903848599896072



©xgqfrms 2012-2025

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @   xgqfrms  阅读(316)  评论(2编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2021-01-26 邮件撤回功能实现原来剖析
2021-01-26 js arrow function return object
2019-01-26 macOS & SVN
点击右上角即可分享
微信分享提示