Dva: CSS ๋ชจ๋“ˆ ์ปดํŒŒ์ผ ๋ฌธ์ œ

์— ๋งŒ๋“  2016๋…„ 11์›” 29์ผ  ยท  2์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: dvajs/dva

ํ‚ค ํ”„๋ ˆ์ž„์„ ์‚ฌ์šฉํ•  ๋•Œ css-modules์—์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ฌธ์ œ๊ฐ€ ๋ฐœ๊ฒฌ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

์›๋ž˜ CSS ์ฝ”๋“œ :

<strong i="7">@keyframes</strong> rotating {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(360deg);
  }
}
.rotating-item {
  animation: 5s linear 0 infinite rotating;
}

๋‹ค์Œ ์ฝ”๋“œ๋กœ ์ปดํŒŒ์ผ๋ฉ๋‹ˆ๋‹ค.

@-webkit-keyframes rotating___3vsQl {
  0% {
    -webkit-transform: rotate(0);
            transform: rotate(0);
  }
  100% {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}
<strong i="11">@keyframes</strong> rotating___3vsQl {
  0% {
    -webkit-transform: rotate(0);
            transform: rotate(0);
  }
  100% {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}
.rotating-item___3pALh {
  -webkit-animation: 5s linear 0 infinite :local(rotating);
          animation: 5s linear 0 infinite :local(rotating);
}

์˜ฌ๋ฐ”๋ฅธ ๊ฒƒ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์•„์•ผํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

@-webkit-keyframes rotating___3vsQl {
  0% {
    -webkit-transform: rotate(0);
            transform: rotate(0);
  }
  100% {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}
<strong i="15">@keyframes</strong> rotating___3vsQl {
  0% {
    -webkit-transform: rotate(0);
            transform: rotate(0);
  }
  100% {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}
.rotating-item___3pALh {
  -webkit-animation: 5s linear 0 infinite rotating___3vsQl;
          animation: 5s linear 0 infinite rotating___3vsQl;
}

css-modules ๋ฒ„๊ทธ์ธ์ง€ ์•„๋‹ˆ๋ฉด webpack์˜ ๊ตฌ์„ฑ ๋ฌธ์ œ์ธ์ง€ ๋ชจ๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค.

๋…ธํŠธ :

  • dva-cli๋กœ ์ƒ์„ฑ ๋œ ํ”„๋กœ์ ํŠธ๋Š” ์›นํŒฉ ๊ตฌ์„ฑ์„ ์ˆ˜์ •ํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.
  • ์ฒ˜์Œ์—๋Š” ๋œ ์ผ๋Š”๋ฐ css๋กœ ๋ฐ”๊พธ๋ฉด ์•ˆ๋˜๋„ค์š”.
  • ๊ธ€์ด ์ ์„ ๊ฒฝ์šฐ <strong i="25">@keyframes</strong> :global(rotating) ๊ฐ€ ์˜ค๋ฅ˜๋ฅผ๋ณด๊ณ  ํ•จ์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.

    ๋„๊ตฌ ๋ฒ„์ „์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • [email protected]

  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]
question

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค ๐Ÿ™!

์˜ˆ, ๊ดœ์ฐฎ์Šต๋‹ˆ๋‹ค.ํ•˜์ง€๋งŒ ๋ฌธ์ œ๋Š”

animation: name .6s ease; // ่ฟ™ๆ ทๆ˜ฏๅฏไปฅ็š„
animation: .6s ease name; // ่€Œ่ฟ™ๆ ทๅฐฑไธไผš่ขซ่ฏ†ๅˆซๅˆฐไบ†

mozilla์˜ ๋ฌธ์„œ์— ์›€ํ‘น ํŒจ์˜€์Šต๋‹ˆ๋‹ค ๐Ÿ˜‚

<single-animation> = <time> || <single-timing-function> || 
<time> || <single-animation-iteration-count> || <single-
animation-direction> || <single-animation-fill-mode> || 
<single-animation-play-state> || [ none | <keyframes-name> ]


/* <strong i="11">@keyframes</strong> duration | timing-function | delay | 
  iteration-count | direction | fill-mode | play-state | name */
 animation: 3s ease-in 1s 2 reverse both paused slidein;

/* <strong i="12">@keyframes</strong> duration | timing-function | delay | name */
 animation: 3s linear 1s slidein;

/* <strong i="13">@keyframes</strong> duration | name */
 animation: 3s slidein;

๋ชจ๋“  2 ๋Œ“๊ธ€

https://github.com/css-modules/css-modules/issues/141#issuecomment -243011699
์ด๊ฒƒ์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ?

๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค ๐Ÿ™!

์˜ˆ, ๊ดœ์ฐฎ์Šต๋‹ˆ๋‹ค.ํ•˜์ง€๋งŒ ๋ฌธ์ œ๋Š”

animation: name .6s ease; // ่ฟ™ๆ ทๆ˜ฏๅฏไปฅ็š„
animation: .6s ease name; // ่€Œ่ฟ™ๆ ทๅฐฑไธไผš่ขซ่ฏ†ๅˆซๅˆฐไบ†

mozilla์˜ ๋ฌธ์„œ์— ์›€ํ‘น ํŒจ์˜€์Šต๋‹ˆ๋‹ค ๐Ÿ˜‚

<single-animation> = <time> || <single-timing-function> || 
<time> || <single-animation-iteration-count> || <single-
animation-direction> || <single-animation-fill-mode> || 
<single-animation-play-state> || [ none | <keyframes-name> ]


/* <strong i="11">@keyframes</strong> duration | timing-function | delay | 
  iteration-count | direction | fill-mode | play-state | name */
 animation: 3s ease-in 1s 2 reverse both paused slidein;

/* <strong i="12">@keyframes</strong> duration | timing-function | delay | name */
 animation: 3s linear 1s slidein;

/* <strong i="13">@keyframes</strong> duration | name */
 animation: 3s slidein;
์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰