Top Banner
PIXNET F2E Anna Su 蕕笕ᐟ॰ CSS ጱ盅胙۱ 碝ಋӤ᪠ 2016/07/06 in 螈䦾虻懱
32

Rucksack 裝滿神奇 css 的後背包

Jan 09, 2017

Download

Engineering

Anna Su
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Rucksack 裝滿神奇 css 的後背包

PIXNET F2E ❤ Anna Su

CSS 2016/07/06 in

Page 2: Rucksack 裝滿神奇 css 的後背包

Anna Sui2

Page 3: Rucksack 裝滿神奇 css 的後背包

3

Page 4: Rucksack 裝滿神奇 css 的後背包

[ruksæk] rucksack

4

Page 6: Rucksack 裝滿神奇 css 的後背包

TJ

TJ Holowaychuk

6

Page 7: Rucksack 裝滿神奇 css 的後背包

What is rucksack?7

Page 9: Rucksack 裝滿神奇 css 的後背包
Page 10: Rucksack 裝滿神奇 css 的後背包

it's modular

10

Page 11: Rucksack 裝滿神奇 css 的後背包

it doesn't add any bloat

11

Page 12: Rucksack 裝滿神奇 css 的後背包

it's built on PostCSS

it's modular

it doesn't add any bloat

12

Page 13: Rucksack 裝滿神奇 css 的後背包

Installation & Usagehttp://simplaio.github.io/rucksack/docs/#usage

Page 14: Rucksack 裝滿神奇 css 的後背包

Installation & Usage

14

Page 15: Rucksack 裝滿神奇 css 的後背包

Installation & Usage

postcss: function() {

return {

plugins: rucksack([autoprefixer])

};

}

webpack.config.js

PostCSS for Webpack

15

Page 16: Rucksack 裝滿神奇 css 的後背包

Demo

16

Page 17: Rucksack 裝滿神奇 css 的後背包

Responsive Typography

17

Page 18: Rucksack 裝滿神奇 css 的後背包

.foo { font-size: responsive 14px 50px; font-range: 480px 800px;}

input

Responsive Typography

18

Page 19: Rucksack 裝滿神奇 css 的後背包

html {

font-size: calc(14px + 36 * ((100vw - 480px) / 320));

}

@media screen and (max-width: 480px) {

html {

font-size: 14px;

}

}

@media screen and (min-width: 800px) {

html {

font-size: 50px;

}

}

output

Responsive Typography

19

Page 20: Rucksack 裝滿神奇 css 的後背包

Responsive Typography

20

Page 21: Rucksack 裝滿神奇 css 的後背包

Shorthand Positioning

21

Page 22: Rucksack 裝滿神奇 css 的後背包

Shorthand Positioning

.box1 {

position: absolute 0;

}

.box2 {

position: relative 20% auto;

}

.box1 {

position: absolute;

top: 0;

right: 0;

bottom: 0;

left: 0;

}

.box2 {

position: relative;

top: 20%;

right: auto;

bottom: 20%;

left: auto;

}

input output

22

Page 23: Rucksack 裝滿神奇 css 的後背包

Shorthand Positioning

.box3 {

position: fixed 0 20px 10px;

}

.box3 { position: fixed; top: 0; right: 20px; bottom: 10px; left: 20px;}

input output

23

Page 24: Rucksack 裝滿神奇 css 的後背包

Hex Rgba Shortcuts

24

Page 25: Rucksack 裝滿神奇 css 的後背包

Hex RGBA Shortcutsinput

output

background-color: rgba(#2196F3, 0.3);

background-color: rgba(33, 150, 243, 0.3);

25

Page 26: Rucksack 裝滿神奇 css 的後背包

Quantity Pseudo-Selectors

26

Page 27: Rucksack 裝滿神奇 css 的後背包

Quantity Pseudo-Selectorsinput output

li&:at-least(5) {

color: blue;

}

li:nth-last-child(n+4),

li:nth-last-child(n+4) ~ li {

color: blue;

}

27

Page 28: Rucksack 裝滿神奇 css 的後背包

All The Easings

28

Page 29: Rucksack 裝滿神奇 css 的後背包

All The Easingsinput

output

transition: all 250ms ease-in-quint;

transition: all 250ms cubic-bezier(0.755, 0.05, 0.855, 0.06);

29

Page 30: Rucksack 裝滿神奇 css 的後背包

Rucksack makes CSS development fun again

Page 31: Rucksack 裝滿神奇 css 的後背包

Referencerucksack https://simplaio.github.io/rucksack/

PostCSS: the Future after Sass and Less https://ai.github.io/about-postcss/en/

TJ Holowaychuk Github https://github.com/tj/frontend-boilerplate

Page 32: Rucksack 裝滿神奇 css 的後背包

Thanks ❤