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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
作品が生態系になった ─ Mini Tokyo 3D から世界へ
nagix
0
120
ペアプロの価値はコードを書くことだけじゃない
codmoninc
PRO
0
140
Multica × 長期記憶:40個のミニプロジェクト管理
eiei114
1
210
2026-09-10 【Snowflake World Tour Tokyo 2026】dbt Core と Snowflake で実現する多層的なデータガバナンス / Multi-Layered Data Governance Powered by dbt Core and Snowflake
civitaspo
0
230
「図書館」という名前のままでいいのか -Code4Lib JAPANカンファレンス2026 アンカンファレンス報告- / Code4Lib JAPAN Conference 2026: Unconference Report
ykiyota
0
110
SQL文一行も書けない人事がCortexもろもろを使って人事業務を楽にしてみる
ponponmikankan
1
150
10分で知る最近のOmarchy
komagata
0
130
生成AIのテナント制御とシャドーMCP対策 | AIを"止めずに"、情報を守る
yukun
0
130
Deploying a Full-Stack Bun-Native Framework on Cloudflare Workers
7nohe
0
110
Where Is JetBrains AI Heading- — Central CLI, Air Alpha, and the Agentic Development Stack
x5gtrn
PRO
0
150
[DroidKaigi 2026] Making UI specifications visible: Android UI development in the AI agent era supported by Compose Screenshot Testing and galleries
syarihu
0
610
Bet AI Day 2026丨バクラク Autopilot、業務システムの再設計
layerx
PRO
2
1.6k
Featured
See All Featured
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
370
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The Pragmatic Product Professional
lauravandoore
37
7.4k
How to build a perfect <img>
jonoalderson
1
6k
30 Presentation Tips
portentint
PRO
1
390
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Become a Pro
speakerdeck
PRO
31
6.2k
The Spectacular Lies of Maps
axbom
PRO
1
980
Navigating Team Friction
lara
192
16k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
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 @知托付-‐颂赞