- 環境設定
- 細かい機能
- mixin(,include), placeholder, extend
- Module
- Dart版とそれまでの違い
- 詳細度
- CSS設計等
- 概要 1分
- 競合 2分
- 記法 1分
- よく使う機能 15分くらい
- Nesting
- Variable, Interpolation
- Parent Selector
Sass is ツヨツヨなプリプロセッサ(前処理)でオラオラしてCSSに出力してくれるツール
CSS仕様上、CSSを動的にする訳にはいかない(マッチングと再レンダリングが恐ろしく増えるから) →せやツヨツヨ前処理 を CSSに変換したろ!
- Less
- Sass(SCSS)
- Stylus
- PostCSS https://postcss.org/
SASS記法と、後発のSCSS記法がある SCSS記法のほうが人気で、プラグイン対応も多い
https://sass-lang.com/guide#topic-3
https://sass-lang.com/guide#topic-3
"#{$val}"
変数展開
$name: avatar;
.icon-#{$name} {
background-image: url("/icons/#{$name}.svg");
font-size: "#{(100 / 10)}";
}
↓
.icon-avatar {
background-image: url("/icons/avatar.svg");
font-size: "10";
}
https://sass-lang.com/documentation/style-rules/parent-selector
sass2css https://sass2css.herokuapp.com/
codepen https://codepen.io/
ユーティリティクラス作成例 https://gist.github.com/harapeko/449ce613d91b6c919111f169c92d9035