0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【Nuxt.js】Sassの導入方法

0
Posted at

🎈 この記事はWP専用です
https://wp.me/pc9NHC-sc

前置き

Sassを使えば
スタイリングを入れ子にして書けたり、
スタイリングの値を変数したり、
管理が便利で見やすくなります🌟

そもそもSassとは何か、
そして導入方法や使用例をご紹介🎀

Sassとは

Syntactically Awesome Stylesheets

構文的に素晴らしいスタイルシート!
前置きの通り、
スタイリングの管理が便利になるものです🌟

2種類の記法

この2つの書き方があります。
SASS記法
SCSS記法

SassとSASSが非常に紛らわしいですね😂
Sassは言語で、SASSが記法です✍️

SASS記法

セレクタ やクラス名の {} や
値の後ろの ; を書かない書き方

style lang はsass

index.vue
<style lang="sass" scoped>
 div
   padding: 20px

   p 
     color: pink
</style>

SCSS記法

入れ子(ネスト)した書き方🌸
こちらの方が入れ子になっている感じが
パッと見て分かりやすいです✨👀
このブログではSCSS記法がメインです!

templateの構造と照らし合わせて
どこにどんなスタイルがあるのか
確認しやすいんです…✨

style lang はscss

index.vue
<style lang="scss" scoped>
 div {
   padding: 20px;

   > p {
     color: pink;
   }
 }
</style>

install

それでは早速インストールしてみましょう✨😄

🎈 続きはWPでご覧ください👀
https://wp.me/pc9NHC-sc

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?