webpack下打包文件box-flex及box-orient 属性丢失

2018-08-13阅读(4572)评论(0)牵着狗狗看MM

苏州实时公交查询

问题描述

在webpack + autoprefixer,打包后,如果CSS中含有box-flexbox-orient,或者写成-webkit-box-flex-webkit-box-orient
那么这2个属性在打包后的文件中,不会存在。

原因

box-flexbox-orient这2个CSS属性,目前没有浏览器支持,autoprefixer就会把这个当成无效属性,打包后的文件自然也就不会存在了。

解决方法

CSS改成如下:

  /*! autoprefixer: off */
  -webkit-box-orient: vertical;
  /* autoprefixer: on */

/*! autoprefixer: off */
  -webkit-box-flex: 1;
  /* autoprefixer: on */

赞(0)
转载请注明来源:Web前端(W3Cways.com) - Web前端学习之路 » webpack下打包文件box-flex及box-orient 属性丢失
分享到: 更多 (0)