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 3 years have passed since last update.

HTML、CSSの実践の書き方

Last updated at Posted at 2020-09-12

BEMとSMACSSを組み合わせる
※Sassを覚えたらSassも取り入れる

#【BEM】

{Block}__{Element}
{Block}-{Modifier}
{Block}__{Element}-{Modifier}

----- 例 -----

.archiveItem {
  margin-bottom: 20px;
}
.archiveItem__inner {
  display: flex;
  padding: 10px;
}
.archiveItem__thumb {
  margin-right: 20px;
}

#【SMACSS】

– Base
– Layout
– Module
– State
– Theme

----- 例 -----

body {}
html {}
 
/*---------- Layout ----------*/
 
.l-header {}
.l-footer {}
.l-main {}
.l-sidebar {}
 
/*---------- Module ----------*/
 
.button {}
.is-button-warning {} 
.label {}
.is-label-hidden {} 
.is-label-error {}
.heading {}

/*---------- Theme ----------*/
 
.dark-mode {}
.light-mode {}

※BEMが使えるものはレイアウトに入れ、BEMを使わないものはモジュールに入れる

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?