技術記事以外

技術記事以外の振り返りやその日学んだことのちょっとしたメモなどを置く予定です

今日の学習メモ

Daily UX

  • Mobile first is not necessarily popular just because the mobile device arise. It is because we have to focus on the most important information/content when we design for a small screen.
  • Think ahead about what device you will support and think about multiple of them at the same time.

JS

  • async/awaitのエラーハンドリングはtrycatchでもいいけど、awaitか呼び出し元に.catch()つける方がスッキリするかも。Sample

Responsive Web Design

  • align-self はflexbox内のitem全体ではなく、その中の特定の要素にだけalignを指定したい時に使う。あんまり使ったことなかったな。
  • CSS Grid内の要素はデフォルトでalign-self:stretchになっている
  • repeatの引数は([回数], [値])なので、例えばrepeat(2, 1fr 50px) 20pxとするとgrid-area: 1fr 50px 1fr 50px 20pxとなる。
  • ここの回数の代わりにauto-fillを使うことができる。いつもお世話になっているよしなに調節してくれるあれですね。
  • auto-fitは挙動は似ているが、containerに空きスペースがあった時に空のcellを生成する。一方でauto-fillだとcellの幅が均等割付されてcontainerいっぱいになる。(containerが小さくて複数行になる時の挙動は一緒)
  • gridは入れ子にできる。やったことないな…