ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [ToyProject-Todomate] ํˆฌ๋‘๋ฉ”์ดํŠธ ํด๋ก  ํ”„๋กœ์ ํŠธ 34
    WEB Dev/ToyProject 2022. 2. 3. 20:47
    728x90


    ๐Ÿ”ท CloneTodo โ˜‘ - Todomate Clone Project  |  Team CloneMate

     

    CloneTodo : ๋งŽ์€ ์‚ฌ๋žŒ๋“ค์ด ์‚ฌ๋ž‘ํ•˜๋Š” ํˆฌ๋‘๋ฉ”์ดํŠธ๋ฅผ ํด๋ก ํ•˜์—ฌ ์›น ์„œ๋น„์Šค๋ฅผ ๋ฐฐํฌํ•ด๋ณด๋Š” ํ”„๋กœ์ ํŠธ

     


     

     

    ์•„๋ฌด๋ž˜๋„ ๋ธ”๋กœ๊ทธ๋ฅผ ์ž์„ธํ•˜๊ฒŒ ์“ฐ๋ฉด ์‹œ๊ฐ„์„ ๋งŽ์ด ๋นผ์•—๊ธฐ๋Š”๊ฑฐ ๊ฐ™์•„์„œ ํ•œ ์ผ ์œ„์ฃผ๋กœ ๊ฐ„๋‹จํ•˜๊ฒŒ ์ž‘์„ฑํ•ด๋ณด๋ ค๊ณ  ํ•œ๋‹ค.

     

     

    ์–ด์ œ ๋ฐค 

     

    - ๊ธ€์”จ์ฒด๋ฅผ ์ ์šฉํ–ˆ๋‹ค.

    - SCSS๋กœ ์ด์šฉํ•  ์ƒ‰์ƒ ๋ณ€์ˆ˜๋“ค๋„ ์ž‘์—…ํ–ˆ๋‹ค.

     

     

     

    1. ํฐํŠธ ์ ์šฉ

     

    stylesheet ํด๋”์— abstracts ํด๋”๋ฅผ ์ƒ์„ฑํ–ˆ๋‹ค.

    ๋‚ด๋ถ€์— ์ƒ‰์ƒ ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด_variable.scss ํŒŒ์ผ๊ณผ ๋ฏน์Šค์ธ์„ ์ง€์ •ํ•˜๋Š” _mixin.scss ํŒŒ์ผ์„ ์ƒ์„ฑํ–ˆ๋Š”๋ฐ ํ˜„์žฌ๊นŒ์ง€๋Š” ๋ณ€์ˆ˜๋งŒ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋‹ค. 

    ๊ทธ๋ฆฌ๊ณ  ๊ธ€๊ผด๋„ ๋ณ€์ˆ˜ํ™” ํ•˜๊ธฐ ์œ„ํ•ด ๋ณ„๋„๋กœ _font.scss ํŒŒ์ผ์„ ๋งŒ๋“ค์—ˆ๋‹ค.

     

     

     

    font-face๋ฅผ ์ ์šฉํ•ด์„œ ์ž๋™์œผ๋กœ ํ•œ, ์˜ ํฐํŠธ๊ฐ€ ์ ์šฉ๋˜๋„๋ก ํ•ด๋ณด๋ ค๊ณ  ํ–ˆ๋Š”๋ฐ ์ž˜ ์ ์šฉ์ด ์•ˆ๋˜์—ˆ๋‹ค.

     

    unicode-range | CSS-Tricks

    The unicode-range property in CSS is used by the @font-face to define the characters that are supported by the font face.

    css-tricks.com

     

    _font.scss ํŒŒ์ผ์„ ์ด์šฉํ•ด์„œ scssํŒŒ์ผ๋“ค์—๊ฒŒ ํฌํ•จํ•ด์ฃผ๋Š” ๋ฐฉ์‹์œผ๋กœ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š”๋ฐ ์ด๊ฒƒ๋„ css ๋ณ€ํ™˜ ์‹œ ๋งค๋ฒˆ ๋ถˆ๋Ÿฌ์˜ค๋Š” ๋ฐฉ์‹์ด๋ผ ๊ทธ๋ƒฅ index.html ์— <style></style> ํƒœ๊ทธ ๋งŒ๋“ค๊ณ  ๋‚ด๋ถ€์— ์„ ์–ธํ•ด์„œ ํ•œ๋ฒˆ์— ์“ธ ์ˆ˜ ์žˆ๋„๋ก ํ•˜๋Š” ๊ฒƒ์ด ๋” ๋‚˜์€ ๋ฐฉ์‹์ธ ๊ฒƒ ๊ฐ™์•„์„œ ๊ณ ๋ฏผ์ด๋‹ค.

     

     

    ์„ ํƒํ•œ ํฐํŠธ๋Š” 

     

    ํ•œ๊ธ€ : Pretendard

    ์˜๋ฌธ : Hahmelt

     

    ์ด๊ณ  ์ถ”ํ›„ ๋ณ€๊ฒฝ๋  ์ˆ˜ ์žˆ์–ด ๋‹ค์šด๋ฐ›์ง€ ์•Š๊ณ  ๋ˆˆ๋ˆ„๋ฅผ ์ด์šฉํ•ด์„œ font-face๋ฅผ ์„ ์–ธํ–ˆ๋‹ค. (ํ•œ ๋ฒˆ ๋‹ค์šด๋ฐ›์•˜๋‹ค๊ฐ€ ๋ˆˆ๋ˆ„์—์„œ url ๋”ฐ์˜ฌ ์ˆ˜ ์žˆ๋Š”๊ฑฐ ๋ณด๊ณ  ์ง€์šด๊ฑด ์•ˆ๋น„๋ฐ€)

     

    ์ž‘์—…ํ•˜๋‹ค๊ฐ€ ํฐํŠธ๋„ npm์œผ๋กœ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ๋‹ค๋Š”๊ฑธ ์•Œ์•˜๋‹ค. ์•„์ง css๋กœ ์–ด๋–ป๊ฒŒ ์„ ์–ธํ•˜๋Š”์ง€๋Š” ํ…Œ์ŠคํŠธ ํ•ด๋ณด์ง€ ๋ชปํ–ˆ๋‹ค.

     

     

    @font-face {
      font-family: 'Pretendard';
      src: url("https://cdn.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Thin.woff") format("woff");
      font-weight: 100;
      font-style: normal;
    }
    
    @font-face {
      font-family: 'Pretendard';
      src: url("https://cdn.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Light.woff") format("woff");
      font-weight: 300;
      font-style: normal;
    }
    
    @font-face {
      font-family: 'Pretendard';
      src: url("https://cdn.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Regular.woff") format("woff");
      font-weight: 400;
      font-style: normal;
    }
    
    @font-face {
      font-family: 'Pretendard';
      src: url("https://cdn.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Medium.woff") format("woff");
      font-weight: 500;
      font-style: normal;
    }
    
    @font-face {
      font-family: 'Pretendard';
      src: url("https://cdn.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-SemiBold.woff") format("woff");
      font-weight: 600;
      font-style: normal;
    }
    
    @font-face {
      font-family: 'Pretendard';
      src: url("https://cdn.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Bold.woff") format("woff");
      font-weight: 700;
      font-style: normal;
    }
    
    @font-face {
      font-family: 'Pretendard';
      src: url("https://cdn.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-ExtraBold.woff") format("woff");
      font-weight: 800;
      font-style: normal;
    }
    
    @font-face {
      font-family: 'Pretendard';
      src: url("https://cdn.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Black.woff") format("woff");
      font-weight: 900;
      font-style: normal;
    }
    
    @font-face {
      font-family: 'Hahmlet';
      src: local(โ€ป), url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2110@1.0/Hahmlet-ExtraBold.woff2") format("woff2");
      unicode-range: U+0041-005A, U+0061-007A;
      font-weight: 800;
    }

     

    ๊ทธ๋ž˜์„œ ์ง€๊ธˆ์€ ์•„๋ž˜์™€ ๊ฐ™์ด ์•ฝ~๊ฐ„ ํˆฌ๋‘๋ฉ”์ดํŠธ์™€ ๋น„์Šทํ•˜๊ฒŒ ์ž‘์—…์„ ํ•ด๋ณด๊ณ  ์žˆ๋‹ค.

    ์—ฌ๊ธฐ์„œ ํฌ์ธํŠธ๋Š” ์˜๋ฌธ ํฐํŠธ๊ฐ€ ์–ด๋–ค๊ฑด์ง€ ์•„์ง ๋ชป ์ฐพ์•˜๋‹ค๋Š” ์ .... ๐Ÿ˜“

     

     

     

     

     

    2. ์ƒ‰์ƒ ๋ณ€์ˆ˜ ์ ์šฉ

     

     

    ํฐํŠธ์ฒ˜๋Ÿผ ์ƒ‰์ƒ๋„ ํˆฌ๋‘๋ฉ”์ดํŠธ์™€ ์œ ์‚ฌํ•˜๊ฒŒ ํ•˜๊ธฐ ์œ„ํ•ด ๊ทธ๋ž˜ํ”ฝ ๋„๊ตฌ๋ฅผ ์ด์šฉํ•ด์„œ ํ—ฅ์‚ฌ์ฝ”๋“œ๋ฅผ ๋”ฐ์™”๋‹ค.

    ๊ทธ๋ฆฌ๊ณ  ํ•ด๋‹น ํ—ฅ์‚ฌ์ฝ”๋“œ๋“ค์„ _variables.scss ๋ณ€์ˆ˜ ์„ ์–ธ ์‹œํŠธ์— ๋ณ€์ˆ˜๋กœ ์„ ์–ธํ–ˆ๋‹ค.

     

    // ๋ณ€์ˆ˜ ์„ ์–ธ
    // ์ƒ‰์ƒ
    
    $bg-white: #ffffff; // ๋ฐฐ๊ฒฝ ํฐ์ƒ‰ (default)
    $main-navbar-gray: #fafafa; // main-navbar bg
    $goal-btn-gray: #f5f5f5; // main-feed ๋ชฉํ‘œ ๋ฒ„ํŠผ
    $goal-btn-border-gray: #f3f3f3; // main-feed ๋ชฉํ‘œ ๋ฒ„ํŠผ ํ…Œ๋‘๋ฆฌ
    
    $text-black: #1c1c1c; // ํ…์ŠคํŠธ
    $text-gray: #afafaf; // ํ…์ŠคํŠธ
    $icon-black: #000000; // ์•„์ด์ฝ˜

     

    ํ•ด๋‹น ์‹œํŠธ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” SCSS ํŒŒ์ผ๋“ค์—๊ฒŒ import ์‹œ์ผœ์„œ ๋ณ€์ˆ˜๋ฅผ ์“ฐ๋ฉด ๋œ๋‹ค.

     

    @import './abstracts/variables';

     

    ์œ„ ๋‘ ๊ฐ€์ง€๋ฅผ ์ ์šฉํ•œ App.scss ํŒŒ์ผ์€ ์ด๋ ‡๋‹ค.

     

    @import './abstracts/variables';
    @import './abstracts/font';
    
    .App {
      text-align: center;
      display: flex;
      flex-direction: column;
      flex-wrap: nowrap;
      justify-content: center;
      align-items: center;
      width: 90%;
      height: 100vh;
      margin: auto;
    
      .header{
        width: 90%;
        margin-bottom: 50px;
          .main_img{
            width: 400px;
          }
    
          h1{
            font-family: 'Hahmlet';
          }
      }
      
      .start_btn{
        width: 90%;
        
        button{
          width: 80%;
          font-weight: 400;
          font-size: 12px;
          background-color: $goal-btn-gray;
      
          &:nth-child(1){
            margin-bottom: 1em;
          }
          &:hover{
            box-shadow: none;
          }
        }
      }
    }

     

     

    ์˜ค๋Š˜์€ ๋ชฉํ‘œ๋ฅผ ํด๋ฆญํ•˜๋ฉด ์•„๋ž˜์— Input์ด ๋œจ๋„๋ก ํ•˜๋Š” .... ๊ทธ๋Ÿฐ ์ผ์„ ํ•ด์•ผ ํ•œ๋‹ค ๐Ÿ˜ฅ ํ™”์ดํŒ…~!

     

     

    728x90

    ๋Œ“๊ธ€

Designed by Tistory.