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
SASS 让你更爽的编写 CSS
Search
Praise Song
July 31, 2012
Technology
330
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SASS 让你更爽的编写 CSS
SASS 让你更爽的编写 CSS
Praise Song
July 31, 2012
Other Decks in Technology
See All in Technology
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」紹介資料
laysakura
2
9k
攻撃と防御で学ぶAI時代のプロダクトセキュリティ演習
recruitengineers
PRO
9
2.7k
Webアクセシビリティ入門 2026
recruitengineers
PRO
3
560
LanceDB入門
mocobeta
7
470
クラウドセキュリティ入門 ~安全なクラウド利用のための基礎知識~
lhazy
13
8.7k
モバイルアプリ開発概論2026
recruitengineers
PRO
5
580
Data Hubグループ 紹介資料
sansan33
PRO
0
3.2k
SmartHR Engineering Team Deck
smarthr
1
2.1k
会社紹介資料 / Sansan Company Profile
sansan33
PRO
23
430k
今こそ聞きたいソフトウェア設計 ドメイン駆動設計再入門
masuda220
PRO
17
7.2k
【CEDEC2026】グラフィックスエンジニアのためのニューラルシェーディング入門
cygames
PRO
0
150
私がブラウザを自作したくなった理由
supurazako
1
230
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Believing is Seeing
oripsolob
1
190
Producing Creativity
orderedlist
PRO
348
40k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
エンジニアに許された特別な時間の終わり
watany
108
250k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
430
We Are The Robots
honzajavorek
0
300
The Art of Programming - Codeland 2020
erikaheidi
57
14k
A Tale of Four Properties
chriscoyier
163
24k
The Spectacular Lies of Maps
axbom
PRO
1
910
Transcript
颂赞 h#p://qiqicartoon.com
What is SASS?
SASS 是一个 CSS3 扩展,为 CSS 扩展了嵌套规则、变量、混入、继承、函数 等强大的功能。SASS 的使命是让 CSS 更有趣味 J • CSS 超集 • CSS3 扩展 • 使 CSS 更有趣 • SCSS and SASS • Hampton Catlin、Nathan Weizenbaum、Chris Eppstein h#p://sass-‐lang.com/
Features 1、Fully CSS3-‐compaFble 2、Language extensions such as variables,
nesFng, and mixins 3、Many useful funcFons for manipulaFng colors and other values 4、Advanced features like control direcFves for libraries 5、Well-‐forma#ed, customizable output 6、Firebug integraFon
Welcome to the SASS world J
Install SASS $ gem install sass
Variables 从 $ 开始 $variables name : vaiables value;
SCSS SASS
Compile
Compile
Nested SCSS SASS CSS
Mixins SCSS SASS CSS
Selector Inheritance SCSS SASS CSS
Reference Parent 使用 & 语法糖引用父层
Comments 双斜线注释将被忽略
SASSScript Data Types
SASSScript OperaFons
SASSScript OperaFons
SASS Script Oper aFon s-‐ Color
@import SASS CSS • @import “common.css”;
• @import “common” screen; • @import h#p://alipay.com/common.css; • @import url(); • @import “common.scss/sass”; • @import “common”;
@media
Control DirecFves • @if • @while •
@for • @each
@funcFon
回过头来再看 SASS • 大型样式表 • 制定样式规范 •
团队开发 优点 缺点 适用于 • 学习成本低 • 降低样式表维护成本 • 适用于多人开发 • 性能优越 OMG,我无缺点 J
SASS VS LESS • 实现原理不同 • 创建变量的方式不同
• 预编绎机制不同 • 作用域表现不同 • mixin 方式不同 • SASS 比 LESS 的数学运算能力更强 • LESS 没有 SASS 的 Control DirecFve
Hi,Let’s wriFng SASS J @知托付-‐颂赞