JSFiddle - React, Tailwind, and code Playground

by takumi091111

HTML

<div class="modal__item">
  <div class="modal__item-inner">
    <div class="modal__item-left">
      <p class="modal__item-title">タイトル</p>
    </div>
    <div class="modal__item-right">
      <p class="modal__item-text">テスト</p>
    </div>
  </div>
</div>

<div class="modal__item modal__item--highlight">
  <div class="modal__item-inner">
    <div class="modal__item-left">
      <p class="modal__item-title">タイトル</p>
    </div>
    <div class="modal__item-right modal__item-right--highlight">
      <p class="modal__item-text">
        ●テストテストテスト<br>
        ●テストテストテスト<br>
        ●テストテストテスト<br>
        ●テストテストテスト
      </p>
    </div>
  </div>
</div>

<div class="modal__item modal__item--highlight">
  <div class="modal__item-inner">
    <div class="modal__item-left">
      <p class="modal__item-title">タイトル</p>
    </div>
    <div class="modal__item-right modal__item-right--highlight">
      <p class="modal__item-text">テスト</p>
    </div>
  </div>
</div>

CSS

html, body {
  margin: 0 10px;
}
p {
  margin: 0;
}
.modal__item {
  position: relative;
  padding: 15px 0;
}
.modal__item::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: calc(100% - 10px);
  height: 1px;
  background-image: linear-gradient(to right, #999999, #999999 1px, transparent 1px, transparent 3px);
  background-size: 3px 1px;
  background-position: left bottom;
  background-repeat: repeat-x;
  border: 0;
  text-align: left;
}
.modal__item-inner {
  display: flex;
  flex-wrap: nowrap;
}
.modal__item-left {
  display: flex;
  align-items: center;
  width: 150px;
  padding: 12px 12px 12px 0;
}
.modal__item-right {
  width: calc(100% - 150px);
  padding: 14px;
}
.modal__item-right.modal__item-right--highlight {
  border: 2px solid #7ECEF4;
  padding: 12px;
}
.modal__item-title,
.modal__item-text {
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 1px;
}
.modal__item-title {
    font-weight: bold;
}

@media screen and (max-width: 480px) {
  .modal__item-inner {
    flex-wrap: wrap;
  }
  .modal__item {
    padding: 15px 0;
  }
  .modal__item::after {
    left: 15px;
    width: calc(100% - 30px);
  }
  .modal__item.modal__item--highlight {
    padding: 10px 0;
  }
  .modal__item-left {
    padding: 0 12px 0;
  }
  .modal__item-right {
    width: 100%;
    padding: 10px 12px 0;
  }
  .modal__item-right.modal__item-right--highlight {
    margin-top: 4px;
    margin-bottom: 2px;
    padding: 6px 12px 4px;
  }
  .modal__item-title,
  .modal__item-text {
    line-height: 1.5;
  }
}