Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
191011 SVG를 배경이미지로 활용한 아이콘 - 오혜진
Search
zineeworld
October 11, 2019
Programming
43
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
191011 SVG를 배경이미지로 활용한 아이콘 - 오혜진
zineeworld
October 11, 2019
More Decks by zineeworld
See All by zineeworld
191218 ZINEERUN
zineeworld
0
29
190413 스타트업에서 마크업 개발자로 살아남기 - 오혜진
zineeworld
0
87
Other Decks in Programming
See All in Programming
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
480
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
440
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
430
OSINT for SRE: 学術論文とポストモーテムから探る システム障害の共通パターン / SRE NEXT 2026
tomoyk
1
3k
ローカルLLMでどこまでコードが書けるか -縮小版 / How much code can be written on a local LLM Shortened
kishida
2
180
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
180
AI時代の仕事技芸論〜ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ(スクフェス仙台 2026バージョン)
kuranuki
0
520
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
1
350
Claude Opus 4.6以後の受託開発エンジニアの変化(Claude Code開発ノウハウ大公開スペシャルbyクラスメソッド)
iidatakuma
1
400
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
160
フィードバックで育てるAI開発
kotaminato
1
110
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
150
Featured
See All Featured
Tell your own story through comics
letsgokoyo
1
990
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
150
Measuring & Analyzing Core Web Vitals
bluesmoon
9
880
Designing for Performance
lara
611
70k
Being A Developer After 40
akosma
91
590k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Google's AI Overviews - The New Search
badams
0
1.1k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
370
Design in an AI World
tapps
1
260
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
340
Mind Mapping
helmedeiros
PRO
1
280
Making the Leap to Tech Lead
cromwellryan
135
10k
Transcript
@zineeworld SVGܳ ߓ҃۽ ഝਊೠ ই ӝ ੋਗ য়ഌ
@zineeworld য়ט ঠӝ ೞҊ र Ѫ 1. ই ಪী ೠ
ࣗѐ 2. CSS۽ Ӓܽ рױೠ ই 3. background-image: url(‘SVG ٘’)
@zineeworld ই ಪۆ?
@zineeworld औѱ ࢤпೞݶ Bootstrap Glyphicon, Font Awesome ଵҊ : https://webdir.tistory.com/476
@zineeworld Bootstrap Glyphicons Font Awesome
@zineeworld ই ಪ 1. ېझݺਵ۽ औѱ ইਸ ࠛ۞ৢ ࣻ
. 2. ߭ఠ Ӓېਸ ਊೞӝ ٸޙী ࢎૉ ߸҃ ਊೞ. 3. ੌ߈ ఫझী ਊೡ ࣻ ח CSSܳ ࢎਊೡ ࣻ .
@zineeworld ੋਗ ইಪ ઁ https://icomoon.io/ SVG ੌ۽ ୶ػ ইٜਸ icomoon
ࢎܳ ా೧ ইಪ۽ ઁפ. ੋਗীࢲח ٣ցשԋࢲ ೧ সਸ ೧Ҋ ҅भפ.
@zineeworld ѐಞ সਵ۽ ೡ߉ ಕ ࢜ ٣ੋ
@zineeworld
@zineeworld ಕ ղী ߈ࠂਵ۽ ݂ োѾغח ࠗ࠙ী > ই ࢎਊ
ӝઓ ইಪܳ ࢎਊ೧৳؍ ߑध Ӓ۽ <span class=“glyph-ui-chevron-right”></span>ਸ যળ. ਊߑߨ ߈ࠂਵ۽ য ঋҊ ખ ؊ ױࣽೞҊ औѱ ࢎਊೡ ࣻח হਸө?
@zineeworld ইಪח ѐ݃ Ҋਬ ਬפ٘ чਸ оҊ Ӕ1) ইಪ
ਬפ٘ чਸ ڙэ য
@zineeworld ইಪח ѐ݃ Ҋਬ ਬפ٘ чਸ оҊ Ӕ1) ইಪ
ਬפ٘ чਸ ڙэ য
@zineeworld ইಪח ѐ݃ Ҋਬ ਬפ٘ чਸ оҊ (ޙઁ) ਬפ٘
чਸ ݒߣ ࠁ ೡ ࣻ হ Ӕ1) ইಪ ਬפ٘ чਸ ڙэ য
@zineeworld Ӕ2) CSS۽ Ӓ۰ࠅө? border-right: 1px solid currentColor; border-bottom: 1px
solid currentColor; transform: rotate(-45deg); https://codepen.io/zineeworld/pen/ZPxpgp
@zineeworld Ӕ2) CSS۽ Ӓ۰ࠅө? https://codepen.io/zineeworld/pen/PLLydw (ޙઁ) Ѿҗޛ ٣పੌ ର 1px
1.5px 2px
@zineeworld Ӕ3) SVG ٘ܳ ഝਊ ೧ࠅө? 1. <img src=“icon.svg”>
ੌ۽ ࢎਊೠ. 1. ߭ఠ ৈࢲ ӝীח ઁড হਵա ࢚࢝ਸ ߸҃ೞ۰ݶ ܲ ੌ ਃೞ. 2. HTML ٘ উী <svg ~~~~></svg> ܳ ֍ח. 1. 1ߣ ߑߨࠁח ೞա ٘۽ ࢚࢝ чਸ ߸҃ೞӝח ਊೞ. (fill=“colorч”) 2. <span class=“glyph-ui-chevron-right”></span> ࠁ ഻-ঁ ؊ ӟ ٘ܳ ݒߣ ֍যঠ ೠ. 3. svg ٘ী ߸҃ ࢤӝݶ ࢎਊೞҊ ח ݽٚ Ҕਸ ই ߄Լঠ ೠ. 4. ই ࢚࢝ਸ ஶ܀ ೞח Ѥ झఋੌ ੌ۽ ాੌغযঠ ೞחؘ, ߑधਸ ॳݶ html ٘ ࢚ ࣻ ਃೞ. 3. CSS۽ ߓ҃ ࣘࢿী svg ٘ܳ ֍ח. 1. background-image: url(data:image/svg+xml, svg٘); 2. ࢚࢝ ҙܻܳ झఋੌ ੌ ೠ Ҕীࢲ ઁযо оמೞ. SVG ইਸ ࢎਊೞח ߑߨ
@zineeworld Ӕ3) SVG ٘ܳ ഝਊ ೧ࠅө? 1.SVG ٘ܳ background-image ী
֍ӝ 1. IE ਸ ਤ೧ SVG ٘ܳ Data URI ۽ ߸ജೞӝ 2. ߸ജೠ Data URI чਸ ߓ҃ী ֍ӝ 2.Sassܳ ా೧ ࢚࢝ ߸ജ ਊೠ function ٜ݅ӝ 1. Data URI ীח hex чਸ ֍ਸ ࣻ হ? 2. rgba ঌчী 0.999ܳ 3.SVG ٘ܳ ߓ҃۽ ഝਊೠ ই ৮ࢿ!
@zineeworld <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60"> <polygon fill="black" points="20.62
55.62 45.74 30.5 20.62 5.38 16.38 9.62 37.26 30.5 16.38 51.38 20.62 55.62"> </svg> SVG ٘ܳ ಝࠅөਃ? ױࣽೠ ಫܻҌਵ۽ ܖযઉ णפ. Ӕ3) SVG ٘ܳ ഝਊ ೧ࠅө?
@zineeworld .icon display: inline-block width: 1em height: 1em background: url("data:image/svg+xml,<svg
xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'><polygon fill='rgba(23, 114, 248, 0.999)' points='20.62 55.62 45.74 30.5 20.62 5.38 16.38 9.62 37.26 30.5 16.38 51.38 20.62 55.62'/></svg>") no-repeat Sass) background-image: url() ী SVG ٘ܳ ֍যࠇद. ۧѱ ೧ب ࠗ࠙ ࠳ۄীࢲח زೞ݅ IE ীࢲח ڰ ঋणפ. Ӕ3) SVG ٘ܳ ഝਊ ೧ࠅө?
@zineeworld Ӕ3) SVG ٘ܳ ഝਊ ೧ࠅө? https://zineeworld.github.io/demo/svg_fonticon_test.html Windows (ઝஏ ࢚ױࠗఠ
द҅ߑೱਵ۽ ܁ >> যझ >> Edge >> IE11) MacOS (ઝஏࠗఠ ܁ >> ࢎܻ >> যझ) IEীࢲח Data URI۽ ߸ജ೧ࢲ ֍ ٘݅ ࢚ ֢ؽ > : Data URI > : SVG
@zineeworld SVG → Data URI ߸ജ ߑߨ Ӕ3) SVG ٘ܳ
ഝਊ ೧ࠅө? https://runkit.com/zineeworld/convert-svg-to-data-uri
@zineeworld Ӕ3) SVG ٘ܳ ഝਊ ೧ࠅө? .icon display: inline-block width:
1em height: 1em background: url(“data:image/ svg+xml,data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpolygon fill='black' points='20.62 55.62 45.74 30.5 20.62 5.38 16.38 9.62 37.26 30.5 16.38 51.38 20.62 55.62'/%3E%3C/svg%3E ") no-repeat Sass) background-image: url() ী ߸ജೠ Data URI ٘ܳ ֍যࠇद.
@zineeworld Ӕ3) SVG ٘ܳ ഝਊ ೧ࠅө? @function svgIcon($color) $icon: "data:image/svg+xml,%3Csvg
xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpolygon fill='#{$color}' points='20.62 55.62 45.74 30.5 20.62 5.38 16.38 9.62 37.26 30.5 16.38 51.38 20.62 55.62'/ %3E%3C/svg%3E" @return url($icon) .icon display: inline-block width: 1em height: 1em background: svgIcon(#1772f8) no-repeat Sassܳ ా೧ ࢚࢝ ߸ജ ਊೠ function ٜ݅ӝ
@zineeworld Ӕ3) SVG ٘ܳ ഝਊ ೧ࠅө? @function svgIcon($color) $icon: "data:image/svg+xml,%3Csvg
xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpolygon fill='#{$color}' points='20.62 55.62 45.74 30.5 20.62 5.38 16.38 9.62 37.26 30.5 16.38 51.38 20.62 55.62'/ %3E%3C/svg%3E" @return url($icon) .icon display: inline-block width: 1em height: 1em background: svgIcon(#1772f8) no-repeat Sassܳ ా೧ ࢚࢝ ߸ജ ਊೠ function ٜ݅ӝ (ޙઁ) fill чীח hex ٘ܳ ֍ਸ ࣻ হ!!
@zineeworld Ӕ3) SVG ٘ܳ ഝਊ ೧ࠅө? @function svgIcon($color) $color: rgba($color,
1.0) $icon: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpolygon fill='#{$color}' points='20.62 55.62 45.74 30.5 20.62 5.38 16.38 9.62 37.26 30.5 16.38 51.38 20.62 55.62'/ %3E%3C/svg%3E" @return url($icon) .icon display: inline-block width: 1em height: 1em background: svgIcon(#1772f8) no-repeat Sassܳ ా೧ ࢚࢝ ߸ജ ਊೠ function ٜ݅ӝ <<< ۧѱ ೞݶ ؼ ঌওਵա ژ উ ؽ…
@zineeworld Ӕ3) SVG ٘ܳ ഝਊ ೧ࠅө? @function svgIcon($color) $color: rgba($color,
1.0) $icon: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpolygon fill='#{$color}' points='20.62 55.62 45.74 30.5 20.62 5.38 16.38 9.62 37.26 30.5 16.38 51.38 20.62 55.62'/ %3E%3C/svg%3E" @return url($icon) .icon display: inline-block width: 1em height: 1em background: svgIcon(#1772f8) no-repeat Sassܳ ా೧ ࢚࢝ ߸ജ ਊೠ function ٜ݅ӝ (ޙઁ) rgba(#ffffff, 1.0) = #ffffff rgba(#ffffff, 1.0) != rgba(255,255,255,1.0)
@zineeworld Ӕ3) SVG ٘ܳ ഝਊ ೧ࠅө? Ӓۧݶ ঌчী 0.999ܳ ݶ
যڄө? ੌױ ٣झۨ غח Ѿҗч য়ରо হਸ ഛੋ!
@zineeworld Ӕ3) SVG ٘ܳ ഝਊ ೧ࠅө? @function svgIcon($color) $color: rgba($color,
0.999) $icon: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpolygon fill='#{$color}' points='20.62 55.62 45.74 30.5 20.62 5.38 16.38 9.62 37.26 30.5 16.38 51.38 20.62 55.62'/ %3E%3C/svg%3E" @return url($icon) .icon display: inline-block width: 1em height: 1em background: svgIcon(#1772f8) no-repeat Sassܳ ా೧ ࢚࢝ ߸ജ ਊೠ function ٜ݅ӝ ٘٣য ৮ࢿ!
@zineeworld Ӕ3) SVG ٘ܳ ഝਊ ೧ࠅө? @function svgIcon($color) $color: rgba($color,
0.999) $icon: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpolygon fill='#{$color}' points='20.62 55.62 45.74 30.5 20.62 5.38 16.38 9.62 37.26 30.5 16.38 51.38 20.62 55.62'/ %3E%3C/svg%3E" @return url($icon) .icon display: inline-block width: 1em height: 1em background: svgIcon(#1772f8) no-repeat &:hover background: svgIcon(#000000) no-repeat Sassܳ ా೧ ࢚࢝ ߸ജ ਊೠ function ٜ݅ӝ hoverद ߸҃࢝ ۧѱ // SVG ٘о background-image чਵ۽ ٜযр ҃ currentColor ࢎਊࠛо // fill='currentColor' ۄҊ ա زೞ ঋ, ױࣽ ޙৌ غযߡܿ
@zineeworld https://codepen.io/zineeworld/pen/XGYNZp
@zineeworld • https://medium.com/coinone-official/svg%EB%A5%BC- %EB%B0%B0%EA%B2%BD%EC%9D%B4%EB%AF%B8%EC%A7%80 %EB%A1%9C-%ED%99%9C%EC%9A%A9%ED%95%9C- %EC%95%84%EC%9D%B4%EC%BD%98- %EC%82%AC%EC%9A%A9%EA%B8%B0-d46e681b492f • https://codepen.io/noahblon/post/coloring-svgs-in-css-background-images •
https://codepen.io/noahblon/pen/xGbXdV?editors=1100 • https://codepen.io/tigt/post/optimizing-svgs-in-data-uris ଵҊܐ
@zineeworld