๋ฐ˜์‘ํ˜•

TL;DR


  • backdrop-filter : ์†์„ฑ์„ ์ ์šฉํ•œ ์š”์†Œ์˜ ๋ฐฐ๊ฒฝ์—๋งŒ ํšจ๊ณผ๊ฐ€ ์ ์šฉ๋จ. ์ฝ˜ํ…์ธ ๋Š” ์˜ํ–ฅ ์•ˆ๋ฐ›์Œ
    • Tailwind : backdrop-blur-sm
    • CSS : backdrop-filter: blur(4px);
  • filter : ์†์„ฑ์„ ์ ์šฉํ•œ ์š”์†Œ ์ „์ฒด(์ž์‹์š”์†Œ ํฌํ•จ)์— ํšจ๊ณผ๊ฐ€ ์ ์šฉ๋จ. ์ฃผ๋กœ ์ด๋ฏธ์ง€ ํƒœ๊ทธ์— ์‚ฌ์šฉํ•จ
    • Tailwind : blur-sm
    • CSS : filter: blur(4px);
    • ๐Ÿ’ก ์ฝ˜ํ…์ธ ๊ฐ€ ์—†๊ฑฐ๋‚˜ ๋ฐฐ๊ฒฝ์ƒ‰์ด ์ง€์ •๋˜์–ด ์žˆ์ง€ ์•Š์œผ๋ฉด ํšจ๊ณผ ์ ์šฉ ์•ˆ๋˜๋ฏ€๋กœ ์ฃผ์˜

 

Blur ๋ฐฐ๊ฒฝ ๊ตฌํ˜„


๋‘ ์†์„ฑ ๋ชจ๋‘ ์ ์šฉ๋˜๋Š” ํšจ๊ณผ๋Š” ๋™์ผํ•˜๋‚˜ filter ์†์„ฑ์€ ์ž์‹ ์š”์†Œ๋ฅผ ํฌํ•จํ•œ ์š”์†Œ ์ „์ฒด์— ์ ์šฉ๋˜๋ฏ€๋กœ Blur ํšจ๊ณผ๊ฐ€ ๋“ค์–ด๊ฐ„ ๋ฐฐ๊ฒฝ์„ ๊ตฌํ˜„ํ•˜๋ ค๋ฉด background ์ถ”๊ฐ€ ์š”์†Œ๋ฅผ ๋ณ„๋„๋กœ ๋งŒ๋“ค์–ด์•ผ ํ•œ๋‹ค — ์ฐธ๊ณ ๊ธ€

<div class="wrapper">
  <div class="background"></div>
  <!-- filter ๋ธ”๋Ÿฌ ํšจ๊ณผ๋ฅผ ์œ„ํ•œ ์ถ”๊ฐ€ ์š”์†Œ -->
  <div class="foreground"></div>
  <!-- ์ฝ˜ํ…์ธ  -->
</div>
.background {
  filter: blur(4px);
  position: absolute;
  width: 100%;
  height: 100%;
}

 

backdrop-filter๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ถ”๊ฐ€ ์š”์†Œ ์—†์ด ๋ธ”๋Ÿฌ ํšจ๊ณผ๊ฐ€ ๋“ค์–ด๊ฐ„ ๋ฐฐ๊ฒฝ์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค.

.foreground {
  backdrop-filter: blur(10px);
} /* No .wrapper needed! */

 

backdrop-filter ์˜ˆ์‹œ — ํด๋ฆญ์‹œ Codepen์œผ๋กœ ์ด๋™

 

 

๋ ˆํผ๋Ÿฐ์Šค


 

backdrop-filter | CSS-Tricks

The backdrop-filter property in CSS is used to apply filter effects (grayscale, contrast, blur, etc) to the background/backdrop of an element. The

css-tricks.com

 


๊ธ€ ์ˆ˜์ •์‚ฌํ•ญ์€ ๋…ธ์…˜ ํŽ˜์ด์ง€์— ๊ฐ€์žฅ ๋น ๋ฅด๊ฒŒ ๋ฐ˜์˜๋ฉ๋‹ˆ๋‹ค. ๋งํฌ๋ฅผ ์ฐธ๊ณ ํ•ด ์ฃผ์„ธ์š”
๋ฐ˜์‘ํ˜•