sass-lang.com

http://sass-lang.com/

Sass(CSS Preprocessor) ๊ธฐ์ดˆ

http://wit.nts-corp.com/2015/01/09/2936

์†Œ์ˆซ์  ์ฒ˜๋ฆฌํ•จ์ˆ˜

https://gist.github.com/terkel/4373420

focus mixin

ํ‚ค๋ณด๋“œ ํƒญํ‚ค๋กœ ํฌ์ปค์Šค๋ฅผ ํ‘œํ˜„ํ•˜์ง€๋งŒ ๋งˆ์šฐ์Šค๋กœ๋Š” ํ‘œ์‹œ ์•ˆ๋˜๊ฒŒ ์กฐ์ •ํ•œ๋‹ค.

@mixin focus() {
  &:focus {
    @content;
    &:not(:focus-visible) {
      outline: none;
    }
  }
}

a {
  @include focus() {
    outline: 1px dashed lime;
    outline-offset: 4px;
  }
}

aspect-ratio mixin

์†์„ฑ์ด ์ƒ๋‹นํžˆ ์ตœ์‹  ์ŠคํŽ™์ด๋ผ์„œ(์ž‘์„ฑํ•  ๋‹น์‹œ์—๋Š”..) ์„œํฌํŠธ ๋ฏธ๋””์–ด์ฟผ๋ฆฌ๋ฅผ ๋„ฃ์–ด์ฃผ๋Š”๊ฒƒ์ด ์ข‹๊ฒ ๋‹ค๊ณ  ๋ณด์—ฌ์„œ ๋ฏน์Šค์ธ์œผ๋กœ ๋งŒ๋“œ๋Š”๋ฐ ์‚ฌ์šฉํ•˜๊ธฐ๊ฐ€ ์ƒ๋‹นํžˆ ๊นŒ๋‹ค๋กญ๋‹ค.
/ ๋ฌธ์ž๊ฐ€ ๋‚˜๋ˆ„๊ธฐ๋กœ ํ‘œํ˜„๋˜์–ด์„œ ์‰ฝ๊ฒŒ ์ฒ˜๋ฆฌ๋ฅผ ๋ชปํ•˜๋Š” ํŽธ์ด๋‹ค.

// aspect ratio
@mixin ratio($w, $h)
{
  @supports (aspect-ratio: 1 / 1) {
    aspect-ratio: #{$w} / #{$h};
  }
}

img {
  width: 480px;
  @include ratio(16, 9);
}

๋ฉ”ํƒ€๋ฐ์ดํ„ฐ

์กฐํšŒ์ˆ˜
983
์ข‹์•„์š”
0

0๊ฐœ์˜ ๋Œ“๊ธ€

๋“ฑ๋ก๋œ ๋Œ“๊ธ€์ด ์—†์Šต๋‹ˆ๋‹ค.