SlideShare a Scribd company logo
1 of 91
Download to read offline
Sass 
13年12月6日金曜日
What’s Sass? 
13年12月6日金曜日
そもそも 
13年12月6日金曜日
CSSは貧弱 
13年12月6日金曜日
.button {...} 
.button .last {...} 
.button .last span {...} 
.button .txt {...} 
.button .txt .tag {...} 
.button .txt p {...} 
.button a {...} 
.button a:after {...} 
13年12月6日金曜日
.button {...} 
.button .last {...} 
.button .last span {...} 
.button .txt {...} 
.button .txt .tag {...} 
.button .txt p {...} 
.button a {...} 
.button a:after {...} 
13年12月6日金曜日
(ヽ́ω`)グッタリ 
13年12月6日金曜日
.button { font-size: 13px; } 
... 
.footer .sub a { font-size: 13px; } 
... 
.button_active .txt p { font-size: 13px; } 
13年12月6日金曜日
.button { font-size: 13px; } 
... 
.footer .sub a { font-size: 13px; } 
... 
.button_active .txt p { font-size: 13px; } 
13年12月6日金曜日
(ヽ́ω`)グッタリ 
13年12月6日金曜日
.button { 
font-size: 13px; 
height: 33px; 
text-align: center; 
z-index: 2; 
border: 1px solid #000; 
} 
13年12月6日金曜日
.button { 
font-size: 13px; 
height: 33px; 
text-align: center; 
z-index: 2; 
border: 1px solid #000; 
} 
<div class=”buttn CtlR”> ... </div> 
<a href=”#” class=”buttn”> ... </a> 
<div class=”buttn” data-sid=”i000000”> ... </div> 
13年12月6日金曜日
.button { 
font-size: 13px; 
height: 33px; 
text-align: center; 
z-index: 2; 
border: 1px solid #000; 
} 
<div class=”buttn CtlR”> ... </div> 
<a href=”#” class=”buttn”> ... </a> 
<div class=”buttn” data-sid=”i000000”> ... </div> 
13年12月6日金曜日
(ヽ́ω`)グッタリ 
13年12月6日金曜日
.button { 
-webkit-border-radius: 3px; 
-moz-border-radius: 3px; 
-ms-border-radius: 3px; 
-o-border-radius: 3px; 
border-radius: 3px; 
} 
13年12月6日金曜日
.button { 
-webkit-border-radius: 3px; 
-moz-border-radius: 3px; 
-ms-border-radius: 3px; 
-o-border-radius: 3px; 
border-radius: 3px; 
} 
13年12月6日金曜日
(ヽ́ω`)グッタリ 
13年12月6日金曜日
<head> 
... 
<link rel="stylesheet" type="text/css" href="../css/s.css" > 
<link rel="stylesheet" type="text/css" href="style.css" > 
<link rel="stylesheet" type="text/css" href="../css/sp.css" > 
<link rel="stylesheet" type="text/css" href="../css/sp_2.css" > 
<link rel="stylesheet" type="text/css" href="real_s.css" > 
<link rel="stylesheet" type="text/css" href="common.css" > 
... 
</head> 
13年12月6日金曜日
(ヽ́ω`)グッタリ 
13年12月6日金曜日
同じことを何度も... 
クロスブラウザ対応... 
管理が... 
13年12月6日金曜日
つ Sass 
13年12月6日金曜日
What’s Sass? 
13年12月6日金曜日
メタ言語 
13年12月6日金曜日
CSSの記入を 
楽にするもの 
13年12月6日金曜日
CSS = Sass ? 
13年12月6日金曜日
No 
13年12月6日金曜日
Sassのファイルはブラウザで直接読めません 
13年12月6日金曜日
13年12月6日金曜日
どうやってコンパイルすんの? 
13年12月6日金曜日
13年12月6日金曜日
実際に書いてみる 
13年12月6日金曜日
CSS 
.touch { ... } 
.touch .button { ... } 
.touch span { color: #aaa } 
.touch .txt { ... } 
.touch a { ... } 
.touch a:hover { color: #aaa } 
.touch .sub { ... } 
.touch > div { color: #aaa } 
13年12月6日金曜日
Sass 
.touch { ... } 
.touch .button { ... } 
.touch span { color: #aaa } 
.touch .txt { ... } 
.touch a { ... } 
.touch a:hover { color: #aaa } 
.touch .sub { ... } 
.touch > div { color: #aaa } 
13年12月6日金曜日
なにも変わっていない... 
13年12月6日金曜日
それがいい 
13年12月6日金曜日
・覚えたものから使っていける 
・環境にそぐわないものは省ける 
13年12月6日金曜日
Sassのイケてる機能たち 
13年12月6日金曜日
入れ子 
13年12月6日金曜日
.button {...} 
.button .last {...} 
.button .last span {...} 
.button .txt {...} 
.button .txt .tag {...} 
.button .txt p {...} 
.button a {...} 
.button a:after {...} 
13年12月6日金曜日
.button {...} 
.button .last {...} 
.button .last span {...} 
.button .txt {...} 
.button .txt .tag {...} 
.button .txt p {...} 
.button a {...} 
.button a:after {...} 
13年12月6日金曜日
.button { 
} 
13年12月6日金曜日
.button { 
.last { 
} 
.txt { 
} 
a { 
} 
} 
13年12月6日金曜日
.button { 
.last {... 
span {...} 
} 
.txt {... 
.tag {...} 
p {...} 
} 
a {... 
&:after {...} 
} 
} 
13年12月6日金曜日
変数 
13年12月6日金曜日
.button { font-size: 13px; } 
.footer .sub a { font-size: 13px; } 
.button_act .txt p { font-size: 13px; } 
13年12月6日金曜日
.button { font-size: 13px; } 
.footer .sub a { font-size: 13px; } 
.button_act .txt p { font-size: 13px; } 
13年12月6日金曜日
$base_fs = 13px; 
13年12月6日金曜日
$base_fs = 13px; 
.button { font-size: $base_fs; } 
.footer .sub a { font-size: $base_fs; } 
.button_act .txt p { font-size: $base_fs; } 
13年12月6日金曜日
継承 
13年12月6日金曜日
似たスタイルってできがち 
13年12月6日金曜日
.twitter_button { 
height: 33px; 
border: 1px solid #000; 
/* 独自定義 */ 
} 
.facebook_button { 
height: 33px; 
border: 1px solid #000; 
/* 独自定義 */ 
} 
13年12月6日金曜日
.twitter_button { 
height: 33px; 
border: 1px solid #000; 
/* 独自定義 */ 
} 
.facebook_button { 
height: 33px; 
border: 1px solid #000; 
/* 独自定義 */ 
} 
13年12月6日金曜日
.twitter_button, .facebook_button { 
height: 33px; 
border: 1px solid #000; 
} 
. twitter_button { 
/* 独自定義 */ 
} 
.facebook_button { 
/* 独自定義 */ 
} 
13年12月6日金曜日
%base_button { 
height: 33px; 
border: 1px solid #000; 
} 
13年12月6日金曜日
%base_button { 
height: 33px; 
border: 1px solid #000; 
} 
. twitter_button { 
/* 独自定義 */ 
} 
.facebook_button { 
/* 独自定義 */ 
} 
13年12月6日金曜日
.base_button { 
height: 33px; 
border: 1px solid #000; 
} 
. twitter_button { 
@extend %base_button; 
/* 独自定義 */ 
} 
.facebook_button { 
@extend %base_button; 
/* 独自定義 */ 
} 
13年12月6日金曜日
mixin 
13年12月6日金曜日
.twitter_button { 
height: 33px; 
border: 1px solid #000; 
background-color: #66C9E9; 
} 
.facebook_button { 
height: 33px; 
border: 1px solid #000; 
background-color: #3C5A98; 
} 
13年12月6日金曜日
.twitter_button { 
height: 33px; 
border: 1px solid #000; 
background-color: #66C9E9; 
} 
.facebook_button { 
height: 33px; 
border: 1px solid #000; 
background-color: #3C5A98; 
} 
13年12月6日金曜日
.twitter_button { 
height: 33px; 
border: 1px solid #000; 
background-color: #66C9E9; 
} 
.facebook_button { 
height: 33px; 
border: 1px solid #000; 
background-color: #3C5A98; 
} 
13年12月6日金曜日
@mixin base_button($bc) { 
height: 33px; 
border: 1px solid #000; 
background-color: $bc; 
} 
13年12月6日金曜日
@mixin base_button($bc) { 
height: 33px; 
border: 1px solid #000; 
background-color: $bc; 
} 
13年12月6日金曜日
@mixin base_button($bc) { 
height: 33px; 
border: 1px solid #000; 
background-color: $bc; 
} 
13年12月6日金曜日
@mixin base_button($bc) { 
height: 33px; 
border: 1px solid #000; 
background-color: $bc; 
} 
13年12月6日金曜日
@mixin base_button($bc) { 
height: 33px; 
border: 1px solid #000; 
background-color: $bc; 
} 
. twitter_button { 
@include base_button(#66C9E9); 
} 
.facebook_button { 
@include base_button(#3C5A98); 
} 
13年12月6日金曜日
@mixin base_button($bc) { 
height: 33px; 
border: 1px solid #000; 
background-color: $bc; 
} 
. twitter_button { 
@include base_button(#66C9E9); 
} 
.facebook_button { 
@include base_button(#3C5A98); 
} 
13年12月6日金曜日
@mixin base_button($bc) { 
height: 33px; 
border: 1px solid #000; 
background-color: $bc; 
} 
. twitter_button { 
@include base_button(#66C9E9); 
} 
.facebook_button { 
@include base_button(#3C5A98); 
} 
13年12月6日金曜日
@mixin border-radius($br) { 
-webkit-border-radius: $br; 
-moz-border-radius: $br; 
-ms-border-radius: $br; 
-o-border-radius: $br; 
border-radius: $br; 
} 
13年12月6日金曜日
インポート 
13年12月6日金曜日
<head> 
... 
<link rel="stylesheet" type="text/css" href="../css/s.css" > 
<link rel="stylesheet" type="text/css" href="../css/sp.css" > 
<link rel="stylesheet" type="text/css" href="real_s.css" > 
<link rel="stylesheet" type="text/css" href="common.css" > 
... 
</head> 
13年12月6日金曜日
s.cssだけにしたい... 
13年12月6日金曜日
s.scss 
_sp.scss 
_real_s.scss 
_common.scss 
13年12月6日金曜日
s.scss 
_sp.scss 
_real_s.scss 
_common.scss 
13年12月6日金曜日
Sass s.scss CSS s.css 
@import "_sp"; 
@import "_real_s"; 
@import "_common"; 
/* _sp.scssに記載した内容 */ 
/* _real_s.scssに記載した内容 */ 
/* _common.scssに記載した内容 */ 
13年12月6日金曜日
<head> 
... 
<link rel="stylesheet" type="text/css" href="../css/s.css" > 
... 
</head> 
13年12月6日金曜日
導入してみた 
13年12月6日金曜日
1 
13年12月6日金曜日
書かなくていい 
13年12月6日金曜日
書かなくていい 
- コピペミスが減る 
13年12月6日金曜日
書かなくていい 
- コピペミスが減る 
- 記述作業が減る 
13年12月6日金曜日
2 
13年12月6日金曜日
管理が楽ちん 
13年12月6日金曜日
管理が楽ちん 
- マージ事故が減る 
13年12月6日金曜日
管理が楽ちん 
- マージ事故が減る 
- 見通しがよくなる 
13年12月6日金曜日
3 
13年12月6日金曜日
セマンティック 
13年12月6日金曜日
セマンティック 
説明すると長いから後でググってください... 
「OOCSS Sass」 
13年12月6日金曜日
困ったこと 
13年12月6日金曜日
組み方 
13年12月6日金曜日
IE 
13年12月6日金曜日
おしまい 
13年12月6日金曜日

More Related Content

Featured

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Sass