Chapter 06

CSS 実装編

gia
gia
2022.02.08に更新
このチャプターの目次

CSS を実装する

// style.css

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 500px;
}

.popup-dialog-wrapper {
  border: rgba(13, 13, 13, 0.3) 5px solid;
}

.title-wrapper {
  height: 43px;
  background-color: #fff;
  padding: 0 38px;
  display: flex;
  align-items: center;
}

.title {
  font-size: 18px;
  line-height: 21px;
}

.main-content-wrapper {
  display: flex;
  flex-flow: column;
  justify-content: center;
  align-items: center;
  background-color: #EFEEF4;
  padding: 18px 38px;
}

.thumbnail-text-wrapper {
  margin-bottom: 18px;
}

.thumbnail-text {
  font-weight: bold;
  font-size: 30px;
  line-height: 35px;
  color: #4E4E4E;
}

.youtube-thumbnail-getter-thumbnail-img {
  width: 100%;
}

html はこんな感じ

// popup-dialog.html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="./style.css">
  <title>youtube thumbnails getter</title>
</head>
<body>
  <div
    class="popup-dialog-wrapper"
  >
    <div class="title-wrapper">
      <div class="title">youtube thumbnails getter</div>
    </div>
    <div class="main-content-wrapper">
      <div class="thumbnail-text-wrapper">
        <div class="thumbnail-text">thumbnail</div>
      </div>
      <img
        id="youtube-thumbnail-getter-thumbnail-img"
        class="youtube-thumbnail-getter-thumbnail-img"
        src="https://cdn.pixabay.com/photo/2021/03/02/01/07/cyberpunk-6061251_960_720.jpg"
        alt="サムネイル"
      >
    </div>
  </div>
  <script src="./index.js"></script>
</body>
</html>

拡張機能更新

ポップアップダイアログのスタイルを確認

いい感じ🎉

これで CSS の実装も完了

おつかれさまでした🍵