首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏前端资源

    在Webstorm中使用Autoprefixer实现CSS自动补全

    我们可以用Autoprefixer模块来给css自动补全,实现多浏览器的兼容。 Autoprefixer的安装和配置: 1、首先当然是安装node.js     参考我之前的那篇文章。 2、安装Autoprefixer 打开cmd控制台,输入下面一行npm命令,安装Autoprefixer模块:-g是全局安装,如果不加会安装在当前目录。 npm install autoprefixer -g 3、安装postcss-cli Autoprefixer其实是postcss的插件,见:https://github.com/code42day/ 详情见:https://github.com/postcss/autoprefixer 注意:Autoprefixer不支持中文目录,并且路径中不能有空格,否则会报错:Input Error: You

    2.5K00发布于 2019-11-13
  • 来自专栏无限可能的程序开发

    -webkit-box-orient:vertical 编译报错之autoprefixer问题

    由于各大浏览器的兼容问题,autoprefixer 插件 就可以帮我们自动补齐前缀。它和 less、scss 这样的预处理器不同,它属于后置处理器。 autoprefixer插件广泛应用于前端项目的打包配置中,具体配置请参考官方文档。 Autoprefixer css补全前缀功能 Autoprefixer处理前css代码 display: flex; Autoprefixer处理后css代码 display: -webkit-box; : (43:3)Second Autoprefixer control comment was ignored. 这种写法已经过时了,采用下面的写法: /* autoprefixer: ignore next */ /* autoprefixer: ignore next */ -webkit-box-orient

    83720编辑于 2022-12-02
  • 来自专栏逸鹏说道

    还在手动给css加前缀?no!几种自动处理css前缀的方法简介

    在本文中我们主要介绍postcss里面使用率最高的一个插件AutoprefixerAutoprefixer是专门用来添加厂商前缀的postcss插件,它处理兼容性的依据来源于caniuse。 '); var autoprefixer = require('autoprefixer'); return gulp.src('. var autoprefixer = require('autoprefixer');module.exports = { module: { loaders: [ { grunt 在grunt中,你可以安装npm包grunt-postcss来启用Autoprefixer。 以webpack为例: var autoprefixer = require('autoprefixer');module.exports = { module: { loaders: [

    3K50发布于 2018-04-10
  • 来自专栏smy

    webpack的css压缩不兼容IOS8问题探索

    postcss的autoprefixer配置如下: autoprefixer({ browsers: ['> 1%', 'iOS >= 7',"ie >= 7", 'Android 所以可以通过给css-loader添加-autoprefixer参数来告诉css-loader关闭掉autoprefixer这个功能,不要强制删除某些你觉得不重要的前缀。 minimize&-autoprefixer!postcss-loader! 所以我们主动关闭cssnano的autoprefixer功能即可,因为我们已经在postcss中使用了autoprefixer插件,这里无需重复使用。 会使用到autoprefixer进行无关前缀的清理。

    1.6K40发布于 2018-06-14
  • 来自专栏Web前端

    PostCSS概述

    插件如Autoprefixer、cssnano、PreCSS等,分别负责添加浏览器前缀、压缩CSS、支持Sass/Less-like语法等功能。 // postcss.config.jsmodule.exports = { plugins: [ 'autoprefixer', ['cssnano', { preset: 'default src/style.css --use autoprefixer cssnano precss -o dist/style.cssNode.js API在Node.js项目中直接调用PostCSS API 处理CSS:fs = require('fs');const postcss = require('postcss');const autoprefixer = require('autoprefixer ');const cssnano = require('cssnano');const precss = require('precss');postcss([autoprefixer, cssnano

    59000编辑于 2024-11-24
  • 来自专栏无道编程

    2021-07-31 在vue3中使用tailwindcss

    安装 yarn add -D tailwindcss@latest postcss@latest autoprefixer@latest npx tailwindcss init -p vue-cli { css: { loaderOptions: { postcss: { plugins: [require('tailwindcss'), require('autoprefixer 就要使用postcss 7 yarn remove tailwindcss postcss autoprefixer yarn add -D tailwindcss@npm:@tailwindcss/postcss7 -compat postcss@^7 autoprefixer@^9 vite 因为vite自带css预处理器,只需安装响应处理器模块就行: yarn add sass -D yarn add less

    1.5K20发布于 2021-08-03
  • 来自专栏小鑫の随笔

    Taro -webkit-box-orient: vertical 失效

    在使用 taro 写多行文本超出显示省略号时,发现 -webkit-box-orient: vertical; 没起作用 最后去社区查了下,发现有人遇到了同样的问题,最后得到的解决方案是: 第一种 /* autoprefixer : ignore next */ -webkit-box-orient: vertical; 第二种 /* autoprefixer: off */ -webkit-box-orient: vertical ; /* autoprefixer: on */ 两种方式都是加入 css 注释 去声明忽略下一行,防止编译时被过滤掉 issue:https://github.com/postcss/autoprefixer

    48120编辑于 2022-05-11
  • 来自专栏老马寒门IT

    05-移动端开发教程-CSS3兼容处理

    vscode 自动化插件: Autoprefixer,可以自动化的给css、less、sass文件进行自动化的添加css3前缀。 ? 使用方法:ctrl + shift + p 然后输入 autoprefixer 选择回车执行命令。 由于此插件是对npm包:Autoprefixer的封装,所以如果使用此插件对css进行预处理需要安装好node和安装上Autoprefixer包。 # 第一步: 安装node # 第二步:全局安装Autoprefixer插件包 $ npm i -g autoprefixer # 第三步: 用vacode的插件处理css文件(html文件不行) 的文件 var gulp = require('gulp'), // 引用gulp autoprefixer = require('gulp-autoprefixer'), // 添加引用前缀的

    2.2K120发布于 2018-04-02
  • 来自专栏前端小菜鸡yym

    webpack postcss

    安装postcss npm i postcss-cli -D autoprefixer 网址 如下,它将左侧的css进行了多个浏览器版本的兼容。 autoprefixer的使用 首先,不要忘了我们的.browserslistrc。这里是对需要兼容的浏览器版本的一个约束。 autoprefixer的编译那,也会根据.browserslistrc来进行编译的。 安装: npm i autoprefixer -D 然后使用autoprefixer再次执行postcss,此时可以发现都加上了适配不同浏览器的前缀了。 npx postcss --use autoprefixer -o ret.css .

    51420编辑于 2023-01-12
  • 来自专栏IMWeb前端团队

    聊聊CSS postproccessors

    革命 在我看来真正带来革命的不是postcss,恰恰是他的核心组件Autoprefixer。 [1] Working with Autoprefixer is simple: just forget about vendor prefixes and write normal CSS according Just write normal CSS according to the latest W3C specs and Autoprefixer will produce the code for old 注 [1] 在我的记忆里Autoprefixer是rework的插件(因为当时Autoprefixer是rework的主打功能之一),所以我开挖掘机挖了下,发现的确如此,实际上Autoprefixer在 Also it clean Autoprefixer code by moving some common CSS processor code to PostCSS.

    48610发布于 2019-12-03
  • 来自专栏一只想做全栈的猫

    【前端芝士树】纯CSS实现多行文本溢出显示省略号

    人们对 Autoprefixer 感到恼火的原因是因为 Autoprefixer 破坏了 line-clamp 的使用, 并且这个问题已经存在了很长一段时间。 Autoprefixer 作者的意见如下 是的,我知道 line-claimp 这个属性。我个人不喜欢 webkite-only 的事情。 所以我不想花费我的时间而允许人们去做这个事情(但是可以通过/* autoprefixer: ignore next */或者/* autoprefixer: off */ 让 autoprefixer去忽略这个属性的检查 所以最后的开发代码如下: /* autoprefixer: off */ overflow: hidden; text-overflow: ellipsis; display: -webkit-box; 《多行文本溢出显示省略号(…)全攻略-WEB前端开发》 《Ask not to remove the code: -webkit-box-orient · Issue #1141 · postcss/autoprefixer

    1.4K20发布于 2019-05-26
  • 来自专栏前端技术归纳

    入门webpack的最佳实践(基于webpack4.X 5.X)-- postcss-loader介绍

    目录 postcss-loader autoprefixer postcss-preset-env postcss-flexbugs-fixes postcss-normalize css module { plugins: [ //... ], }, }, }, ], autoprefixer autoprefixer 可以给不兼容的css属性自动加上浏览器前缀 配置 { loader: 'postcss-loader', options: { postcssOptions: { plugins: [ 'autoprefixer', ], }, }, }, 比如打包前的app.less为,其中,user-select的写法不兼容所有的浏览器 margin-bottom: 20px; color: #12345678; } 除此之外,使用postcss-preset-env插件也可以实现浏览器前缀补全,基于此,我们也没必要在使用autoprefixer

    1.3K10编辑于 2022-09-27
  • 来自专栏IMWeb前端团队

    聊聊CSS postproccessors

    革命 在我看来真正带来革命的不是postcss,恰恰是他的核心组件Autoprefixer。 [1] Working with Autoprefixer is simple: just forget about vendor prefixes and write normal CSS according Just write normal CSS according to the latest W3C specs and Autoprefixer will produce the code for old 注 [1] 在我的记忆里Autoprefixer是rework的插件(因为当时Autoprefixer是rework的主打功能之一),所以我开挖掘机挖了下,发现的确如此,实际上Autoprefixer在 Also it clean Autoprefixer code by moving some common CSS processor code to PostCSS.

    67260发布于 2017-12-29
  • 来自专栏友人a的笔记丶

    PostCss学习笔记,持续记录

    JunChow520/article/details/117020367 1.PostCss简介 PostCSS是一款使用JavaScript插件对CSS实现转换的工具 PostCSS拥有非常强大的插件,典型的比如autoprefixer API列表:https://postcss.org/api/ import postcssPxtorem from "postcss-pxtorem"; import autoprefixer from 'autoprefixer' export default { //样式表插件 css: { postcss: { plugins: [ unitPrecision: 5 }) ] } } } 3.相关插件 3.1 autoprefixer autoprefixer用于自动添加css产商前缀; $ npm install autoprefixer --save-dev 项目地址 https://github.com/postcss/autoprefixer

    80410编辑于 2023-02-17
  • 来自专栏Rovo89

    使用Webpack快速配置编写HTML基础环境

    webpack --config webpack.config.prod.babel.js" }, "dependencies": {}, "devDependencies": { "autoprefixer 3.1.3" } } 新建webpack.config.babel.js import webpack from 'webpack' import path from 'path' import autoprefixer from 'autoprefixer' import ExtractTextPlugin from 'extract-text-webpack-plugin' import BrowserSyncPlugin config 新建webpack.config.prod.babel.js import webpack from 'webpack' import path from 'path' import autoprefixer from 'autoprefixer' import ExtractTextPlugin from 'extract-text-webpack-plugin' let extractStyles =

    1.1K40发布于 2018-06-19
  • 来自专栏乱码李

    PostCSS 初识

    然后有同事说应该有一些工具能够自动补全的,于是 google 了一下,发现这种问题早就有非常好的解决方案,那就是 PostCSS 的插件 autoprefixer。 解决方案 首先安装 webpack 插件 postcss-loader 和 autoprefixer $ npm i autoprefixer postcss-loader --save-dev 然后修改 准确的说,PostCSS 是一个平台,通过一些插件,能做很多事情: (1) 增加代码可读性 比如刚才我们用的 autoprefixer,通过给 css 添加供应商前缀,让我们的 css 代码更加优雅。 /dist/style.css' }), new webpack.LoaderOptionsPlugin({ options: { postcss: [autoprefixer autoprefixer cssnext

    69940发布于 2021-11-26
  • 来自专栏前端小叙

    webpack 4 配置备忘

    importLoaders=1', {loader: 'postcss-loader', options: {plugins: [require("autoprefixer // 避免 cssnano 重新计算 z-index safe: true, // cssnano 集成了autoprefixer 的功能 // 会使用到autoprefixer进行无关前缀的清理 // 关闭autoprefixer功能 // 使用postcss的autoprefixer功能 autoprefixer: false }, canPrint: webpack.dev.js" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "autoprefixer

    40830编辑于 2021-12-16
  • 来自专栏前端小叙

    webpack多页面配置

    'css-loader', {loader: 'postcss-loader', options: {plugins: [require("autoprefixer importLoaders=1', {loader: 'postcss-loader', options: {plugins: [require("autoprefixer // 避免 cssnano 重新计算 z-index safe: true, // cssnano 集成了autoprefixer 的功能 // 会使用到autoprefixer进行无关前缀的清理 // 关闭autoprefixer功能 // 使用postcss的autoprefixer功能 autoprefixer: false }, canPrint:

    1.3K30发布于 2019-08-20
  • 来自专栏无道编程

    Webstorm编译scss(基于Ruby)

    添加css3前缀 需要node环境: 安装Autoprefixer, npm install autoprefixer -g 安装postcss-cli,Autoprefixer其实是postcss的插件 Arguments $FileDir$/$FileName$ -u autoprefixer -r 参数意思: $FileDir$/$FileName$将当前选择文件为输入文件 -u(--use) 使用 autoprefixer插件 -r(--replace) 前缀写好了的内容,在当前文件替换。

    1.1K20发布于 2020-02-10
  • 来自专栏无道编程

    Webstorm编译scss文件[附CSS3前缀方法]

    文件编译的css文件放到css文件夹 Output paths to refresh: $FileDir$ 以上$FileDir$默认即可吧~~ 安装自动前缀 执行以下两个命令 分别是安装autoprefixer npm install autoprefixer -g ? npm install postcss-cli -g ? 配置autoprefixer 位置:File->Tools->External Tools 点击add ? ? 填写内容: Name: Autoprefixer 名称随意即可 description:Autoprefixer 描述随意即可 Program: F:\nodejs\node_global\ Parameters: -u autoprefixer -o $FileDir$/$FileName$ $FileDir$/$FileName$ 参数,默认以上即可 Working directory

    3.7K00发布于 2019-11-13
领券