> For the complete documentation index, see [llms.txt](https://shufo.gitbook.io/rscss/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shufo.gitbook.io/rscss/components/layouts.md).

# レイアウト（Layouts）

![.recipe-listというレイアウトと.recipe-itemコンポーネント](https://1824161834-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LzHMp2qRyOnHJ9hTLNO%2F-LzIOOn8kg01eirYmd9e%2F-LzIqQs9KnaZuvUZ_kxp%2Fimage.png?alt=media\&token=60277984-b5c8-42fa-a2d5-150948b242f7)

## 位置指定プロパティを避ける

コンポーネントは異なるコンテキストで再利用可能なように作られるべきです. なので以下のようなプロパティをコンポーネントで指定することは避けてください.

* 位置指定（`position`, `top` , `left` , `right` , `bottom`）
* Floats (`float` , `clear` )
* マージン(`margin`)
* 寸法(`width` , `height`)

## 固定サイズ

ただしアバターやロゴのような固定サイズの要素は例外として扱うことが出来ます.

## 親要素で位置指定する

もし位置指定が必要な場合その要素が存在するコンテキストで定義してみてください.  下記の例でコンポーネントそれ自体ではなく、リストコンポーネントにwidthとfloatが適用されているように.

```css
.article-list {
  & {
    @include clearfix;
  }

  > .article-card {
    width: 33.3%;
    float: left;
  }
}

.article-card {
  & { /* ... */ }
  > .image { /* ... */ }
  > .title { /* ... */ }
  > .category { /* ... */ }
}
```

レイアウトの外のマージンを指定するにはどうしたらいいでしょう？ヘルパーでやってみましょう [Continue →](https://app.gitbook.com/@shufo/s/rscss/~/drafts/-LzJ1Y5OzltmnbwgEVZx/konpnentocomponents/heruphelpers)
