scss practice
prototype / hashtable
prototypeęģž hashtableė TIL ėėą x
https://besthorrorscenes.com/ íīëĄ ė―ëĐ
mainė headerė footerëĨž ė§ė ė ėžëĄ ę°ė§ ė ėëĪ.
(main ėė sectionė headerė footerëĨž ę°ė§ ė ėëĪ.)
mainė sectionėīë articleė ę°ė§ ė ėė§ë§, mainė ę°ė§ ė ėë ęąī body ëŋėīëĪ.
section ėė articleė ë°°ėđí ėë ėęģ , article ėė sectionė ë°°ėđí ėë ėëĪ.
articleė ë°ëė ė ëŠĐ(h1~h6)ė ę°ė ļėž íëĪ.
a:link, a:visited, a:hover, a:active ėėëĄ ėėąíīėž íëĪ. (LVHA)
index.html
<header>
  <h1>BEST HORROR SCENES</h1>
  <div class="intro">
    <p class="site-explain__main">
      <!-- ėĪëĩ -->
    </p>
    <p class="site-explain__details">
      <!-- ėĪëĩ -->
    </p>
  </div>
  <nav>
    <ul>
      <li><a href="#">Newsletter</a></li>
      <li><a href="#">Suggest a Scene</a></li>
      <li><a href="#">YouTube</a></li>
      <li><a href="#">Twitter</a></li>
      <li><a href="#">Contact</a></li>
      <li><a href="#">RSS</a></li>
      <li><a href="#">Letterboxd</a></li>
    </ul>
  </nav>
  <p class="site-explain__additional">
    <!-- ėĪëĩ -->
  </p>
</header>
styles.scss
@import "_header";
body {
  display: flex;
}
_variables.scss
/* í°íļ */
$font-size-h1: 70px;
$font-size-h2: 40px;
$font-size-medium: 25px;
$font-size-regular: 15px;
$font-size-small: 11px;
/* ėė */
$color-red: rgb(226, 14, 14);
$color-dark-grey: rgb(29, 29, 29);
$color-grey: rgb(99, 99, 99);
$color-light-grey: rgb(231, 231, 231);
_mixins.scss
@mixin siteExplain($size) {
  color: $color-red;
  font-size: $size;
  padding-bottom: 30px;
}
@mixin link($light-color, $dark-color) {
  a,
  a:visited {
    color: $light-color;
    font-weight: bold;
    &:hover,
    &:active {
      color: $dark-color;
    }
  }
}
_header.scss
@import "_mixins";
@import "_variables";
header {
  background-color: $color-light-grey;
  padding: 60px 40px;
  h1 {
    @include siteExplain($font-size-h1);
    padding-bottom: 60px;
  }
  .intro {
    .site-explain__main {
      @include siteExplain($font-size-medium);
    }
    .site-explain__details {
      @include siteExplain($font-size-regular);
    }
  }
  nav {
    padding-bottom: 30px;
    li {
      display: inline;
      font-size: $font-size-regular;
      text-decoration: underline;
      @include link($color-grey, $color-dark-grey);
    }
  }
  .site-explain__additional {
    font-size: $font-size-small;
  }
}
@extendė @mixin ėĪ ėīëĪ ęēė ėŽėĐíīėž í ė§ ęģ ëŊžíëĪ.
@mixinė ėëĄ ęīë Ļ ėë ė―ëė ėĪëģĩė ížíęļ° ėíī ėŽėĐëë ë°ëĐī,
@extendë ėëĄ ęīë Ļ ėë ė―ëëĪė í ęģģė ëŽķęļ° ėíī ėŽėĐëëĪ.