Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3 #1

Merged
merged 2 commits into from
May 25, 2017
Merged

v3 #1

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

[*.{cmd,bat}]
end_of_line = crlf

[{package.json,.travis.yml,appveyor.yml,.gitlab-ci.yml}]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
coverage
71 changes: 65 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,85 @@
],
"root": true,
"rules": {
"arrow-spacing": [
"error",
{
"after": true,
"before": true
}
],
"comma-spacing": [
"error",
{
"after": true,
"before": false
}
],
"comma-dangle": [
"error",
"always-multiline"
],
"eqeqeq": [
"error",
"smart"
],
"indent": [
"error",
"tab",
{
"SwitchCase": 1
}
],
"quotes": [
"key-spacing": [
"error"
],
"keyword-spacing": [
"error"
],
"no-var": [
"error"
],
"no-console": [
"error",
"double",
{
"allowTemplateLiterals": true,
"avoidEscape": true
"allow": [
"warn",
"error"
]
}
],
"valid-jsdoc": [
"prefer-const": [
"error"
],
"quotes": [
"error",
"single"
],
"semi": [
"error"
],
"space-before-function-paren": [
"error"
],
"space-before-blocks": [
"error"
],
"space-infix-ops": [
"error"
],
"spaced-comment": [
"error",
"always"
],
"strict": [
"error",
"safe"
],
"valid-jsdoc": [
"warn",
{
"requireReturn": false
}
]
}
}
}
30 changes: 28 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,58 @@
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
node_modules
# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

32 changes: 0 additions & 32 deletions .jshintrc

This file was deleted.

12 changes: 6 additions & 6 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
*.log
*.pid
*.seed
lib-cov
coverage
.csscomb.json
.editorconfig
.eslintrc*
.eslintignore
.gitignore
.grunt
.jshintrc
.eslintrc.json
.lock-wscript
.node_repl_history
.stylelintrc*
.travis.yml
.vscode
.nyc_output
appveyor.yml
build
coverage
gulpfile.js
lib-cov
Expand Down
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
sudo: false

language: node_js

node_js:
- "stable"
- "6"
- "4"
- "0.12"

after_success:
- "npm run coveralls"
- "npm run coveralls"
62 changes: 25 additions & 37 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,41 @@
[![AppVeyor](https://img.shields.io/appveyor/ci/gucong3000/postcss-pie.svg?&label=Windows)](https://ci.appveyor.com/project/gucong3000/postcss-pie)
[![Coverage Status](https://img.shields.io/coveralls/gucong3000/postcss-pie.svg)](https://coveralls.io/r/gucong3000/postcss-pie)

makes IE several of the most useful CSS3 decoration features

让IE兼容最常用的几个CSS3特性
使IE能够显示一些最有用的CSS3的装饰特性。

------

[English](README.md)

postcss-pie 由[PostCSS](https://github.com/postcss/postcss)与[PIE](http://css3pie.com/)驱动,让IE6-IE9兼容CSS3特性:
* [border-radius](https://developer.mozilla.org/zh-CN/docs/Web/CSS/border-radius)
* [box-shadow](https://developer.mozilla.org/zh-CN/docs/Web/CSS/box-shadow)
* [border-image](https://developer.mozilla.org/zh-CN/docs/Web/CSS/border-image)
* [CSS3 Backgrounds](https://developer.mozilla.org/zh-CN/docs/Web/CSS/CSS_Background_and_Borders/Using_CSS_multiple_backgrounds)
* [Gradients](https://developer.mozilla.org/zh-CN/docs/Web/CSS/CSS_Images/Using_CSS_gradients)
postcss-pie 由[PostCSS](https://github.com/postcss/postcss)与[PIE](http://css3pie.com/)驱动,让IE6-IE9兼容这些CSS3特性:
* [border-radius](https://developer.mozilla.org/zh-CN/docs/Web/CSS/border-radius)
* [box-shadow](https://developer.mozilla.org/zh-CN/docs/Web/CSS/box-shadow)
* [border-image](https://developer.mozilla.org/zh-CN/docs/Web/CSS/border-image)
* [CSS3 Backgrounds](https://developer.mozilla.org/zh-CN/docs/Web/CSS/CSS_Background_and_Borders/Using_CSS_multiple_backgrounds)
* [Gradients](https://developer.mozilla.org/zh-CN/docs/Web/CSS/CSS_Images/Using_CSS_gradients)

## Usage

1. [下载PIE](http://css3pie.com/download-latest),解压所有文件到HTML文档所在服务器的某个目录, 如`/path/to/pie_files/`
1. 配置你的postcss
```JavaScript
var postcss = require('postcss');
var pie = require('postcss-pie');

postcss([
pie({
htcPath: '/path/to/pie_files/PIE.htc',
pieLoadPath: 'http://cdn.server/path/to/js-files/',
});
]);
```

1. [确保正确的Content-Type](http://css3pie.com/documentation/known-issues/#content-type)

如果IE在请求PIE.htc文件时,HTTP响应头中的Content-Type不是"text/x-component",会造成功能失效。
在大部分服务器默认配置下,都不会出现这个问题。如果出现此问题,如Apache,请在.htaccess 文件中添加:

```
AddType text/x-component .htc
```
[下载PIE](http://css3pie.com/download/),解压所有文件,部署到web服务器的某个目录, 如`/pie/`
配置你的postcss

## Options
```JavaScript
var postcss = require('postcss');
var pie = require('postcss-pie');

函数 pie(options) 返回一个新的PostCSS插件。参见[PostCSS API](https://github.com/postcss/postcss/blob/master/docs/api.md)中的插件使用文档。
postcss([
pie({
// 必须使用绝对地址,且必须与html同一个域名,不得跨域,不得使用CDN地址。
htcPath: '/pie/PIE.htc',
// PIE的其他文件所在目录的路径,必须是完整url,可以是cdn地址。
pieLoadPath: 'http://server.com/pie/',
});
]);
```

一共有两个选项:
## [确保正确的Content-Type](http://css3pie.com/documentation/known-issues/#content-type)

* `htcPath` (string): `PIE.htc` 的所在路径,文件必须放在HTML文档所在服务器,路径必须使用`/`开头的绝对路径(不支持跨域名使用)。不使用此选项,则不会调用htc文件,此时你需要[使用JS方式激活](http://css3pie.com/documentation/pie-js/)
* `pieLoadPath` (string): `PIE_IE9.js`和`PIE_IE678.js`所在目录的路径,必须为完整的URL路径,不使用此属性时,则自动从`PIE.htc`所在目录加载js文件。如果未声明`htcPath`属性,则此项配置无效。
如果IE在请求PIE.htc文件时,HTTP响应头中的Content-Type不是"text/x-component",会造成功能失效。
详见[PIE相关文档](http://css3pie.com/documentation/known-issues/#content-type)

## [PIE的文档](http://css3pie.com/documentation/)
## [PIE的文档](http://css3pie.com/documentation/)
Loading