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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
34
190413 스타트업에서 마크업 개발자로 살아남기 - 오혜진
zineeworld
0
91
Other Decks in Programming
See All in Programming
AWSに止められる覚悟してますか?
morizo_1984
2
530
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
150
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
480
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
110
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
240
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
460
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
580
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
380
Domain-Driven Transformation
hschwentner
2
2.3k
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.1k
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
320
ラッコキーワード サービス紹介資料
rakko
1
5.3M
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
550
Agile that works and the tools we love
rasmusluckow
331
22k
Optimising Largest Contentful Paint
csswizardry
37
4k
Docker and Python
trallard
47
4.2k
How GitHub (no longer) Works
holman
316
150k
Bash Introduction
62gerente
615
220k
Mobile First: as difficult as doing things right
swwweet
225
10k
GitHub's CSS Performance
jonrohan
1033
470k
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