autoprefixer

1.CSS3简介

末鹿安然 提交于 2020-08-11 04:45:58
# 1.CSS3简介 - 前缀 google/safari : -webkit- ie : -ms- firefox : -moz- opera : -o- - 前缀官方网址 参考手册:http://css.doyoe.com 权威网站:http://www.caniuse.com - 预处理器:pre-processor less/sass cssNext插件 cssNext:用来实现一些未来的标准(未完全在各大浏览器实现的功能) - 后处理器:post-processor 后处理器插件 autoprefixer : 可以帮助我们自动添加前缀 - postCss + 插件 (充分体现了扩展性) 用JS实现的css抽象的语法树 AST(Abstract Syntax Tree) 剩下的是留给了后人来做 来源: oschina 链接: https://my.oschina.net/u/4413947/blog/4282731

解决CSS浏览器兼容性问题的一些方案浅析

蓝咒 提交于 2020-07-29 04:05:03
  前端是一个苦逼的职业,不仅因为技术更新快,而且要会的东西实在太多了,更让人头疼的是,还要面临各种适配、兼容性问题。   为什么会有浏览器兼容性问题。还不是因为浏览器厂商太多了。关键是不同厂商,甚至同一厂商不同版本,对同一段CSS的解析效果也不一致,这就导致了页面显示效果不统一,也就带来了兼容性问题。   市场上浏览器种类很多,不同浏览器的内核也不尽相同,所以各个浏览器对网页的解析存在一定的差异。   浏览器内核主要分为两种,一是渲染引擎,另一个是js 引擎,内核更加倾向于说渲染引擎。常见的浏览器内核可以分四种:Trident、Gecko、Blink、Webkit   我们暂且不去关注太多细节问题, 比如那个css样式需要我们去兼容,而是想讨论一下大的解决思路,主要包括4个方面,浏览器CSS样式初始化、浏览器私有属性,CSS hack语法和自动化插件。 1、 浏览器CSS样式初始化   由于每个浏览器的css默认样式不尽相同,所以最简单有效的方式就是对其进行初始化,相信很多朋友都写过这样的代码,在所有CSS开始前,先把marin和padding都设为0,以防不同浏览器的显示效果不一样。以及对一些常用的html元素进行一些初始化处理等等。 * { margin: 0 ; padding: 0 ; }   关于浏览器CSS样式初始化,经验不丰富的话,可能也不知道该初始化什么

How to make this simple css-grid layout work in IE11

只谈情不闲聊 提交于 2020-06-13 05:52:09
问题 I'm building a prototype for a simple 3-panels slide thing. On the second panel, I'd like to use css-grid to have a simple way to divide the panel into 4 equal and responsive areas, 100% container's height. Here's the demo: http://jsfiddle.net/stratboy/obnkc2x5/1/ Some of the code: <div class="sub-grid-container"> <div class="sub-grid-item">sub 1</div> <div class="sub-grid-item">sub 2</div> <div class="sub-grid-item">sub 3</div> <div class="sub-grid-item">sub 4</div> </div> And the relevant

How to make this simple css-grid layout work in IE11

梦想与她 提交于 2020-06-13 05:51:05
问题 I'm building a prototype for a simple 3-panels slide thing. On the second panel, I'd like to use css-grid to have a simple way to divide the panel into 4 equal and responsive areas, 100% container's height. Here's the demo: http://jsfiddle.net/stratboy/obnkc2x5/1/ Some of the code: <div class="sub-grid-container"> <div class="sub-grid-item">sub 1</div> <div class="sub-grid-item">sub 2</div> <div class="sub-grid-item">sub 3</div> <div class="sub-grid-item">sub 4</div> </div> And the relevant

从0开始搭建vue+webpack脚手架(二)

守給你的承諾、 提交于 2020-05-08 04:02:02
接着 从0开始搭建vue+webpack脚手架(一) 三、配置webpack-dev-server   1. webpack-dev-server自带一个node的服务器, 项目在服务端运行的同时可以实现热更新加载   2. 安装兼容环境变量的包 cross-env   (1)原因: 构建项目时分生产环境和开发环境,此时webpack需要配置production和development模式,需要使用一个变量来作条件判断,而不同的平台上设置环境变量方式不同,在Mac平台是 NODE_ENV=production 而windows平台上是set NODE_ENV=production,,所以需要使用cross-env   (2)安装 1 $ npm i -D cross-env   (3)将package.json运行脚本改为如下: 1 "scripts" : { 2 "test": "echo \"Error: no test specified\" && exit 1" , 3 "build": "cross-env NODE_ENV=production webpack --progress --colors" , 4 "dev": "cross-env NODE_ENV=development webpack-dev-server --colors --modules -

webpack with less and postcss autoprefixer

女生的网名这么多〃 提交于 2019-12-30 07:32:08
问题 I'm new to webpack and I'm trying to set everything up to work on a react project. I have managed to get everything working in webpack as expected but have hit a road block with autoprefixer. I have followed the docs for both post css and autoprefixer and I'm obviously missing something important here or have done something daft. can you please take a look at my config and let me know if you have any suggestions. Other postcss plugins are working fine like nanocss. althought I have tried

Webpack + SASS + Autoprefixer are not generating the CSS file

≡放荡痞女 提交于 2019-12-25 18:44:29
问题 I would like to compile my SCSS files to main.min.css with webpack. I'm using autoprefixer and the final file is not being generated . I tried a lot of options and I'm stuck now. What could be? Basically, I'm developing on root/src/styles/...scss and I need to transpile and create a minified file in root/css with the name main.min.css. My package.json: { "name": "rms", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "build": "webpack", "start": "webpack-dev-server -

How to use autoprefixer with Webpack 1.x.x?

£可爱£侵袭症+ 提交于 2019-12-25 08:28:35
问题 I'm writing an Angular 1.5.x app with components that embed their own style. The <leave-calendar> component define a linear-gradient background which works fine on Firefox but need the vendor prefix in Chromium. Here is what I have done so far: Requirements a working component ; installed postcss-loader : yarn add --dev postcss-loader add browserslist to package.json : "browserslist": [ "> 1%", "last 2 versions", "ie 9" ] leave-calendar.html <style lang="scss"> .leave-draft { background-color

Is there a way to test if PostCSS Autoprefixer is working? Specifically for Rails 6

*爱你&永不变心* 提交于 2019-12-23 17:24:03
问题 I am writing a Rails 6 webapp using Webpacker. Its my understanding that auto-prefixing in Rails 6 works out of the box via PostCSS and its autoprefixer plugin. However I cannot verify if this library is in fact prefixing my css or not. Is there a way to confirm if a standard default Rails 6.0.0 app auto-prefixes out of the box? I have run yarn autoprefixer --info to see the css rules and browsers it applies to and its def applying to my browser chrome 77 . And I tried using a parameter that

Gulp Autoprefixer Not Working

微笑、不失礼 提交于 2019-12-19 03:19:08
问题 I'm unable to get Autoprefixer to work with Gulp. I'm using opacity in my CSS, gradients, and transforms and there aren't any vendor prefixes showing up. Otherwise, everything else is working. Here's my gulp file: var gulp = require('gulp'); var lr = require('tiny-lr'); var jshint = require('gulp-jshint'); var sass = require('gulp-sass'); var autoprefixer = require('gulp-autoprefixer'); var minifycss = require('gulp-minify-css'); var concat = require('gulp-concat'); var rename = require('gulp