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.

CSS Architecture

Last updated at Posted at 2021-06-20

CSS Architecture

Pattern

Detail

OOCSS

Object-Oriented CSS (オブジェクト指向CSS)

- Separate structure and skin
- Separate container and content

SMACSS

Scalable and Modular Architecture for CSS

- ベースルール
    - このルールはほとんど単独で1つの要素セレクタとなるが、属性セレクタや疑似クラスセレクタ、子セレクタ、兄弟セレクタを利用することもできる。原則的にベーススタイルはあるページにおいての要素に対して、その要素の見た目がこうであると定義するものになる。
- レイアウトルール
    - レイアウトルールはページをセクション毎に分割する。レイアウトは1つ以上のモジュールを保持する。
- モジュール
    - デザインにおいて再利用可能なモジュラーパーツだ。吹き出しであり、サイドバーセクションであり、商品リストなどはその例になる。
- 状態(ステート)
    - ある特定の状態においてモジュールやレイアウトがどうスタイルされるかを説明する方法だ。
- テーマ
    - 状態(ステート)ルールとモジュールやレイアウトがどう見えるかという点では同様のルールとなる。

BEM

BEM (Block, Element, Modifier) is a component-based approach to web development.

- Block
    - The block name describes its purpose ("What is it?" — menu or button), not its state ("What does it look like?" — red or big).
    - The block shouldn't influence its environment, meaning you shouldn't set the external geometry (margin) or positioning for the block.
- Element
    - The element name describes its purpose ("What is this?" — item, text, etc.), not its state ("What type, or what does it look like?" — red, big, etc.).
    - The structure of an element's full name is block-name__element-name. The element name is separated from the block name with a double underscore (__).
- Modifier
    - The modifier name describes its appearance ("What size?" or "Which theme?" and so on — size_s or theme_islands), its state ("How is it different from the others?" — disabled, focused, etc.) and its behavior ("How does it behave?" or "How does it respond to the user?" — such as directions_left-top).
    - The modifier name is separated from the block or element name by a single underscore (_).

MCSS

CSSモジュール(及び、その内部ブロック)はレイヤーごとに分離され、そのそれぞれのレイヤーは他のレイヤーモジュールと連携したり、一方的に利用するような独自のルールを持つことになります。

- レイヤー 1 — ベース(ファーストレイヤー)
    - ファーストレイヤーはウェブサイトの骨子で、インターフェースの中心部分です。最も再利用可能で抽象的な構造に基づいています。
- レイヤー 2 — プロジェクト(セカンドレイヤー)
    - セカンドレイヤーは、分離された、ページを構成するプロジェクトモジュールを含みます
- レイヤー 3 — コスメティック(サードレイヤー)
    - サードレイヤーはシンプルで、わずかに影響するスタイルから成ります

APBCSS

Atomic Design + OOCSS + SMACSS = Atomic Parts Base CSS (APB CSS)

- Atomic:Class name of atom
- Module:UI package name
- Skin:Class name of decoration
- Number:Numbering of the class name
- State:Class name that represents the state
- Other:Other class name

FLOCSS

FLOCSSは次の3つのレイヤーと、Objectレイヤーの子レイヤーで構成されます。

- Foundation - reset/normalize/base...
- Layout - header/main/sidebar/footer...
- Object
    - Component - grid/button/form/media...
    - Project - articles/ranking/promo...
    - Utility - clearfix/display/margin...

RSCSS

Reasonable System for CSS Stylesheet Structure.

- Elements
    - reset/normalize/base...Elements are things inside your component.
- Variants
    - Components may have variants. Elements may have variants, too.
- Nested components
- Layouts
- Helpers
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?