├── .gitignore ├── lib └── .DS_Store ├── font ├── img │ ├── mac.png │ ├── SimSun.png │ ├── batang.png │ ├── AdobeHei.png │ ├── cao-ni-ma.jpg │ ├── ligatures.png │ ├── small-caps.png │ ├── numberstyles.png │ ├── universwidths.png │ ├── fontsizeadjust.png │ ├── fontsubstitutes.png │ ├── format-strings.png │ ├── realsubscripts.png │ ├── Mac │ │ ├── Chrome@Letian.JPG │ │ ├── Firefox@Letian.JPG │ │ └── Safari@Letian.JPG │ ├── Proportional-vs-monospace-v4.jpg │ ├── Chinese_Character_zhao1_cai2_jin4_bao3.png │ ├── A-small_glyphs.svg │ ├── Serif_and_sans-serif_02.svg │ ├── Serif_and_sans-serif_01.svg │ └── Serif_and_sans-serif_03.svg ├── default_test.gbk.html ├── test.html ├── summary ├── default_test.html ├── name_weight_test.html └── test2.html ├── assets └── fonts │ ├── profile.eot │ ├── profile.ttf │ ├── profile.woff │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ └── profile.svg ├── writing-css └── img │ ├── icb.png │ ├── ex-ch.png │ ├── order.png │ ├── pixel.png │ ├── quote.png │ ├── rotate.png │ ├── box-model.png │ ├── dropcap.png │ ├── line-height.png │ └── canvas-viewport.png ├── semantic-html └── img │ ├── flow.png │ ├── kbd.png │ ├── mdn.png │ ├── rss1.png │ ├── rss2.png │ ├── ruby.png │ ├── TimBL.jpg │ ├── hcard.png │ ├── noodle.png │ ├── altstyle.png │ ├── nextpage.png │ ├── pull-quote.jpg │ ├── microdata_imdb.png │ ├── understanding.png │ ├── microdata_google.png │ ├── table-scope-diagram.png │ └── content-venn.svg ├── processing-css ├── img │ ├── lessc.png │ ├── sass-logo.svg │ ├── less-logo.svg │ └── stylus-logo.svg └── index.html ├── creating-stylesheets └── img │ ├── flash.png │ ├── lessc.png │ ├── unused.png │ ├── critical.png │ ├── far-away.jpg │ ├── parallel.png │ ├── superman.png │ ├── sass-logo.svg │ ├── less-logo.svg │ └── stylus-logo.svg ├── semantic-html-deprecated └── img │ ├── kbd.png │ ├── mdn.png │ ├── TimBL.jpg │ ├── flow.png │ ├── hcard.png │ ├── rss1.png │ ├── rss2.png │ ├── ruby.png │ ├── nextpage.png │ ├── pull-quote.jpg │ ├── understanding.png │ ├── microdata_google.png │ ├── microdata_imdb.png │ ├── table-scope-diagram.png │ └── content-venn.svg ├── README.md ├── start.html ├── index.html └── modular-js └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /lib/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/lib/.DS_Store -------------------------------------------------------------------------------- /font/img/mac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/mac.png -------------------------------------------------------------------------------- /font/img/SimSun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/SimSun.png -------------------------------------------------------------------------------- /font/img/batang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/batang.png -------------------------------------------------------------------------------- /font/img/AdobeHei.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/AdobeHei.png -------------------------------------------------------------------------------- /assets/fonts/profile.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/assets/fonts/profile.eot -------------------------------------------------------------------------------- /assets/fonts/profile.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/assets/fonts/profile.ttf -------------------------------------------------------------------------------- /font/img/cao-ni-ma.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/cao-ni-ma.jpg -------------------------------------------------------------------------------- /font/img/ligatures.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/ligatures.png -------------------------------------------------------------------------------- /font/img/small-caps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/small-caps.png -------------------------------------------------------------------------------- /writing-css/img/icb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/writing-css/img/icb.png -------------------------------------------------------------------------------- /assets/fonts/profile.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/assets/fonts/profile.woff -------------------------------------------------------------------------------- /font/default_test.gbk.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/default_test.gbk.html -------------------------------------------------------------------------------- /font/img/numberstyles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/numberstyles.png -------------------------------------------------------------------------------- /font/img/universwidths.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/universwidths.png -------------------------------------------------------------------------------- /semantic-html/img/flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html/img/flow.png -------------------------------------------------------------------------------- /semantic-html/img/kbd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html/img/kbd.png -------------------------------------------------------------------------------- /semantic-html/img/mdn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html/img/mdn.png -------------------------------------------------------------------------------- /semantic-html/img/rss1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html/img/rss1.png -------------------------------------------------------------------------------- /semantic-html/img/rss2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html/img/rss2.png -------------------------------------------------------------------------------- /semantic-html/img/ruby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html/img/ruby.png -------------------------------------------------------------------------------- /writing-css/img/ex-ch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/writing-css/img/ex-ch.png -------------------------------------------------------------------------------- /writing-css/img/order.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/writing-css/img/order.png -------------------------------------------------------------------------------- /writing-css/img/pixel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/writing-css/img/pixel.png -------------------------------------------------------------------------------- /writing-css/img/quote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/writing-css/img/quote.png -------------------------------------------------------------------------------- /writing-css/img/rotate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/writing-css/img/rotate.png -------------------------------------------------------------------------------- /assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /font/img/fontsizeadjust.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/fontsizeadjust.png -------------------------------------------------------------------------------- /font/img/fontsubstitutes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/fontsubstitutes.png -------------------------------------------------------------------------------- /font/img/format-strings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/format-strings.png -------------------------------------------------------------------------------- /font/img/realsubscripts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/realsubscripts.png -------------------------------------------------------------------------------- /processing-css/img/lessc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/processing-css/img/lessc.png -------------------------------------------------------------------------------- /semantic-html/img/TimBL.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html/img/TimBL.jpg -------------------------------------------------------------------------------- /semantic-html/img/hcard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html/img/hcard.png -------------------------------------------------------------------------------- /semantic-html/img/noodle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html/img/noodle.png -------------------------------------------------------------------------------- /writing-css/img/box-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/writing-css/img/box-model.png -------------------------------------------------------------------------------- /writing-css/img/dropcap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/writing-css/img/dropcap.png -------------------------------------------------------------------------------- /font/img/Mac/Chrome@Letian.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/Mac/Chrome@Letian.JPG -------------------------------------------------------------------------------- /font/img/Mac/Firefox@Letian.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/Mac/Firefox@Letian.JPG -------------------------------------------------------------------------------- /font/img/Mac/Safari@Letian.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/Mac/Safari@Letian.JPG -------------------------------------------------------------------------------- /semantic-html/img/altstyle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html/img/altstyle.png -------------------------------------------------------------------------------- /semantic-html/img/nextpage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html/img/nextpage.png -------------------------------------------------------------------------------- /writing-css/img/line-height.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/writing-css/img/line-height.png -------------------------------------------------------------------------------- /creating-stylesheets/img/flash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/creating-stylesheets/img/flash.png -------------------------------------------------------------------------------- /creating-stylesheets/img/lessc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/creating-stylesheets/img/lessc.png -------------------------------------------------------------------------------- /semantic-html/img/pull-quote.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html/img/pull-quote.jpg -------------------------------------------------------------------------------- /assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /creating-stylesheets/img/unused.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/creating-stylesheets/img/unused.png -------------------------------------------------------------------------------- /semantic-html-deprecated/img/kbd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html-deprecated/img/kbd.png -------------------------------------------------------------------------------- /semantic-html-deprecated/img/mdn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html-deprecated/img/mdn.png -------------------------------------------------------------------------------- /semantic-html/img/microdata_imdb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html/img/microdata_imdb.png -------------------------------------------------------------------------------- /semantic-html/img/understanding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html/img/understanding.png -------------------------------------------------------------------------------- /writing-css/img/canvas-viewport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/writing-css/img/canvas-viewport.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | slideshows 2 | ========== 3 | 4 | My slideshows about techical stuff. 5 | 6 | http://justineo.github.io/slideshows/ 7 | -------------------------------------------------------------------------------- /assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /creating-stylesheets/img/critical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/creating-stylesheets/img/critical.png -------------------------------------------------------------------------------- /creating-stylesheets/img/far-away.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/creating-stylesheets/img/far-away.jpg -------------------------------------------------------------------------------- /creating-stylesheets/img/parallel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/creating-stylesheets/img/parallel.png -------------------------------------------------------------------------------- /creating-stylesheets/img/superman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/creating-stylesheets/img/superman.png -------------------------------------------------------------------------------- /semantic-html-deprecated/img/TimBL.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html-deprecated/img/TimBL.jpg -------------------------------------------------------------------------------- /semantic-html-deprecated/img/flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html-deprecated/img/flow.png -------------------------------------------------------------------------------- /semantic-html-deprecated/img/hcard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html-deprecated/img/hcard.png -------------------------------------------------------------------------------- /semantic-html-deprecated/img/rss1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html-deprecated/img/rss1.png -------------------------------------------------------------------------------- /semantic-html-deprecated/img/rss2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html-deprecated/img/rss2.png -------------------------------------------------------------------------------- /semantic-html-deprecated/img/ruby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html-deprecated/img/ruby.png -------------------------------------------------------------------------------- /semantic-html/img/microdata_google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html/img/microdata_google.png -------------------------------------------------------------------------------- /font/img/Proportional-vs-monospace-v4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/Proportional-vs-monospace-v4.jpg -------------------------------------------------------------------------------- /semantic-html-deprecated/img/nextpage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html-deprecated/img/nextpage.png -------------------------------------------------------------------------------- /semantic-html/img/table-scope-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html/img/table-scope-diagram.png -------------------------------------------------------------------------------- /semantic-html-deprecated/img/pull-quote.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html-deprecated/img/pull-quote.jpg -------------------------------------------------------------------------------- /semantic-html-deprecated/img/understanding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html-deprecated/img/understanding.png -------------------------------------------------------------------------------- /semantic-html-deprecated/img/microdata_google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html-deprecated/img/microdata_google.png -------------------------------------------------------------------------------- /semantic-html-deprecated/img/microdata_imdb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html-deprecated/img/microdata_imdb.png -------------------------------------------------------------------------------- /font/img/Chinese_Character_zhao1_cai2_jin4_bao3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/font/img/Chinese_Character_zhao1_cai2_jin4_bao3.png -------------------------------------------------------------------------------- /semantic-html-deprecated/img/table-scope-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Justineo/slideshows/HEAD/semantic-html-deprecated/img/table-scope-diagram.png -------------------------------------------------------------------------------- /font/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | 14 | Hello, 你好! 15 | 16 | -------------------------------------------------------------------------------- /font/summary: -------------------------------------------------------------------------------- 1 | Google 2 | arial,sans-serif 3 | Arial,sans-serif 4 | 5 | Baidu 6 | arial 7 | "宋体" 8 | Arial,宋体 9 | Simsun(◆) 10 | 11 | Taobao 12 | Tahoma,Helvetica,Arial,'宋体',sans-serif 13 | Tahoma,Helvetica,Arial,sans-serif 14 | tahoma,arial,宋体 15 | 'simsun' 16 | 'Verdana',"????????" 17 | arial,verdana 18 | arial 19 | verdana 20 | tahoma 21 | 22 | qq.com 23 | "宋体","Arial Narrow",HELVETICA 24 | "宋体","Arial Narrow" 25 | tahoma 26 | Verdana 27 | 宋体,STSong 28 | tahoma,宋体 29 | Tahoma 30 | 31 | Weibo 32 | Arial,Helvetica,sans-serif 33 | Arial,Helvetica,"宋体",sans-serif(IM) 34 | Arial 35 | "SimSun" 36 | '宋体',Simsun 37 | Tahoma,"SimSun" -------------------------------------------------------------------------------- /font/default_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 29 | 30 | 31 |
32 |
simsun;
33 |
1234567890qwerty中文测试
34 |
宋体;
35 |
1234567890qwerty中文测试
36 |
Helvetica, Times;
37 |
1234567890qwerty中文测试
38 |
Times, Helvetica;
39 |
1234567890qwerty中文测试
40 |
Helvetica, serif;
41 |
1234567890qwerty中文测试
42 |
Helvetica, sans-serif;
43 |
1234567890qwerty中文测试
44 |
Times, serif;
45 |
1234567890qwerty中文测试
46 |
Times, sans-serif;
47 |
1234567890qwerty中文测试
48 |
serif;
49 |
1234567890qwerty中文测试
50 |
sans-serif;
51 |
1234567890qwerty中文测试
52 |
53 | 54 | -------------------------------------------------------------------------------- /assets/fonts/profile.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Copyright (C) 2014 by original authors @ fontello.com 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /processing-css/img/sass-logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /creating-stylesheets/img/sass-logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /font/name_weight_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 |
百度0abc你好
百度 Preferred0abc你好
百度 Full0abc你好
百度 PostScript0abc你好
Baidu0abc你好
Baidu Preferred0abc你好
Baidu Full0abc你好
Baidu PostScript0abc你好
Myriad Pro 100Innovation in China
Myriad Pro 200Innovation in China
Myriad Pro 300Innovation in China
Myriad Pro 400Innovation in China
Myriad Pro 500Innovation in China
Myriad Pro 600Innovation in China
Myriad Pro 700Innovation in China
Myriad Pro 800Innovation in China
Myriad Pro 900Innovation in China
127 | 128 | -------------------------------------------------------------------------------- /font/test2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 |
百度0abc你好
百度 Preferred0abc你好
百度 Full0abc你好
百度 PostScript0abc你好
Baidu0abc你好
Baidu Preferred0abc你好
Baidu Full0abc你好
Baidu PostScript0abc你好
Myriad Pro 100Innovation in China
Myriad Pro 200Innovation in China
Myriad Pro 300Innovation in China
Myriad Pro 400Innovation in China
Myriad Pro 500Innovation in China
Myriad Pro 600Innovation in China
Myriad Pro 700Innovation in China
Myriad Pro 800Innovation in China
Myriad Pro 900Innovation in China
Tahoma Bold ItalicInnovation in China 神马都是浮云
131 | 132 | -------------------------------------------------------------------------------- /start.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 |
25 |
26 |

[Slideshow Title]

27 |



28 |

[Author]

29 |
30 | 31 |
32 |

参考资料

33 |
34 | 35 |
36 |

「终」

37 |
38 |
39 | 40 | 41 | 47 | 48 | 49 |
50 | 51 |
52 | 53 | 54 | 55 | 56 | 101 | 102 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Slideshow start page 6 | 19 | 135 | 136 | 137 |
138 |

Slideshows »

139 |
140 | 148 | 159 | 160 | 161 | 217 | 218 | 219 | -------------------------------------------------------------------------------- /processing-css/img/less-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 25 | 29 | 33 | 37 | 38 | 47 | 48 | 50 | 51 | 53 | image/svg+xml 54 | 56 | 57 | 58 | 59 | 60 | 63 | 67 | 71 | 75 | 79 | 83 | 87 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /creating-stylesheets/img/less-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 25 | 29 | 33 | 37 | 38 | 47 | 48 | 50 | 51 | 53 | image/svg+xml 54 | 56 | 57 | 58 | 59 | 60 | 63 | 67 | 71 | 75 | 79 | 83 | 87 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /processing-css/img/stylus-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 17 | 29 | 30 | 40 | 41 | 42 | 52 | 53 | 66 | 79 | 80 | -------------------------------------------------------------------------------- /creating-stylesheets/img/stylus-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 17 | 29 | 30 | 40 | 41 | 42 | 52 | 53 | 66 | 79 | 80 | -------------------------------------------------------------------------------- /semantic-html-deprecated/img/content-venn.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | 17 |
18 |

Flow content

19 |
    20 |
  • a
  • 21 |
  • abbr
  • 22 |
  • address
  • 23 |
  • area*
  • 24 |
  • article
  • 25 |
  • aside
  • 26 |
  • audio
  • 27 |
  • b
  • 28 |
  • bdi
  • 29 |
  • bdo
  • 30 |
  • blockquote
  • 31 |
  • br
  • 32 |
  • button
  • 33 |
  • canvas
  • 34 |
  • cite
  • 35 |
  • code
  • 36 |
  • command
  • 37 |
  • data
  • 38 |
  • date
  • 39 |
  • datalist
  • 40 |
  • del
  • 41 |
  • details
  • 42 |
  • dfn
  • 43 |
  • dialog
  • 44 |
  • div
  • 45 |
  • dl
  • 46 |
  • em
  • 47 |
  • embed
  • 48 |
  • fieldset
  • 49 |
  • figure
  • 50 |
  • footer
  • 51 |
  • form
  • 52 |
  • h1
  • 53 |
  • h2
  • 54 |
  • h3
  • 55 |
  • h4
  • 56 |
  • h5
  • 57 |
  • h6
  • 58 |
  • header
  • 59 |
  • hgroup
  • 60 |
  • hr
  • 61 |
  • i
  • 62 |
  • iframe
  • 63 |
  • img
  • 64 |
  • input
  • 65 |
  • ins
  • 66 |
  • kbd
  • 67 |
  • keygen
  • 68 |
  • label
  • 69 |
  • link*
  • 70 |
  • map
  • 71 |
  • mark
  • 72 |
  • math
  • 73 |
  • menu
  • 74 |
  • meta*
  • 75 |
  • meter
  • 76 |
  • nav
  • 77 |
  • noscript
  • 78 |
  • object
  • 79 |
  • ol
  • 80 |
  • output
  • 81 |
  • p
  • 82 |
  • pre
  • 83 |
  • progress
  • 84 |
  • q
  • 85 |
  • ruby
  • 86 |
  • s
  • 87 |
  • samp
  • 88 |
  • script
  • 89 |
  • section
  • 90 |
  • select
  • 91 |
  • small
  • 92 |
  • span
  • 93 |
  • strong
  • 94 |
  • style*
  • 95 |
  • sub
  • 96 |
  • sup
  • 97 |
  • svg
  • 98 |
  • table
  • 99 |
  • textarea
  • 100 |
  • time
  • 101 |
  • u
  • 102 |
  • ul
  • 103 |
  • var
  • 104 |
  • video
  • 105 |
  • wbr
  • 106 |
  • Text*
  • 107 |
108 |

* Under certain circumstances (see prose).

109 |
110 |
111 | Flow 112 |
113 | 114 | 115 | 116 |
117 |

Heading content

118 |
    119 |
  • h1
  • 120 |
  • h2
  • 121 |
  • h3
  • 122 |
  • h4
  • 123 |
  • h5
  • 124 |
  • h6
  • 125 |
  • hgroup
  • 126 |
127 |
128 |
129 | Heading 130 |
131 | 132 | 133 | 134 |
135 |

Sectioning content

136 |
    137 |
  • article
  • 138 |
  • aside
  • 139 |
  • nav
  • 140 |
  • section
  • 141 |
142 |
143 |
144 | Sectioning 145 |
146 | 147 | 148 | 149 |
150 |

Metadata content

151 |
    152 |
  • base
  • 153 |
  • command
  • 154 |
  • link
  • 155 |
  • meta
  • 156 |
  • noscript
  • 157 |
  • script
  • 158 |
  • style
  • 159 |
  • title
  • 160 |
161 |
162 |
163 | Metadata 164 |
165 | 166 | 167 | 168 |
169 |

Interactive content

170 |
    171 |
  • a
  • 172 |
  • audio*
  • 173 |
  • button
  • 174 |
  • details
  • 175 |
  • embed
  • 176 |
  • iframe
  • 177 |
  • img*
  • 178 |
  • input*
  • 179 |
  • keygen
  • 180 |
  • label
  • 181 |
  • menu*
  • 182 |
  • object*
  • 183 |
  • select
  • 184 |
  • textarea
  • 185 |
  • video*
  • 186 |
187 |

* Under certain circumstances.

188 |
189 |
190 | Interactive 191 |
192 | 193 | 194 | 195 |
196 |

Phrasing content

197 |
    198 |
  • a*
  • 199 |
  • abbr
  • 200 |
  • area*
  • 201 |
  • audio
  • 202 |
  • b
  • 203 |
  • bdi
  • 204 |
  • bdo
  • 205 |
  • br
  • 206 |
  • button
  • 207 |
  • canvas
  • 208 |
  • cite
  • 209 |
  • code
  • 210 |
  • command
  • 211 |
  • data
  • 212 |
  • date
  • 213 |
  • datalist
  • 214 |
  • del*
  • 215 |
  • dfn
  • 216 |
  • em
  • 217 |
  • embed
  • 218 |
  • i
  • 219 |
  • iframe
  • 220 |
  • img
  • 221 |
  • input
  • 222 |
  • ins*
  • 223 |
  • kbd
  • 224 |
  • keygen
  • 225 |
  • label
  • 226 |
  • link*
  • 227 |
  • map*
  • 228 |
  • mark
  • 229 |
  • math
  • 230 |
  • meta*
  • 231 |
  • meter
  • 232 |
  • noscript
  • 233 |
  • object
  • 234 |
  • output
  • 235 |
  • progress
  • 236 |
  • q
  • 237 |
  • ruby
  • 238 |
  • s
  • 239 |
  • samp
  • 240 |
  • script
  • 241 |
  • select
  • 242 |
  • small
  • 243 |
  • span
  • 244 |
  • strong
  • 245 |
  • sub
  • 246 |
  • sup
  • 247 |
  • svg
  • 248 |
  • textarea
  • 249 |
  • time
  • 250 |
  • u
  • 251 |
  • var
  • 252 |
  • video
  • 253 |
  • wbr
  • 254 |
  • Text*
  • 255 |
256 |

* Under certain circumstances; see prose.

257 |
258 |
259 | Phrasing 260 |
261 | 262 | 263 | 264 |
265 |

Embedded content

266 |
    267 |
  • audio
  • 268 |
  • canvas
  • 269 |
  • embed
  • 270 |
  • iframe
  • 271 |
  • img
  • 272 |
  • math
  • 273 |
  • object
  • 274 |
  • svg
  • 275 |
  • video
  • 276 |
277 |
278 |
279 | Embedded 280 |
281 |
-------------------------------------------------------------------------------- /semantic-html/img/content-venn.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | 17 |
18 |

Flow content

19 |
    20 |
  • a
  • 21 |
  • abbr
  • 22 |
  • address
  • 23 |
  • area*
  • 24 |
  • article
  • 25 |
  • aside
  • 26 |
  • audio
  • 27 |
  • b
  • 28 |
  • bdi
  • 29 |
  • bdo
  • 30 |
  • blockquote
  • 31 |
  • br
  • 32 |
  • button
  • 33 |
  • canvas
  • 34 |
  • cite
  • 35 |
  • code
  • 36 |
  • command
  • 37 |
  • data
  • 38 |
  • date
  • 39 |
  • datalist
  • 40 |
  • del
  • 41 |
  • details
  • 42 |
  • dfn
  • 43 |
  • dialog
  • 44 |
  • div
  • 45 |
  • dl
  • 46 |
  • em
  • 47 |
  • embed
  • 48 |
  • fieldset
  • 49 |
  • figure
  • 50 |
  • footer
  • 51 |
  • form
  • 52 |
  • h1
  • 53 |
  • h2
  • 54 |
  • h3
  • 55 |
  • h4
  • 56 |
  • h5
  • 57 |
  • h6
  • 58 |
  • header
  • 59 |
  • hgroup
  • 60 |
  • hr
  • 61 |
  • i
  • 62 |
  • iframe
  • 63 |
  • img
  • 64 |
  • input
  • 65 |
  • ins
  • 66 |
  • kbd
  • 67 |
  • keygen
  • 68 |
  • label
  • 69 |
  • link*
  • 70 |
  • map
  • 71 |
  • mark
  • 72 |
  • math
  • 73 |
  • menu
  • 74 |
  • meta*
  • 75 |
  • meter
  • 76 |
  • nav
  • 77 |
  • noscript
  • 78 |
  • object
  • 79 |
  • ol
  • 80 |
  • output
  • 81 |
  • p
  • 82 |
  • pre
  • 83 |
  • progress
  • 84 |
  • q
  • 85 |
  • ruby
  • 86 |
  • s
  • 87 |
  • samp
  • 88 |
  • script
  • 89 |
  • section
  • 90 |
  • select
  • 91 |
  • small
  • 92 |
  • span
  • 93 |
  • strong
  • 94 |
  • style*
  • 95 |
  • sub
  • 96 |
  • sup
  • 97 |
  • svg
  • 98 |
  • table
  • 99 |
  • textarea
  • 100 |
  • time
  • 101 |
  • u
  • 102 |
  • ul
  • 103 |
  • var
  • 104 |
  • video
  • 105 |
  • wbr
  • 106 |
  • Text*
  • 107 |
108 |

* Under certain circumstances (see prose).

109 |
110 |
111 | Flow 112 |
113 | 114 | 115 | 116 |
117 |

Heading content

118 |
    119 |
  • h1
  • 120 |
  • h2
  • 121 |
  • h3
  • 122 |
  • h4
  • 123 |
  • h5
  • 124 |
  • h6
  • 125 |
  • hgroup
  • 126 |
127 |
128 |
129 | Heading 130 |
131 | 132 | 133 | 134 |
135 |

Sectioning content

136 |
    137 |
  • article
  • 138 |
  • aside
  • 139 |
  • nav
  • 140 |
  • section
  • 141 |
142 |
143 |
144 | Sectioning 145 |
146 | 147 | 148 | 149 |
150 |

Metadata content

151 |
    152 |
  • base
  • 153 |
  • command
  • 154 |
  • link
  • 155 |
  • meta
  • 156 |
  • noscript
  • 157 |
  • script
  • 158 |
  • style
  • 159 |
  • title
  • 160 |
161 |
162 |
163 | Metadata 164 |
165 | 166 | 167 | 168 |
169 |

Interactive content

170 |
    171 |
  • a
  • 172 |
  • audio*
  • 173 |
  • button
  • 174 |
  • details
  • 175 |
  • embed
  • 176 |
  • iframe
  • 177 |
  • img*
  • 178 |
  • input*
  • 179 |
  • keygen
  • 180 |
  • label
  • 181 |
  • menu*
  • 182 |
  • object*
  • 183 |
  • select
  • 184 |
  • textarea
  • 185 |
  • video*
  • 186 |
187 |

* Under certain circumstances.

188 |
189 |
190 | Interactive 191 |
192 | 193 | 194 | 195 |
196 |

Phrasing content

197 |
    198 |
  • a*
  • 199 |
  • abbr
  • 200 |
  • area*
  • 201 |
  • audio
  • 202 |
  • b
  • 203 |
  • bdi
  • 204 |
  • bdo
  • 205 |
  • br
  • 206 |
  • button
  • 207 |
  • canvas
  • 208 |
  • cite
  • 209 |
  • code
  • 210 |
  • command
  • 211 |
  • data
  • 212 |
  • date
  • 213 |
  • datalist
  • 214 |
  • del*
  • 215 |
  • dfn
  • 216 |
  • em
  • 217 |
  • embed
  • 218 |
  • i
  • 219 |
  • iframe
  • 220 |
  • img
  • 221 |
  • input
  • 222 |
  • ins*
  • 223 |
  • kbd
  • 224 |
  • keygen
  • 225 |
  • label
  • 226 |
  • link*
  • 227 |
  • map*
  • 228 |
  • mark
  • 229 |
  • math
  • 230 |
  • meta*
  • 231 |
  • meter
  • 232 |
  • noscript
  • 233 |
  • object
  • 234 |
  • output
  • 235 |
  • progress
  • 236 |
  • q
  • 237 |
  • ruby
  • 238 |
  • s
  • 239 |
  • samp
  • 240 |
  • script
  • 241 |
  • select
  • 242 |
  • small
  • 243 |
  • span
  • 244 |
  • strong
  • 245 |
  • sub
  • 246 |
  • sup
  • 247 |
  • svg
  • 248 |
  • textarea
  • 249 |
  • time
  • 250 |
  • u
  • 251 |
  • var
  • 252 |
  • video
  • 253 |
  • wbr
  • 254 |
  • Text*
  • 255 |
256 |

* Under certain circumstances; see prose.

257 |
258 |
259 | Phrasing 260 |
261 | 262 | 263 | 264 |
265 |

Embedded content

266 |
    267 |
  • audio
  • 268 |
  • canvas
  • 269 |
  • embed
  • 270 |
  • iframe
  • 271 |
  • img
  • 272 |
  • math
  • 273 |
  • object
  • 274 |
  • svg
  • 275 |
  • video
  • 276 |
277 |
278 |
279 | Embedded 280 |
281 |
-------------------------------------------------------------------------------- /font/img/A-small_glyphs.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 13 | 22 | 26 | 30 | 34 | 38 | 42 | 46 | 50 | 54 | 58 | 67 | 71 | 72 | ɑ 81 | 82 | -------------------------------------------------------------------------------- /font/img/Serif_and_sans-serif_02.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 21 | 23 | image/svg+xml 24 | 26 | 27 | 28 | 29 | 30 | 50 | 52 | 55 | 59 | 63 | 67 | 71 | 75 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /font/img/Serif_and_sans-serif_01.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 21 | 23 | image/svg+xml 24 | 26 | 27 | 28 | 29 | 30 | 54 | 56 | 59 | 63 | 67 | 71 | 75 | 79 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /font/img/Serif_and_sans-serif_03.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 21 | 23 | image/svg+xml 24 | 26 | 27 | 28 | 29 | 49 | 51 | 55 | 59 | 63 | 67 | 71 | 75 | 79 | 83 | 87 | 91 | 95 | 99 | 103 | 107 | 111 | 115 | 116 | -------------------------------------------------------------------------------- /processing-css/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Processing CSS 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 31 | 32 | 33 | 42 | 43 | 46 | 47 | 60 | 61 | 62 | 63 | 64 |
65 | 66 |
67 | 68 |
69 |

Processing CSS

70 |
71 |

顾轶灵 @ Baidu EFE

72 |

73 | 74 | 75 | 76 |

77 |
78 |
79 | 80 | 81 |
82 | 83 |
84 |

Why process CSS?

85 |
86 | 87 |
88 |

CSS 的(cáo)(diǎn)

89 |
90 | 91 |
92 |

语法限制

93 |

Too simple
(some times naïve)

94 |
95 |
.post {
 96 |     background-color: white;
 97 |     color: rebeccapurple;
 98 | }
 99 | 
100 | .post h1, .post h2, .post h3,
101 | .post h4, .post h5, .post h6 {
102 |     /* reversed colors */
103 |     background-color: rebeccapurple;
104 |     color: white;
105 | }
106 | 
107 |
108 |

DRY? No.

109 |
110 | 111 |
112 |

复用机制

113 |

不理想
太不理想了

114 |
    115 |
  • 继承
  • 116 |
  • 共享声明块
  • 117 |
118 |
119 | 120 |
121 |

继承

122 |
123 |
button {
124 |     font-family: inherit;
125 | }
126 | 
127 |
128 |
    129 |
  • 仅针对单条声明
  • 130 |
  • 继承关系来自文档结构而非 CSS
  • 131 |
  • 不是纯粹样式层的继承
  • 132 |
133 |
134 | 135 |
136 |

共享声明块

137 |
    138 |
  • 139 |

    选择器组

    140 |
    141 |
    .title,
    142 | .comment {
    143 |     color: #333;
    144 | }
    145 | 
    146 |
    147 |
  • 148 |
  • 149 |

    在文档中添加用来复用样式的内容

    150 |
    151 |
    <h1 class="post-title block">...<h1>
    152 | ...
    153 | <article class="post clearfix">...<article>
    154 | ...
    155 | <article class="comment clearfix">...<article>
    156 | 
    157 |
  • 158 |
159 |
160 | 161 |
162 |

「样式类」

163 |
    164 |
  • clearfix, cf
  • 165 |
  • float-right, fr, pull-right, ...
  • 166 |
  • red, mr10, ...
  • 167 |
  • ...
  • 168 |
169 |
170 | 171 |
172 |

设计缺陷?

173 |
174 |

What is CSS:

175 |
176 | Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g., fonts, colors, spacing) to Web documents. 177 | 178 |
179 |
180 |

不是传统意义上的编程语言

181 |
182 |
a {
183 |     color: #69c !important;
184 | }
185 |
重要?不重要?
186 |
187 |
188 | 189 |
190 | 191 |
192 |
193 |

预处理器的崛起

194 |
195 | 196 |
197 |

预处理器 / DSL

198 |
199 |

Sass logo

200 |

Less logo

201 |

Stylus logo

202 |
203 |
204 | 205 |
206 |

预处理器能做什么?

207 |
    208 |
  • 增强语法,提供语法糖
  • 209 |
  • 将重复的值抽象为变量
  • 210 |
  • 将重复的样式抽象出来混入或继承
  • 211 |
  • ...
  • 212 |
213 |

提高代码的可维护性

214 |
215 | 216 |
217 |

eg. 嵌套语法 (WHATWG<h1> 推荐样式)

218 |
219 |
/* heading.less */
220 | article, aside, nav, section {
221 |     h1 {
222 |         margin-top: 0.83em; margin-bottom: 0.83em; font-size: 1.50em;
223 |     }
224 |     & & h1 {
225 |         margin-top: 1.00em; margin-bottom: 1.00em; font-size: 1.17em;
226 |     }
227 |     & & & h1 {
228 |         margin-top: 1.33em; margin-bottom: 1.33em; font-size: 1.00em;
229 |     }
230 |     & & & & h1 {
231 |         margin-top: 1.67em; margin-bottom: 1.67em; font-size: 0.83em;
232 |     }
233 |     & & & & & h1 {
234 |         margin-top: 2.33em; margin-bottom: 2.33em; font-size: 0.67em;
235 |     }
236 | }
237 | 
238 |
239 |

via 14.3.7 Sections and headings

240 |
241 | 242 |
243 |

编译后

244 |
245 | headings.css文件大小为47229B 246 |
247 |

See compiled code.

248 |

47KB? Are you serious?

249 |
250 | 251 |
252 |

eg. 抽象样式

253 |
254 |
.border-radius(@radius) {
255 |     -webkit-border-radius: @radius;
256 |        -moz-border-radius: @radius;
257 |             border-radius: @radius;
258 | }
259 | 
260 | .badge(@color, @radius: 5px) {
261 |     .border-radius(@radius);
262 |     background-color: lighten(@color, 20%)
263 |     color: @color;
264 | }
265 | 
266 | @color-alert: red;
267 | @color-warning: yellow;
268 | @color-success: lightgreen;
269 | 
270 | .alert   { .badge(@color-alert);   }
271 | .warning { .badge(@color-warning); }
272 | .success { .badge(@color-success); }
273 | 
274 |
275 |
276 | 277 |
278 |

预处理器工作流程

279 |
    280 |
  1. DSL 源码 → 动态 AST
  2. 281 |
  3. 动态 AST → 静态 AST
  4. 282 |
  5. 静态 AST → CSS
  6. 283 |
284 |
285 | 286 |
287 |

开发者工作流程

288 |

DSL未压缩 CSS生产环境 CSS

289 |

预处理 + 压缩

290 |
291 | 292 |
293 | 294 |
295 | 296 |
297 |

预处理器拯救世界?

298 |
299 | 300 |
301 |

Vendor-prefix 的尴尬

302 |
303 |
/* Bootstrap's mixin */
304 | .border-radius(@radius) {
305 |     -webkit-border-radius: @radius;
306 |        -moz-border-radius: @radius;
307 |             border-radius: @radius;
308 | }
309 |
310 |

不同项目需要用的前缀不同怎么办?

311 |
312 | 313 |
314 |

Autoprefixer (2013)

315 |
316 |
输入 (标准 CSS)
317 |
.badge {
318 |   border-radius: 5px;
319 | }
320 |
321 |
322 |

323 |
324 |
配置条件 > 0% (尽可能兼容)
325 |
.badge {
326 |   -webkit-border-radius: 5px;
327 |      -moz-border-radius: 5px;
328 |           border-radius: 5px;
329 | }
330 |
331 |
332 |
配置条件 > 1% (市场占有率大于 1%)
333 |
.badge {
334 |   border-radius: 5px;
335 | }
336 |
337 |
338 |
339 | 340 |
341 |

Autoprefixer

342 |
    343 |
  • 不依赖 DSL,书写标准 CSS
  • 344 |
  • 数据来自 Can I Use (GitHub),由社区更新
  • 345 |
  • 根据目标环境配置按需生成前缀
  • 346 |
347 |
348 | 349 |
350 |

预处理器的局限

351 |
    352 |
  • 提供整套方案,模块化能力不足
  • 353 |
  • DSL 决定了功能范围,用户自定义能力有限
  • 354 |
  • 功能缺失怎么办?——feature request
  • 355 |
356 |
357 | 358 |
359 |

「后处理器」 (非官方)

360 |
    361 |
  • 直接处理标准的 CSS 代码
  • 362 |
  • 模块化,一次只做一件事
  • 363 |
  • 按需自由组合模块,灵活调用
  • 364 |
  • 逻辑通过编程语言描述,不借助 DSL
  • 365 |
366 |

适合处理兼容性问题、进行 polyfill、优化输出

367 |

广义上「后处理」也属于预处理的范畴,其实 CSS 压缩等已经是其中之一

368 |
369 | 370 |
371 |

后处理器工作流程

372 |
    373 |
  1. 标准 CSS → CSS AST
  2. 374 |
  3. 对 CSS AST 进行后处理 (不同后处理模块的核心功能)
  4. 375 |
  5. CSS AST → CSS 代码
  6. 376 |
377 |
378 | 379 |
380 |

开发者工作流程

381 |

标准 CSS (甚至草案)生产环境 CSS

382 |
383 | 384 |
385 |

「后处理框架」

386 |

后处理器离不开:

387 |
    388 |
  1. 将 CSS 解析为 AST
  2. 389 |
  3. 操作 AST
  4. 390 |
  5. 将 AST 格式化输出
  6. 391 |
392 |
393 |
    394 |
  • rework (2012) - 「CSS 预处理插件框架」
  • 395 |
  • postcss (2013) - 「通过 JS 插件转换 CSS」
  • 396 |
397 |
398 | 399 |
400 | 401 |
402 | 403 |
404 |

如何选择?

405 |
406 | 407 |
408 |

前后结合的方案

409 |

解决兼容性问题不是样式本身的复用

410 |
    411 |
  • 预处理器处理样式层的抽象,减少冗余
  • 412 |
  • 后处理器处理兼容、优化
  • 413 |
414 |
415 | 416 |
417 |

前后结合的工作流

418 |

DSL标准 CSS生产环境 CSS

419 |
420 | 421 |
422 |

Bootstrap

423 |
424 |
// Vendor Prefixes
425 | //
426 | // All vendor mixins are deprecated as of v3.2.0 due to the introduction of
427 | // Autoprefixer in our Gruntfile. They will be removed in v4.
428 | 
429 |
430 |
via bootstrap/less/mixins/vendor-prefixes.less
431 |
432 | 433 |
434 |

est 2.0 (EFE Less mixin library)

435 |
436 |
.border-radius(@radius: @default-border-radius) when not (@use-autoprefixer) {
437 |     -webkit-border-radius: @radius;
438 |        -moz-border-radius: @radius;
439 |             border-radius: @radius;
440 | }
441 | .border-radius(@radius: @default-border-radius) when (@use-autoprefixer) {
442 |     border-radius: @radius;
443 | }
444 | .border-radius(@radius-x, @radius-y) {
445 |     .border-radius(@radius-x ~"/" @radius-y);
446 | }
447 | 
448 |
449 |
450 | 451 |
452 |

有趣的现象

453 |
    454 |
  • 预处理器越来越「后」
  • 455 |
  • 「后处理器」越来越「前」
  • 456 |
457 |
458 | 459 |
460 |

eg. Less 插件

461 |
    462 |
  • 可以调用「后处理器」:Autoprefixer、clean-css、...
  • 463 |
  • 可以操作 DSL 的 AST
  • 464 |
  • ...
  • 465 |
466 |

用来增强 DSL 的表达能力受限的不足

467 |
468 | 469 |
470 |

eg. postcss 模块

471 | 477 |

用来增强原生 CSS 抽象能力的不足、弥补语法缺陷

478 |
479 | 480 |
481 |

结果

482 |
    483 |
  • 「后处理器」不再提「后处理」 - postcss
  • 484 |
  • 大家都叫「预处理」 - rework、Myth
  • 485 |
486 |
487 | 496 |
497 | 498 |
499 |

Q ? A : Thanks

500 |
501 |
502 | 503 |
504 | 505 | 506 | 507 | 508 | 538 | 539 | 540 | -------------------------------------------------------------------------------- /modular-js/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Modern Modular JavaScript 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 31 | 32 | 35 | 36 | 49 | 50 | 51 | 52 | 53 |
54 | 55 |
56 |
57 |

Modern Modular JavaScript

58 |
59 |

顾轶灵

60 |

61 | 62 | 63 | 64 |

65 |
66 |
67 | 68 |
69 |
70 |

模块化

71 |
    72 |
  • 封装(解决冲突)
  • 73 |
  • 依赖(模块间的相互引用)
  • 74 |
  • 加载(运行环境影响加载方式)
  • 75 |
76 |
77 | 78 |
79 |
80 |

math.js

81 |
function add(x, y) {
 82 |     return x + y;
 83 | }
84 |
85 |
86 |

main.js

87 |
var a = add(1, 2);
 88 | alert(a);
89 |
90 |
91 |

index.html

92 |
<script src="math.js"></script>
 93 | <script src="main.js"></script>
94 |
95 |
96 | 97 |
98 |
99 |

math.js

100 |
var math = {};
101 | math.add = function(x, y) {
102 |     return x + y;
103 | }
104 |
105 |
106 |

main.js

107 |
var a = math.add(1, 2);
108 | alert(a);
109 |
110 |

记忆/输入代价 vs. 冲突概率

111 |
112 | 113 |
114 |
115 |

math.js

116 |
(function() {
117 |     var math = {};
118 |     math.add = function(x, y) {
119 |         return x + y;
120 |     };
121 |     this.math = math;
122 | })();
123 |
124 |
125 |

main.js

126 |
(function() {
127 |     var a = math.add(1, 2);
128 |     alert(a);
129 | })();
130 |
131 |
132 | 133 |
134 |

动态加载

135 |
    136 |
  • XHR + eval
    跨域、调试
  • 137 |
  • document.write()
    阻塞页面渲染、页面加载完毕后无法再用
  • 138 |
  • head.appendChild(script)
  • 139 |
140 |

模块加载顺序?

141 |
142 | 143 |
144 |

依赖

145 |
    146 |
  • 模块通过显示声明(eg. goog.provide('mod');或不声明(eg. 与文件路径对应)
  • 147 |
  • 某种 include/import/require 声明依赖
    eg. goog.require('mod');
  • 148 |
149 |
150 | 151 |
152 |

问题

153 |

模块不执行,如何获取依赖决定执行顺序?

154 |
    155 |
  • 服务端静态分析后顺序加载执行
    eg. deps.js for Closure
  • 156 |
  • 157 |

    将依赖声明和模块执行分开(利用 function wrapping)

    158 |
    define(['math'], function(math) {
    159 |     var a = math.add(1, 2);
    160 |     alert(a);
    161 | });
    162 |
  • 163 |
164 |
165 | 166 |
167 | 168 |
169 | 170 |
171 |

CommonJS Modules

172 |
173 | 174 |
175 |

Module Context

176 |
    177 |
  • require
  • 178 |
  • exports
  • 179 |
  • module
  • 180 |
181 |

(详细定义 →)

182 |
183 | 184 |
185 |
186 |

math.js

187 |
exports.add = function(x, y) {
188 |     return x + y;
189 | }
190 |
191 |
192 |

main.js

193 |
var add = require('math').add;
194 | var a = add(1, 2);
195 |
196 |
197 | 198 |
199 |

Server-oriented

200 |
    201 |
  • 模块运行环境天然隔离
  • 202 |
  • 同步读取执行模块依赖
  • 203 |
  • 无法直接在浏览器环境下使用
    可以通过服务端自动构建为遵循 Wrappings 或 Transport 规范的代码来满足浏览器运行条件
  • 204 |
205 |
206 | 207 |
208 | 209 |
210 | 211 |
212 |

RequireJS 与 AMD

213 |
214 | 215 |
216 |

RequireJS (repo →)

217 |
    218 |
  • 前身为 RunJS
  • 219 |
  • 试图解决老版本 Dojo Loader(XHR + eval)的缺陷
  • 220 |
  • 加载执行遵循 AMD 规范的模块
  • 221 |
222 |
223 | 224 |
225 |

AMD

226 |
    227 |
  • “CommonJS Transport/C”
  • 228 |
  • RequireJS 的规范化产出
  • 229 |
  • define(id?, dependencies?, factory);
  • 230 |
231 |

(详细定义 →)

232 |
233 | 234 |
235 |

module id

236 |
    237 |
  • "/" 分隔的 "terms"
  • 238 |
  • 不得包含后缀如 ".js"
  • 239 |
  • "relative" & "top-level"
  • 240 |
  • 使用加载器插件时,"!" 用来分隔资源类型 ID 与模块名
  • 241 |
242 |
baidu/dom./langcss!./normalize.css
243 |
244 | 245 |
246 |

dependencies

247 |
    248 |
  • 缺省值为 ["require", "exports", "module"]
  • 249 |
  • 依赖模块的导出接口将会对应到 factory 的参数列表
  • 250 |
251 |
252 | 253 |
254 |

factory

255 |
    256 |
  • 函数/对象
  • 257 |
  • 若为函数,仅运行一次,且返回值作为模块的导出接口
  • 258 |
  • 若为对象,直接作为模块的导出接口
  • 259 |
260 |
261 | 262 |
263 |

require (local)

264 |

传入 AMD define factory 的 require 函数

265 |
define(['require'], function(require) {
266 |     //the require in here is a local require.
267 | });
268 | 
269 | define(function(require, exports, module) {
270 |     //the require in here is a local require.
271 | });
272 |
273 | 274 |
275 |

require (global)

276 |

用来启动模块加载的全局函数

277 |
require(['foo', 'bar'], function (foo, bar) {
278 |     foo.doSomething();
279 | });
280 |
281 | 282 |
283 |

require

284 |

require(String)
同步返回指定模块接口

285 |
define(function(require) {
286 |     var a = require('a');
287 | });
288 | Function.prototype.toString() 289 |
290 | 291 |
292 |

require

293 |

require(Array, Function)
异步读取多个依赖模块后执行回调

294 |
define(function(require) {
295 |     require(['a', 'b'], function(a, b) {
296 |         //modules a and b are now available for use.
297 |     });
298 | });
299 |
300 | 301 |
302 |
303 |

math.js

304 |
define(function() {
305 |     var math = {};
306 |     math.add = function(x, y) {
307 |         return x + y;
308 |     };
309 |     return math;
310 | });
311 |
312 |
313 |

main.js

314 |
require(['math'], function(math) {
315 |     var a = math.add(1, 2);
316 |     alert(a);
317 | });
318 |
319 |
320 | 321 |
322 |

Simplified CommonJS wrapping

323 |
324 |

math.js

325 |
define(function(require, exports) {
326 |     exports.add = function(x, y) {
327 |         return x + y;
328 |     }
329 | });
330 | 
331 |
332 |
333 |

main.js

334 |
define(function(require) {
335 |     var add = require('math').add;
336 |     var a = add(1, 2);
337 | });
338 |
339 |
340 | 341 |
342 |

实现

343 | 349 |
350 | 351 |
352 |

AMD 特点

353 |
    354 |
  • 可以在浏览器中运行
  • 355 |
  • 封装性好
  • 356 |
  • 同时支持 exports/返回值,相比 CommonJS 模块,导出接口可以是函数等更丰富的类型 eg. 模块直接导出一个构造函数
  • 357 |
  • 不支持动态计算同步依赖
    var mod = require(someCondition ? 'a' : 'b');
    358 | 
    359 | if (someCondition) {
    360 |     var a = require('a');
    361 | } else {
    362 |     var a = require('b');
    363 | }
  • 364 |
365 |
366 | 367 |
368 |

AMD 特点(cont.)

369 |
    370 |
  • 便于调试 相对于 XHR + eval
  • 371 |
  • 加载器插件丰富灵活
  • 372 |
373 |
374 | 375 |
376 | 377 |
378 | 379 |
380 |

SeaJS 与 CMD

381 |
382 | 383 |
384 |

SeaJS

385 |
    386 |
  • 在浏览器上运行 CommonJS 模块
  • 387 |
  • 模块的快速迁移
  • 388 |
  • 加载遵循 CMD 规范的模块
  • 389 |
  • SPM
  • 390 |
391 |
392 | 393 |
394 |

CMD

395 |
    396 |
  • SeaJS 的规范化产出
  • 397 |
  • define(factory);
  • 398 |
  • define(id?, deps?, factory);
    非 CMD 一部分,而作为 Transport 规范存在。推荐不写 iddeps,在构建时用工具生成
  • 399 |
400 |

(详细定义 →)

401 |
402 | 403 |
404 |

factory

405 |
    406 |
  • 与 AMD 类似,不同之处在于可以是字符串 407 |
    define('I am a template. My name is {{name}}.');
    408 |
  • 409 |
  • 还可以通过 module.exports 进行导出(兼容 node.js 模块) 410 |
    define(function(require, exports, module) {
    411 |     module.exports = new SomeClass();
    412 | });
  • 413 |
414 |
415 | 416 |
417 |

require

418 |
    419 |
  • 只有 local require
  • 420 |
  • require(String) 同步加载
  • 421 |
  • require.async(id, callback?) 异步加载
    类似于 AMD 的 require(Array, Function)
  • 422 |
  • SeaJS 下的入口为 seajs.use()
  • 423 |
424 |
425 | 426 |
427 |

SeaJS vs. RequreJS, CMD vs. AMD

428 |

@lifesinger

429 |
    430 |
  • 依赖延迟执行 vs. 提前执行
  • 431 |
  • 依赖就近 vs. 前置
  • 432 |
  • CMD 更为贴近 CommonJS Modules/1.1 和 Node Modules
  • 433 |
  • 明显没有 bug vs. 没有明显的 bug
  • 434 |
  • 调试、插件机制、...
  • 435 |
436 |
437 | 438 |
439 | 440 |
441 |

参考文档

442 |
    443 |
  1. amdjs-api wiki
  2. 444 |
  3. Modules/1.1.1
  4. 445 |
  5. AMD is better for the web than CommonJS modules
  6. 446 |
  7. AMD is Not the Answer
  8. 447 |
  9. Reply to Tom on AMD
  10. 448 |
  11. Why Web Modules?
  12. 449 |
  13. Why AMD?
  14. 450 |
  15. RequireJS History
  16. 451 |
452 |
453 | 454 |
455 |

参考文档(cont.)

456 |
    457 |
  1. CMD 模块定义规范
  2. 458 |
  3. 从 CommonJS 到 SeaJS
  4. 459 |
  5. 从 RequireJS 到 SeaJS (1), (2), (3), (4), (5)
  6. 460 |
  7. 模块加载器获取URL的原理
  8. 461 |
  9. AMD 和 CMD 的区别有哪些?
  10. 462 |
  11. 使用 AMD、CommonJS 及 ES Harmony 编写模块化的 JavaScript
  12. 463 |
464 |
465 | 466 |
467 |

Q&A

468 |

- EOF -

469 |
470 |
471 | 472 |
473 | 474 | 475 | 476 | 477 | 506 | 507 | 508 | --------------------------------------------------------------------------------