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
4
320
SASS 让你更爽的编写 CSS
SASS 让你更爽的编写 CSS
Praise Song
July 31, 2012
Tweet
Share
Other Decks in Technology
See All in Technology
旅先で iPad + Neovim で iOS 開発・執筆した話
zozotech
PRO
0
100
茨城の思い出を振り返る ~CDKのセキュリティを添えて~ / 20260201 Mitsutoshi Matsuo
shift_evolve
PRO
1
420
Cloud Runでコロプラが挑む 生成AI×ゲーム『神魔狩りのツクヨミ』の裏側
colopl
0
140
配列に見る bash と zsh の違い
kazzpapa3
3
170
ECS障害を例に学ぶ、インシデント対応に備えたAIエージェントの育て方 / How to develop AI agents for incident response with ECS outage
iselegant
4
420
インフラエンジニア必見!Kubernetesを用いたクラウドネイティブ設計ポイント大全
daitak
1
390
コスト削減から「セキュリティと利便性」を担うプラットフォームへ
sansantech
PRO
3
1.6k
AIが実装する時代、人間は仕様と検証を設計する
gotalab555
1
550
Amazon Bedrock Knowledge Basesチャンキング解説!
aoinoguchi
0
160
Webhook best practices for rock solid and resilient deployments
glaforge
2
310
Cosmos World Foundation Model Platform for Physical AI
takmin
0
980
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
1
170
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
160
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
740
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.2k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Speed Design
sergeychernyshev
33
1.5k
Color Theory Basics | Prateek | Gurzu
gurzu
0
200
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
70
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
440
Utilizing Notion as your number one productivity tool
mfonobong
3
220
How to build a perfect <img>
jonoalderson
1
4.9k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
67
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 @知托付-‐颂赞