postcss 6.0.19 → 6.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of postcss might be problematic. Click here for more details.

package/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
+ ## 6.0.23
5
+ * Fix parsing nested at-rules without semicolon, params, and spaces.
6
+
7
+ ## 6.0.22
8
+ * Fix `Node#prev` and `Node#next` on missed parent.
9
+
10
+ ## 6.0.21
11
+ * Rename Chinese docs to fix `yarnpkg.com` issue.
12
+
13
+ ## 6.0.20
14
+ * Better error message on `null` as input CSS.
15
+
4
16
  ## 6.0.19
5
17
  * Fix TypeScript definitions for source maps (by Oleh Kuchuk).
6
18
  * Fix `source` field in TypeScript definitions (by Sylvain Pollet-Villard).
@@ -0,0 +1,78 @@
1
+ # Contributing Guide to PostCSS
2
+
3
+ If you want contribute to PostCSS, there are few things that you should
4
+ be familiar with.
5
+
6
+
7
+ ## In Case You Have Question About Using PostCSS
8
+
9
+ * **Ask for help in [the chat]**
10
+
11
+ If you stuck on something there is a big chance
12
+ that someone had similar problem before.
13
+
14
+ [the chat]: https://gitter.im/postcss/postcss
15
+
16
+
17
+ ## Adding Your Plugin to the List
18
+
19
+ If you created or found a plugin and want to add it to PostCSS plugins list
20
+ follow this simple steps.
21
+
22
+ PR should not change plugins defined in README it contains only favorite plugins
23
+ and moderated by PostCSS author.
24
+
25
+ Plugins submitted by community located in [`docs/plugins`].
26
+
27
+ * **Keep plugins order**
28
+
29
+ Be sure that plugin not presented yet and find suitable position
30
+ in alphabetic order for it.
31
+ But plugins with `postcss-` prefix should come first.
32
+
33
+ * **Check spelling**
34
+
35
+ Before submitting PR be sure that spelling check pass.
36
+ For that run command `npm test`.
37
+ If it fails with unknown word error, add it as word
38
+ to `.yaspellerrc` dictionary.
39
+
40
+ * **Check PostCSS plugin guideline**
41
+
42
+ Provided plugin should match plugin [guidelines].
43
+
44
+ - **Provide link to suggested plugin**
45
+
46
+ Make sure your pull request description contains link to plugin
47
+ you are willing to add.
48
+
49
+ [`docs/plugins`]: https://github.com/postcss/postcss/blob/master/docs/plugins.md
50
+ [guidelines]: https://github.com/postcss/postcss/blob/master/docs/guidelines/plugin.md
51
+
52
+
53
+ ## TypeScript Declaration Improvements
54
+
55
+ If you found a bug or want to add certain improvements to types declaration file
56
+
57
+ * **Check current TypeScript styling**
58
+
59
+ Be sure that your changes match TypeScript styling rules defined in typings file.
60
+ * We use classes for existing JS classes like `Stringifier`.
61
+ * Namespaces used for separating functions related to same subject.
62
+ * Interfaces used for defining custom types.
63
+
64
+ Make sure you read through declaration file writing [best practices]
65
+ by TypeScript team.
66
+
67
+ [best practices]: https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html
68
+
69
+
70
+ ## Core Development
71
+
72
+ If you want to add new feature or fix existed issue
73
+
74
+ - **Become familiar with PostCSS architecture**
75
+
76
+ For gentle intro to PostCSS architecture look through our [guide].
77
+
78
+ [guide]: https://github.com/postcss/postcss/blob/master/docs/architecture.md
@@ -1,15 +1,11 @@
1
- # PostCSS [![Travis Build Status][travis-img]][travis] [![AppVeyor Build Status][appveyor-img]][appveyor] [![Gitter][chat-img]][chat]
1
+ # PostCSS [![Gitter][chat-img]][chat]
2
2
 
3
3
  <img align="right" width="95" height="95"
4
4
  alt="哲学家的石头 - PostCSS 的 logo"
5
5
  src="http://postcss.github.io/postcss/logo.svg">
6
6
 
7
- [appveyor-img]: https://img.shields.io/appveyor/ci/ai/postcss.svg?label=windows
8
- [travis-img]: https://img.shields.io/travis/postcss/postcss.svg?label=unix
9
- [chat-img]: https://img.shields.io/badge/Gitter-Join_the_PostCSS_chat-brightgreen.svg
10
- [appveyor]: https://ci.appveyor.com/project/ai/postcss
11
- [travis]: https://travis-ci.org/postcss/postcss
12
- [chat]: https://gitter.im/postcss/postcss
7
+ [chat-img]: https://img.shields.io/badge/Gitter-Join_the_PostCSS_chat-brightgreen.svg
8
+ [chat]: https://gitter.im/postcss/postcss
13
9
 
14
10
  PostCSS 是一个允许使用 JS 插件转换样式的工具。
15
11
  这些插件可以检查(lint)你的 CSS,支持 CSS Variables 和 Mixins,
@@ -18,14 +14,18 @@ PostCSS 是一个允许使用 JS 插件转换样式的工具。
18
14
  PostCSS 在工业界被广泛地应用,其中不乏很多有名的行业领导者,如:维基百科,Twitter,阿里巴巴,
19
15
  JetBrains。PostCSS 的 [Autoprefixer] 插件是最流行的 CSS 处理工具之一。
20
16
 
21
- **Twitter 账号:** [@postcss](https://twitter.com/postcss)。<br>
22
- **支持 / 讨论:** [Gitter](https://gitter.im/postcss/postcss)。<br>
17
+ PostCSS 接收一个 CSS 文件并提供了一个 API 来分析、修改它的规则(通过把 CSS 规则转换成一个[抽象语法树]的方式)。在这之后,这个 API 便可被许多[插件]利用来做有用的事情,比如寻错或自动添加 CSS vendor 前缀。
18
+
19
+ **Twitter 账号:** [@postcss](https://twitter.com/postcss)<br>
20
+ **支持 / 讨论:** [Gitter](https://gitter.im/postcss/postcss)<br>
23
21
 
24
22
  如果需要 PostCSS 商业支持(如咨询,提升公司的前端文化,
25
23
  PostCSS 插件),请联系 [Evil Martians](https://evilmartians.com/?utm_source=postcss)
26
24
  邮箱 <surrender@evilmartians.com>。
27
25
 
26
+ [抽象语法树]: https://zh.wikipedia.org/wiki/%E6%8A%BD%E8%B1%A1%E8%AA%9E%E6%B3%95%E6%A8%B9
28
27
  [Autoprefixer]: https://github.com/postcss/autoprefixer
28
+ [插件]: https://github.com/postcss/postcss/blob/master/README-cn.md#%E6%8F%92%E4%BB%B6
29
29
 
30
30
  <a href="https://evilmartians.com/?utm_source=postcss">
31
31
  <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
@@ -53,8 +53,7 @@ PostCSS 插件),请联系 [Evil Martians](https://evilmartians.com/?utm_sou
53
53
  ### 提前使用先进的 CSS 特性
54
54
 
55
55
  * [`autoprefixer`] 添加了 vendor 浏览器前缀,它使用 Can I Use 上面的数据。
56
- * [`postcss-cssnext`] 允许你使用未来的 CSS 特性(包括 `autoprefixer`)。
57
- * [`postcss-image-set-polyfill`] 为所有浏览器模拟了 [`image-set`] 函数逻辑。
56
+ * [`postcss-preset-env`] 允许你使用未来的 CSS 特性。
58
57
 
59
58
  ### 更佳的 CSS 可读性
60
59
 
@@ -85,8 +84,8 @@ PostCSS 插件),请联系 [Evil Martians](https://evilmartians.com/?utm_sou
85
84
  * [`lost`] 是一个功能强大的 `calc()` 栅格系统。
86
85
  * [`rtlcss`] 镜像翻转 CSS 样式,适用于 right-to-left 的应用场景。
87
86
 
88
- [`postcss-image-set-polyfill`]: https://github.com/SuperOl3g/postcss-image-set-polyfill
89
87
  [`postcss-inline-svg`]: https://github.com/TrySound/postcss-inline-svg
88
+ [`postcss-preset-env`]: https://github.com/jonathantneal/postcss-preset-env
90
89
  [`react-css-modules`]: https://github.com/gajus/react-css-modules
91
90
  [`postcss-autoreset`]: https://github.com/maximkoretskiy/postcss-autoreset
92
91
  [`postcss-write-svg`]: https://github.com/jonathantneal/postcss-write-svg
@@ -95,7 +94,6 @@ PostCSS 插件),请联系 [Evil Martians](https://evilmartians.com/?utm_sou
95
94
  [`postcss-sprites`]: https://github.com/2createStudio/postcss-sprites
96
95
  [`postcss-modules`]: https://github.com/outpunk/postcss-modules
97
96
  [`postcss-sorting`]: https://github.com/hudochenkov/postcss-sorting
98
- [`postcss-cssnext`]: http://cssnext.io
99
97
  [`postcss-assets`]: https://github.com/assetsjs/postcss-assets
100
98
  [开发 PostCSS 插件]: https://github.com/postcss/postcss/blob/master/docs/writing-a-plugin.md
101
99
  [`font-magician`]: https://github.com/jonathantneal/postcss-font-magician
@@ -106,7 +104,6 @@ PostCSS 插件),请联系 [Evil Martians](https://evilmartians.com/?utm_sou
106
104
  [`css-modules`]: https://github.com/css-modules/css-modules
107
105
  [`colorguard`]: https://github.com/SlexAxton/css-colorguard
108
106
  [`stylelint`]: https://github.com/stylelint/stylelint
109
- [`image-set`]: https://drafts.csswg.org/css-images-4/#image-set-notation
110
107
  [`stylefmt`]: https://github.com/morishitter/stylefmt
111
108
  [`cssnano`]: http://cssnano.co
112
109
  [`precss`]: https://github.com/jonathantneal/precss
@@ -121,7 +118,11 @@ PostCSS 可以转化样式到任意语法,不仅仅是 CSS。
121
118
  如果还没有支持你最喜欢的语法,你可以编写一个解释器以及(或者)一个 stringifier 来拓展 PostCSS。
122
119
 
123
120
  * [`sugarss`] 是一个以缩进为基础的语法,类似于 Sass 和 Stylus。
124
- * [`postcss-html`] 允许你在 HTML / [Markdown](https://daringfireball.net/projects/markdown/syntax) / [Vue component](https://vue-loader.vuejs.org/) 里编写样式。
121
+ * [`postcss-syntax`] 通过文件扩展名自动切换语法。
122
+ * [`postcss-html`] 解析类 HTML 文件里`<style>`标签中的样式。
123
+ * [`postcss-markdown`] 解析 Markdown 文件里代码块中的样式。
124
+ * [`postcss-jsx`] 解析源文件里模板或对象字面量中的CSS。
125
+ * [`postcss-styled`] 解析源文件里模板字面量中的CSS。
125
126
  * [`postcss-scss`] 允许你使用 SCSS *(但并没有将 SCSS 编译到 CSS)*。
126
127
  * [`postcss-sass`] 允许你使用 Sass *(但并没有将 Sass 编译到 CSS)*。
127
128
  * [`postcss-less`] 允许你使用 Less *(但并没有将 LESS 编译到 CSS)*。
@@ -132,7 +133,11 @@ PostCSS 可以转化样式到任意语法,不仅仅是 CSS。
132
133
 
133
134
  [`postcss-less-engine`]: https://github.com/Crunch/postcss-less
134
135
  [`postcss-safe-parser`]: https://github.com/postcss/postcss-safe-parser
136
+ [`postcss-syntax`]: https://github.com/gucong3000/postcss-syntax
135
137
  [`postcss-html`]: https://github.com/gucong3000/postcss-html
138
+ [`postcss-markdown`]: https://github.com/gucong3000/postcss-markdown
139
+ [`postcss-jsx`]: https://github.com/gucong3000/postcss-jsx
140
+ [`postcss-styled`]: https://github.com/gucong3000/postcss-styled
136
141
  [`postcss-scss`]: https://github.com/postcss/postcss-scss
137
142
  [`postcss-sass`]: https://github.com/AleshaOleg/postcss-sass
138
143
  [`postcss-less`]: https://github.com/webschik/postcss-less
package/README.md CHANGED
@@ -1,15 +1,11 @@
1
- # PostCSS [![Travis Build Status][travis-img]][travis] [![AppVeyor Build Status][appveyor-img]][appveyor] [![Gitter][chat-img]][chat]
1
+ # PostCSS [![Gitter][chat-img]][chat]
2
2
 
3
3
  <img align="right" width="95" height="95"
4
4
  alt="Philosopher’s stone, logo of PostCSS"
5
5
  src="http://postcss.github.io/postcss/logo.svg">
6
6
 
7
- [appveyor-img]: https://img.shields.io/appveyor/ci/ai/postcss.svg?label=windows
8
- [travis-img]: https://img.shields.io/travis/postcss/postcss.svg?label=unix
9
- [chat-img]: https://img.shields.io/badge/Gitter-Join_the_PostCSS_chat-brightgreen.svg
10
- [appveyor]: https://ci.appveyor.com/project/ai/postcss
11
- [travis]: https://travis-ci.org/postcss/postcss
12
- [chat]: https://gitter.im/postcss/postcss
7
+ [chat-img]: https://img.shields.io/badge/Gitter-Join_the_PostCSS_chat-brightgreen.svg
8
+ [chat]: https://gitter.im/postcss/postcss
13
9
 
14
10
  PostCSS is a tool for transforming styles with JS plugins.
15
11
  These plugins can lint your CSS, support variables and mixins,
@@ -19,16 +15,23 @@ PostCSS is used by industry leaders including Wikipedia, Twitter, Alibaba,
19
15
  and JetBrains. The [Autoprefixer] PostCSS plugin is one of the most popular
20
16
  CSS processors.
21
17
 
22
- **Twitter account:** [@postcss](https://twitter.com/postcss).<br>
23
- **VK.com page:** [postcss](https://vk.com/postcss).<br>
24
- **Support / Discussion:** [Gitter](https://gitter.im/postcss/postcss).<br>
25
- **中文翻译**: [`README.cn.md`](./README.cn.md).
18
+ PostCSS takes a CSS file and provides an API to analyze and modify its rules
19
+ (by transforming them into an [Abstract Syntax Tree]).
20
+ This API can then be used by [plugins] to do a lot of useful things,
21
+ e.g. to find errors automatically insert vendor prefixes.
22
+
23
+ **Support / Discussion:** [Gitter](https://gitter.im/postcss/postcss)<br>
24
+ **Twitter account:** [@postcss](https://twitter.com/postcss)<br>
25
+ **VK.com page:** [postcss](https://vk.com/postcss)<br>
26
+ **中文翻译**: [`README-cn.md`](./README-cn.md)
26
27
 
27
28
  For PostCSS commercial support (consulting, improving the front-end culture
28
29
  of your company, PostCSS plugins), contact [Evil Martians](https://evilmartians.com/?utm_source=postcss)
29
30
  at <surrender@evilmartians.com>.
30
31
 
31
- [Autoprefixer]: https://github.com/postcss/autoprefixer
32
+ [Abstract Syntax Tree]: https://en.wikipedia.org/wiki/Abstract_syntax_tree
33
+ [Autoprefixer]: https://github.com/postcss/autoprefixer
34
+ [plugins]: https://github.com/postcss/postcss#plugins
32
35
 
33
36
  <a href="https://evilmartians.com/?utm_source=postcss">
34
37
  <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
@@ -63,9 +66,7 @@ If you have any new ideas, [PostCSS plugin development] is really easy.
63
66
  ### Use Future CSS, Today
64
67
 
65
68
  * [`autoprefixer`] adds vendor prefixes, using data from Can I Use.
66
- * [`postcss-cssnext`] allows you to use future CSS features today
67
- (includes `autoprefixer`).
68
- * [`postcss-image-set-polyfill`] emulates [`image-set`] function logic for all browsers
69
+ * [`postcss-preset-env`] allows you to use future CSS features today.
69
70
 
70
71
  ### Better CSS Readability
71
72
 
@@ -98,9 +99,9 @@ If you have any new ideas, [PostCSS plugin development] is really easy.
98
99
  * [`lost`] is a feature-rich `calc()` grid system.
99
100
  * [`rtlcss`] mirrors styles for right-to-left locales.
100
101
 
101
- [`postcss-image-set-polyfill`]: https://github.com/SuperOl3g/postcss-image-set-polyfill
102
102
  [PostCSS plugin development]: https://github.com/postcss/postcss/blob/master/docs/writing-a-plugin.md
103
103
  [`postcss-inline-svg`]: https://github.com/TrySound/postcss-inline-svg
104
+ [`postcss-preset-env`]: https://github.com/jonathantneal/postcss-preset-env
104
105
  [`react-css-modules`]: https://github.com/gajus/react-css-modules
105
106
  [`postcss-autoreset`]: https://github.com/maximkoretskiy/postcss-autoreset
106
107
  [`postcss-write-svg`]: https://github.com/jonathantneal/postcss-write-svg
@@ -109,7 +110,6 @@ If you have any new ideas, [PostCSS plugin development] is really easy.
109
110
  [`postcss-sprites`]: https://github.com/2createStudio/postcss-sprites
110
111
  [`postcss-modules`]: https://github.com/outpunk/postcss-modules
111
112
  [`postcss-sorting`]: https://github.com/hudochenkov/postcss-sorting
112
- [`postcss-cssnext`]: http://cssnext.io
113
113
  [`postcss-assets`]: https://github.com/assetsjs/postcss-assets
114
114
  [`font-magician`]: https://github.com/jonathantneal/postcss-font-magician
115
115
  [`autoprefixer`]: https://github.com/postcss/autoprefixer
@@ -119,7 +119,6 @@ If you have any new ideas, [PostCSS plugin development] is really easy.
119
119
  [`css-modules`]: https://github.com/css-modules/css-modules
120
120
  [`colorguard`]: https://github.com/SlexAxton/css-colorguard
121
121
  [`stylelint`]: https://github.com/stylelint/stylelint
122
- [`image-set`]: https://drafts.csswg.org/css-images-4/#image-set-notation
123
122
  [`stylefmt`]: https://github.com/morishitter/stylefmt
124
123
  [`cssnano`]: http://cssnano.co
125
124
  [`precss`]: https://github.com/jonathantneal/precss
@@ -135,7 +134,11 @@ If there is not yet support for your favorite syntax,
135
134
  you can write a parser and/or stringifier to extend PostCSS.
136
135
 
137
136
  * [`sugarss`] is a indent-based syntax like Sass or Stylus.
138
- * [`postcss-html`] allows you to write styles in HTML / [Markdown](https://daringfireball.net/projects/markdown/syntax) / [Vue component](https://vue-loader.vuejs.org/)
137
+ * [`postcss-syntax`] switch syntax automatically by file extensions.
138
+ * [`postcss-html`] parsing styles in `<style>` tags of HTML-like files.
139
+ * [`postcss-markdown`] parsing styles in code blocks of Markdown files.
140
+ * [`postcss-jsx`] parsing CSS in template / object literals of source files.
141
+ * [`postcss-styled`] parsing CSS in template literals of source files.
139
142
  * [`postcss-scss`] allows you to work with SCSS
140
143
  *(but does not compile SCSS to CSS)*.
141
144
  * [`postcss-sass`] allows you to work with Sass
@@ -151,7 +154,11 @@ you can write a parser and/or stringifier to extend PostCSS.
151
154
 
152
155
  [`postcss-less-engine`]: https://github.com/Crunch/postcss-less
153
156
  [`postcss-safe-parser`]: https://github.com/postcss/postcss-safe-parser
157
+ [`postcss-syntax`]: https://github.com/gucong3000/postcss-syntax
154
158
  [`postcss-html`]: https://github.com/gucong3000/postcss-html
159
+ [`postcss-markdown`]: https://github.com/gucong3000/postcss-markdown
160
+ [`postcss-jsx`]: https://github.com/gucong3000/postcss-jsx
161
+ [`postcss-styled`]: https://github.com/gucong3000/postcss-styled
155
162
  [`postcss-scss`]: https://github.com/postcss/postcss-scss
156
163
  [`postcss-sass`]: https://github.com/AleshaOleg/postcss-sass
157
164
  [`postcss-less`]: https://github.com/webschik/postcss-less
@@ -304,8 +311,10 @@ fs.readFile('src/app.css', (err, css) => {
304
311
  postcss([precss, autoprefixer])
305
312
  .process(css, { from: 'src/app.css', to: 'dest/app.css' })
306
313
  .then(result => {
307
- fs.writeFile('dest/app.css', result.css);
308
- if ( result.map ) fs.writeFile('dest/app.css.map', result.map);
314
+ fs.writeFile('dest/app.css', result.css, () => true);
315
+ if ( result.map ) {
316
+ fs.writeFile('dest/app.css.map', result.map, () => true);
317
+ }
309
318
  });
310
319
  });
311
320
  ```
@@ -0,0 +1,156 @@
1
+ ## PostCSS Architecture
2
+
3
+ General overview of PostCSS architecture.
4
+ It can be useful for everyone who wish to contribute to core or develop better understanding of the tool.
5
+
6
+ **Table of Contents**
7
+
8
+ - [Overview](#overview)
9
+ - [Workflow](#workflow)
10
+ - [Core Structures](#core-structures)
11
+ * [Tokenizer](#tokenizer--libtokenizees6-)
12
+ * [Parser](#parser--libparsees6-libparseres6-)
13
+ * [Processor](#processor--libprocessores6-)
14
+ * [Stringifier](#stringifier--libstringifyes6-libstringifieres6-)
15
+ - [API](#api-reference)
16
+
17
+ ### Overview
18
+
19
+ > This section describes ideas lying behind PostCSS
20
+
21
+ Before diving deeper into development of PostCSS let's briefly describe what is PostCSS and what is not.
22
+
23
+ **PostCSS**
24
+
25
+ - *is **NOT** a style preprocessor like `Sass` or `Less`.*
26
+
27
+ It does not define custom syntax and semantic, it's not actually a language.
28
+ PostCSS works with CSS and can be easily integrated with tools described above. That being said any valid CSS can be processed by PostCSS.
29
+
30
+ - *is a tool for CSS syntax transformations*
31
+
32
+ It allows you to define custom CSS like syntax that could be understandable and transformed by plugins. That being said PostCSS is not strictly about CSS spec but about syntax definition manner of CSS. In such way you can define custom syntax constructs like at-rule, that could be very helpful for tools build around PostCSS. PostCSS plays a role of framework for building outstanding tools for CSS manipulations.
33
+
34
+ - *is a big player in CSS ecosystem*
35
+
36
+ Large amount of lovely tools like `Autoprefixer`, `Stylelint`, `CSSnano` were built on PostCSS ecosystem. There is big chance that you already use it implicitly, just check your `node_modules` :smiley:
37
+
38
+ ### Workflow
39
+
40
+ This is high level overview of whole PostCSS workflow
41
+
42
+ <img width="300" src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/PostCSS_scheme.svg/512px-PostCSS_scheme.svg.png" alt="workflow">
43
+
44
+ As you can see from diagram above, PostCSS architecture is pretty straightforward but some parts of it could be misunderstood.
45
+
46
+ From diagram above you can see part called *Parser*, this construct will be described in details later on, just for now think about it as a structure that can understand your CSS like syntax and create object representation of it.
47
+
48
+ That being said, there are few ways to write parser
49
+
50
+ - *Write a single file with string to AST transformation*
51
+
52
+ This method is quite popular, for example, the [Rework analyzer](https://github.com/reworkcss/css/blob/master/lib/parse/index.js) was written in this style. But with a large code base, the code becomes hard to read and pretty slow.
53
+
54
+ - *Split it into lexical analysis/parsing steps (source string → tokens → AST)*
55
+
56
+ This is the way of how we do it in PostCSS and also the most popular one.
57
+ A lot of parsers like [`Babylon` (parser behind Babel)](https://github.com/babel/babel/tree/master/packages/babylon), [`CSSTree`](https://github.com/csstree/csstree) were written in such way.
58
+ The main reasons to separate tokenization from parsing steps are performance and abstracting complexity.
59
+
60
+ Let think about why second way is better for our needs.
61
+
62
+ First of all because string to tokens step takes more time than parsing step. We operate on large source string and process it char by char, this is why it is very inefficient operation in terms of performance and we should perform it only once.
63
+
64
+ But from other side tokens to AST transformation is logically more complex so with such separation we could write very fast tokenizer (but from this comes sometimes hard to read code) and easy to read (but slow) parser.
65
+
66
+ Summing it up splitting in two steps improve performance and code readability.
67
+
68
+ So now lets look more closely on structures that play main role in PostCSS workflow.
69
+
70
+ ### Core Structures
71
+
72
+ - #### Tokenizer ( [lib/tokenize.es6](https://github.com/postcss/postcss/blob/master/lib/tokenize.es6) )
73
+
74
+ Tokenizer (aka Lexer) plays important role in syntax analysis.
75
+
76
+ It accepts CSS string and returns list of tokens.
77
+
78
+ Token is a simple structure that describes some part of syntax like `at-rule`, `comment` or `word`. It can also contain positional information for more descriptive errors.
79
+
80
+ For example if we consider following css
81
+
82
+ ```css
83
+ .className { color: #FFF; }
84
+ ```
85
+
86
+ corresponding tokens representation from PostCSS will be
87
+ ```js
88
+ [
89
+ ["word", ".className", 1, 1, 1, 10]
90
+ ["space", " "]
91
+ ["{", "{", 1, 12]
92
+ ["space", " "]
93
+ ["word", "color", 1, 14, 1, 18]
94
+ [":", ":", 1, 19]
95
+ ["space", " "]
96
+ ["word", "#FFF" , 1, 21, 1, 23]
97
+ [";", ";", 1, 24]
98
+ ["space", " "]
99
+ ["}", "}", 1, 26]
100
+ ]
101
+ ```
102
+
103
+ As you can see from the example above single token represented as a list and also `space` token doesn't have positional information.
104
+
105
+ Lets look more closely on single token like `word`. As it was said each token represented as a list and follow such pattern.
106
+
107
+ ```js
108
+ const token = [
109
+ // represents token type
110
+ 'word',
111
+
112
+ // represents matched word
113
+ '.className',
114
+
115
+ // This two numbers represent start position of token.
116
+ // It's optional value as we saw in example above,
117
+ // tokens like `space` don't have such information.
118
+
119
+ // Here the first number is line number and the second one is corresponding column.
120
+ 1, 1,
121
+
122
+ // Next two numbers also optional and represent end position for multichar tokens like this one. Numbers follow same rule as was described above
123
+ 1, 10
124
+ ];
125
+ ```
126
+ There are many patterns how tokenization could be done, PostCSS motto is performance and simplicity. Tokenization is complex computing operation and take large amount of syntax analysis time ( ~90% ), that why PostCSS' Tokenizer looks dirty but it was optimized for speed. Any high-level constructs like classes could dramatically slow down tokenizer.
127
+
128
+ PostCSS' Tokenizer use some sort of streaming/chaining API where you exposes [`nextToken()`](https://github.com/postcss/postcss/blob/master/lib/tokenize.es6#L48-L308) method to Parser. In this manner we provide clean interface for Parser and reduce memory usage by storing only few tokens and not whole list of tokens.
129
+
130
+ - #### Parser ( [lib/parse.es6](https://github.com/postcss/postcss/blob/master/lib/parse.es6), [lib/parser.es6](https://github.com/postcss/postcss/blob/master/lib/parser.es6) )
131
+
132
+ Parser is main structure that responsible for [syntax analysis](https://en.wikipedia.org/wiki/Parsing) of incoming CSS. Parser produces structure called [Abstract Syntax Tree (AST)](https://en.wikipedia.org/wiki/Abstract_syntax_tree) that could then be transformed by plugins later on.
133
+
134
+ Parser works in common with Tokenizer and operates over tokens not source string, as it would be very inefficient operation.
135
+
136
+ It use mostly `nextToken` and `back` methods provided by Tokenizer for obtaining single or multiple tokens and than construct part of AST called `Node`
137
+
138
+ There are multiple Node types that PostCSS could produce but all of them inherit from base Node [class](https://github.com/postcss/postcss/blob/master/lib/node.es6#L34).
139
+
140
+ - #### Processor ( [lib/processor.es6](https://github.com/postcss/postcss/blob/master/lib/processor.es6) )
141
+
142
+ Processor is a very plain structure that initializes plugins and run syntax transformations. Plugin is just a function registered with [postcss.plugin](https://github.com/postcss/postcss/blob/master/lib/postcss.es6#L109) call.
143
+
144
+ It exposes quite few public API methods. Description of them could be found on [api.postcss.org/Processor](http://api.postcss.org/Processor.html)
145
+
146
+ - #### Stringifier ( [lib/stringify.es6](https://github.com/postcss/postcss/blob/master/lib/stringify.es6), [lib/stringifier.es6](https://github.com/postcss/postcss/blob/master/lib/stringifier.es6) )
147
+
148
+ Stringifier is a base class that translates modified AST to pure CSS string. Stringifier traverse AST starting from provided Node and generate raw string representation of it calling corresponding methods.
149
+
150
+ The most essential method is [`Stringifier.stringify`](https://github.com/postcss/postcss/blob/master/lib/stringifier.es6#L25-L27)
151
+ that accepts initial Node and semicolon indicator.
152
+ You can learn more by checking [stringifier.es6](https://github.com/postcss/postcss/blob/master/lib/stringifier.es6)
153
+
154
+ ### API Reference
155
+
156
+ More descriptive API documentation could be found [here](http://api.postcss.org/)
package/lib/at-rule.js CHANGED
@@ -128,4 +128,4 @@ var AtRule = function (_Container) {
128
128
 
129
129
  exports.default = AtRule;
130
130
  module.exports = exports['default'];
131
- //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImF0LXJ1bGUuZXM2Il0sIm5hbWVzIjpbIkF0UnVsZSIsImRlZmF1bHRzIiwidHlwZSIsImFwcGVuZCIsIm5vZGVzIiwiY2hpbGRyZW4iLCJwcmVwZW5kIl0sIm1hcHBpbmdzIjoiOzs7O0FBQUE7Ozs7Ozs7Ozs7OztBQUVBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7SUFrQk1BLE07OztBQUVGLGtCQUFZQyxRQUFaLEVBQXNCO0FBQUE7O0FBQUEsaURBQ2xCLHNCQUFNQSxRQUFOLENBRGtCOztBQUVsQixVQUFLQyxJQUFMLEdBQVksUUFBWjtBQUZrQjtBQUdyQjs7bUJBRURDLE0scUJBQW9CO0FBQUE7O0FBQ2hCLFFBQUssQ0FBQyxLQUFLQyxLQUFYLEVBQW1CLEtBQUtBLEtBQUwsR0FBYSxFQUFiOztBQURILHNDQUFWQyxRQUFVO0FBQVZBLGNBQVU7QUFBQTs7QUFFaEIsV0FBTyw4Q0FBTUYsTUFBTixrREFBZ0JFLFFBQWhCLEVBQVA7QUFDSCxHOzttQkFFREMsTyxzQkFBcUI7QUFBQTs7QUFDakIsUUFBSyxDQUFDLEtBQUtGLEtBQVgsRUFBbUIsS0FBS0EsS0FBTCxHQUFhLEVBQWI7O0FBREYsdUNBQVZDLFFBQVU7QUFBVkEsY0FBVTtBQUFBOztBQUVqQixXQUFPLCtDQUFNQyxPQUFO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gICAqICAgYW4gKG9wdGlvbmFsKSBzZW1pY29sb24uXG4gICAgICogKiBgYWZ0ZXJOYW1lYDogdGhlIHNwYWNlIGJldHdlZW4gdGhlIGF0LXJ1bGUgbmFtZSBhbmQgaXRzIHBhcmFtZXRlcnMuXG4gICAgICpcbiAgICAgKiBQb3N0Q1NTIGNsZWFucyBhdC1ydWxlIHBhcmFtZXRlcnMgZnJvbSBjb21tZW50cyBhbmQgZXh0cmEgc3BhY2VzLFxuICAgICAqIGJ1dCBpdCBzdG9yZXMgb3JpZ2luIGNvbnRlbnQgaW4gcmF3cyBwcm9wZXJ0aWVzLlxuICAgICAqIEFzIHN1Y2gsIGlmIHlvdSBkb27igJl0IGNoYW5nZSBhIGRlY2xhcmF0aW9u4oCZcyB2YWx1ZSxcbiAgICAgKiBQb3N0Q1NTIHdpbGwgdXNlIHRoZSByYXcgdmFsdWUgd2l0aCBjb21tZW50cy5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogY29uc3Qgcm9vdCA9IHBvc3Rjc3MucGFyc2UoJyAgQG1lZGlhXFxucHJpbnQge1xcbn0nKVxuICAgICAqIHJvb3QuZmlyc3QuZmlyc3QucmF3cyAvLz0+IHsgYmVmb3JlOiAnICAnLFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgYmV0d2VlbjogJyAnLFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgYWZ0ZXJOYW1lOiAnXFxuJyxcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgIGFmdGVyOiAnXFxuJyB9XG4gICAgICovXG59XG5cbmV4cG9ydCBkZWZhdWx0IEF0UnVsZTtcbiJdfQ==
131
+ //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImF0LXJ1bGUuZXM2Il0sIm5hbWVzIjpbIkF0UnVsZSIsImRlZmF1bHRzIiwidHlwZSIsImFwcGVuZCIsIm5v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GlvbuKAmXMgdmFsdWUsXG4gICAgICogUG9zdENTUyB3aWxsIHVzZSB0aGUgcmF3IHZhbHVlIHdpdGggY29tbWVudHMuXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIGNvbnN0IHJvb3QgPSBwb3N0Y3NzLnBhcnNlKCcgIEBtZWRpYVxcbnByaW50IHtcXG59JylcbiAgICAgKiByb290LmZpcnN0LmZpcnN0LnJhd3MgLy89PiB7IGJlZm9yZTogJyAgJyxcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgIGJldHdlZW46ICcgJyxcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgIGFmdGVyTmFtZTogJ1xcbicsXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgIC8vICAgICBhZnRlcjogJ1xcbicgfVxuICAgICAqL1xufVxuXG5leHBvcnQgZGVmYXVsdCBBdFJ1bGU7XG4iXX0=
package/lib/comment.js CHANGED
@@ -58,4 +58,4 @@ var Comment = function (_Node) {
58
58
 
59
59
  exports.default = Comment;
60
60
  module.exports = exports['default'];
61
- //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbW1lbnQuZXM2Il0sIm5hbWVzIjpbIkNvbW1lbnQiLCJkZWZhdWx0cyIsInR5cGUiXSwibWFwcGluZ3MiOiI7Ozs7QUFBQTs7Ozs7Ozs7Ozs7O0FBRUE7Ozs7Ozs7O0lBUU1BLE87OztBQUVGLG1CQUFZQyxRQUFaLEVBQXNCO0FBQUE7O0FBQUEsaURBQ2xCLGlCQUFNQSxRQUFOLENBRGtCOztBQUVsQixVQUFLQyxJQUFMLEdBQVksU0FBWjtBQUZrQjtBQUdyQjs7QUFFRDs7Ozs7QUFLQTs7Ozs7Ozs7Ozs7Ozs7Ozs7a0JBY1dGLE8iLCJmaWxlIjoiY29tbWVudC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBOb2RlI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