Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Stylus by 陳柏穎
Search
kvzhuang
February 18, 2014
Education
1
670
Stylus by 陳柏穎
kvzhuang
February 18, 2014
Tweet
Share
More Decks by kvzhuang
See All by kvzhuang
Immutable In JavaScript
kvzhuang
1
9.5k
F2E.tw in Developer Party 2014
kvzhuang
0
2.9k
人本設計 - by Akane Lee
kvzhuang
0
990
JavaScript 程式設計
kvzhuang
0
100
My Pocket Monster
kvzhuang
0
45
CoffeeScript
kvzhuang
1
1.2k
Liferay Portal
kvzhuang
1
140
Introduction of TypeScript
kvzhuang
0
280
Other Decks in Education
See All in Education
4 занятие. Разбор бизнес-моделей и метод красной нити #ideaNN 9.02.2024.
karlov
0
230
Monaca Educationを活用したプログラミング授業実践
asial_edu
0
200
パフォーマンス・チューニング入門
oracle4engineer
PRO
2
620
Copilotとして理解する生成AI利用の基本
gmoriki
0
130
Data Processing and Visualisation Frameworks - Lecture 6 - Information Visualisation (4019538FNR)
signer
PRO
1
1.7k
高可用性システム構築 - Oracle Data Guard基本編
oracle4engineer
PRO
2
1.1k
2023年度桜井政成ゼミ資料_論文の探し方・読み方
masanari
6
2.2k
Родина моя Беларусь в лицах
programmer_sch2np
0
160
H5P-työkalut
matleenalaakso
3
32k
【潔能講堂】永續環境、擁抱綠能 太陽能光電發展現況與產業製程解析
learnenergy2
0
120
キャリアと組織の成長塾#1 アスリートからエンジニアの道へ
takashi_toyosaki
2
750
千葉県印西市立・原山小学校における新たな学び「情報探究の時間」実践報告』
codeforeveryone
1
710
Featured
See All Featured
Designing for Performance
lara
601
67k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
The Cult of Friendly URLs
andyhume
74
5.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
14
1.5k
Side Projects
sachag
451
41k
Building Effective Engineering Teams - LeadDev
addyosmani
28
1.8k
No one is an island. Learnings from fostering a developers community.
thoeni
16
2.1k
Become a Pro
speakerdeck
PRO
11
4.5k
Rails Girls Zürich Keynote
gr2m
91
13k
Typedesign – Prime Four
hannesfritz
36
2.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
9
8.3k
The Invisible Customer
myddelton
114
12k
Transcript
易上⼿手的 CSS preprocessor Front-End Developers Taiwan Party - 5! DSL時代!把程式寫給⼈人看
http://poying.me/ 陳柏穎 http://github.com/poying
易上⼿手的 CSS preprocessor Stylus ❖ NodeJS! ❖ 可在瀏覽器上 compile! ❖
仿 Sass
特⾊色 ❖ 可使⽤用純 CSS 語法! ❖ “可”去除 {}! ❖ “可”去除
;! ❖ “可”去除 :! ❖ “少”強迫性的語法! ❖ Mixin / Transparent mixins! ❖ Block property access
語法彈性 不會有適應新語法的過渡期! 基本語法可以適應我們的個⼈人偏好
Stylus
Sass
不要強迫我 >< 在 sass 或 less 中不管是變數、︑mixin! 還是其他常⽤用的語法都會需要加⼀一些前綴 雖然⽴立意良好,但是被強迫的感覺真的不好 以
sass 為例! 變數前⾯面加上 $ 可以很明確知道他是個變數! 但想換其他前綴呢︖?不能
不要強迫我 >< 在 還是其他常⽤用的語法都會需要加⼀一些 雖然⽴立意良好,但是被強迫的感覺真的不好 以 sass 為例! 變數前⾯面加上 $
可以很明確知道他是個變數! 但想換其他前綴呢︖?不能
不要強迫我 >< 在 還是其他常⽤用的語法都會需要加⼀一些 雖然⽴立意良好,但是被強迫的感覺真的不好 以 sass 為例! 變數前⾯面加上 $
可以很明確知道他是個變數! 但想換其他前綴呢︖?不能
None
Mixins 以更 “css” 的⽅方式來使⽤用 mixin! 這是 stlyus 的最⼤大賣點之⼀一
Mixins 以更 “css” 的⽅方式來使⽤用 mixin! 這是 stlyus 的最⼤大賣點之⼀一
None
Block property access 另個 stylus 的殺⼿手級特點
None
Mixins + Block property access = 神器
None
其他功能 http://learnboost.github.io/stylus/docs
限制 雖然有很多優點,但不能算是完美! ! stylus 考慮了很多基本語法上⾯面的彈性,! 對於⼀一般網⾴頁開發⽽而⾔言非常⽅方便,! 但對於過於複雜的事情處理的不是很好雜! 所以不適合拿來玩奇技淫巧
None
宿命 因為使⽤用 NodeJS 所以 NodeJS 本身的問題也會是 Stylus 的問題! 在 Watch
部分 Stylus 無法知道有新檔案加入
安裝、使⽤用 $ npm install -g stylus! $ stylus -w ./styl
-o ./css
None