LoginSignup
0
0

More than 3 years have passed since last update.

Sassについて

Last updated at Posted at 2021-03-04

SassとScssとは

CSSをより簡略化したメタ言語です!
この2つの共通点は入れ子構造で書くことです。

index.html
<div class="header">
 <div class="header-logo">Sassについて</div>
</div>
style.css
.header {
 heigth:90px;
 color:black;
}

.header-logo {
 font-size:40px;
 border-bottom:4px solid black;
}

と入力するとしましょう。
これが普段のcssの入力の仕方ですね👍

Sassの場合は、少し記入の仕方が変わります。

atyle.scss
.header
 heigth:90px
 color:black
 .header-logo
  font-size:40px
  border-bottom:4px solid black

となります。
ちなみにScssで書く場合はこうなります。

style.scss
.header {
 heigth:90px;
 color:black;
 .header-logo{
  font-size:40px;
  border-bottom:4px solid black;
  }
}

みたくなる。
HTMLの親要素と子要素に共通する書き方ですね。つまり入れ子です。
ちなみにcssであたっていない場合はデベロッパーツールで確認しますが、これら(以下sass)は、崩れて画面真っ黒、そして黒い画面でエラーを訴えてくるのですね🥲

以上がSassの説明でした。
次の記事では導入について書いていきます👍

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0