Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
191011 SVG를 배경이미지로 활용한 아이콘 - 오혜진
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
zineeworld
October 11, 2019
Programming
46
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
31
190413 스타트업에서 마크업 개발자로 살아남기 - 오혜진
zineeworld
0
90
Other Decks in Programming
See All in Programming
Building an Out-of-Order CPU
latte72
1
750
DroidKaigi 2026 「個人開発という実験場: Android エンジニアが手にする4つの自由」
slashnephy
0
230
AIエージェント時代のコードレビューを設計する
nogu66
6
2.6k
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
470
信頼性の目標を誰も求めてない
shubox
0
500
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
130
RSSとCodexを使ってX投稿自動化してみた
ochtum
0
110
巨大モノリシックアプリ モダン化大作戦
ktcryomm
0
580
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
2.3k
PHPプロジェクトの結合バランスを可視化する #php_night
kajitack
0
230
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
130
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.4k
Featured
See All Featured
A Soul's Torment
seathinner
7
3.6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Visualization
eitanlees
152
17k
The Cost Of JavaScript in 2023
addyosmani
55
10k
30 Presentation Tips
portentint
PRO
1
390
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
RailsConf 2023
tenderlove
30
1.5k
Unsuck your backbone
ammeep
672
58k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
240
The Pragmatic Product Professional
lauravandoore
37
7.4k
A Tale of Four Properties
chriscoyier
163
24k
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