Тёмный

Web Icons with No External Libraries! (🙅 No More Font Awesome) 

Eric Murphy
Подписаться 76 тыс.
Просмотров 73 тыс.
50% 1

Don't you hate when you're using Font Awesome, and it loads 500KB of JavaScript just to render 3 ICONS? You don't have to rely on big fat external libraries to do it for you! You can do it all by yourself, just grab the SVG and you're good to go! Watch the video to learn more (what big external libraries DON'T want you to know...)
The site I was using for the icons:
iconify.design/
🌐 ericmurphy.xyz/
Affiliate links to services I use:
www.vultr.com/?ref=8530325-6G Get a VPS to host your website or server.

Наука

Опубликовано:

 

29 июн 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 127   
@ChumX100
@ChumX100 3 года назад
You're missing the whole point of Iconify. Their library is just about 13kb and it replaces the icon tags with svgs automatically, by loading them dynamically from an API. It also caches the loaded icons locally so that they are only loaded once and new requests and pages that use the same icons won't incurr any further overhead.
@madtho
@madtho 3 года назад
Awesome, thank you. Had to tweak some styles to work with the svg, but looks and works great.
@PLuffy-ke7ho
@PLuffy-ke7ho Год назад
This was awesome! I tried to use Font Awesome but couldn't get the kit to load properly with my site. This is a nice alternative and taught me more about a different attribute. Many thanks!
@schlepers
@schlepers 3 года назад
Thanks alot man. I was able to increase my Google lighthouse performance a bit by swapping out of the AwesomeFont kit code vs SVG. Much appreciation!!
@EricMurphyxyz
@EricMurphyxyz 3 года назад
Love to hear it!
@williammcdermed7287
@williammcdermed7287 Год назад
Thank you for your response. I failed to mention how helpful your video was because it gave me the info to just tackle the whole use of svg's in a very direct way. You are right the only thing that was helpful from FA was the svg. So thanks again!
@coodie
@coodie Год назад
Great video explanation. Loved that you showed the amount of resources before and after. Thanks for the video!
@jeslela
@jeslela Год назад
Thanks for this simple and straight to the point video! 👏🏽
@MuhammadAkbar-sy7zm
@MuhammadAkbar-sy7zm Год назад
Thank you. I have been looking for this solution, avoiding those unnecessary external libraries
@AnthonyJackman
@AnthonyJackman 8 месяцев назад
Awesome video! Something so simple. I am running into the same thing you did with FA. I am only using 2 icons out of FA. The difference in my project is that I am doing a build using SASS. Your way may seem a little management work on the developer, but that effort pays dividends with site users. Thank you for making this!
@jeffbarnhart6441
@jeffbarnhart6441 Год назад
love how you go into dev tools. perfect video.
@codebasic8558
@codebasic8558 2 года назад
This is wonderful! Thank you very much, good sir!
@gaetandesignz4599
@gaetandesignz4599 3 года назад
Great video !!! It makes your website load faster, but it takes a bunch of lines that a boring thing sometimes exp if you have consecutively five.
@DoompyGames
@DoompyGames Год назад
That's the most useful tip I have heard in a while, thank you sir. I found literally zero sources on how to get rid of the bloat introduced by font-awesome. In a plain nextjs application, with the different setup strategies for font-awesome or fort-awesome, the minimum you can achieve is an additional 20kb loaded for all of your pages. That refers to around 10% of additional chunk size per page.
@EricMurphyxyz
@EricMurphyxyz Год назад
Love to hear it! Glad it helped
@GulfJobSeeker_Vacancies
@GulfJobSeeker_Vacancies 2 года назад
Thanks a lot for giving this simple but logical solution.
@digitalminister5687
@digitalminister5687 3 года назад
You save cellular data as well this way! Thank you for the video!
@christianworld2
@christianworld2 4 месяца назад
Thanks man. This video is really helpful. Have really tried others but didn't work until i met this video
@acke5180
@acke5180 3 года назад
Great job! You just gave me a homeWork.. :) Subscribed. Keep up the good work!
@9squares
@9squares Год назад
Just what I was looking for, Thank you
@atmanvisual190
@atmanvisual190 2 года назад
Lovely video, man. Thanks a lot.
@ArsenTech
@ArsenTech 3 года назад
Iconify Fixed My Website Icons, Thanks So Much
@mouctechy
@mouctechy Год назад
thank you my dude was looking an alternative to optimize my portfolio 👏👏
@torg27
@torg27 Год назад
this is really brilliant!! thank you!!
@dominikchynoradsky4228
@dominikchynoradsky4228 3 года назад
Good thinking sir, thank you.
@limehouseblues
@limehouseblues 3 года назад
thank-you, this was very helpful
@skilllearn904
@skilllearn904 3 года назад
thanks broyher thats help me alot ,good work
@olga_lc
@olga_lc 2 года назад
Thanks a lot, that was helpful!
@nyuentreprise3402
@nyuentreprise3402 2 года назад
Thank you very much buddy !🙌
@deadlock7946
@deadlock7946 Год назад
Just wow. Thank you so much!!!
@mohamed-tm8kr
@mohamed-tm8kr Год назад
thank you bro, you saved my life i love you
@rakeshmanathana
@rakeshmanathana 3 года назад
Very helpful. Thank you.
@sonoftroy8572
@sonoftroy8572 Год назад
Very informative, I didn’t think to monitor the amount of data being loaded using font awesome. I’v learned something today. Thanks
@tameemsani7387
@tameemsani7387 2 года назад
it was really help full ....thank you
@samuelthomas5494
@samuelthomas5494 3 года назад
Thank you for sharing this video :-)
@moaaz_hassan
@moaaz_hassan Год назад
Thanks but what about size of code i tried to put the svg icons on my website on blogger i noticed that code size increased from 40kb to 50kb how to fix it.
@wolfenrico
@wolfenrico Год назад
Awesome. Thanks!
@PhilipProchazka
@PhilipProchazka 3 года назад
yeah that is what i knew also before, i wanted to actually create my own font library, I do also fight here to get more than font awesome into my new angular template, so i guess it will be easier to stay into my known practics i understand and that buch will go propably down. you can also store those svgs into a folder and call them by name i guess after setting to include & require that folder and than callin those svg elements
@EricMurphyxyz
@EricMurphyxyz 3 года назад
Yeah that's another more efficient method if you don't mind doing that yourself 👍
@HeitorYT
@HeitorYT Год назад
I use preact for my projects and using local svg is the best thing. It doesn't show any errors.
@madihamuhammad4633
@madihamuhammad4633 3 года назад
Thanks man.u saved my time .
@gopalloharnew5948
@gopalloharnew5948 2 года назад
How to use svg's in css without smashing it into html ? like keeping it in another file .. but the fill becomes a problem !
@nikachkhobadze7710
@nikachkhobadze7710 3 года назад
Really useful. Thanks
@wolfenrico
@wolfenrico 3 года назад
Thats great! Thanks!
@williammcdermed7287
@williammcdermed7287 Год назад
Thanks man. I got the same result without "identify", just grab the SVG code from FA and parse as you did.
@EricMurphyxyz
@EricMurphyxyz Год назад
Yes you don't need iconify, they just make it a little easier than going through the Dev tools
@Gyannea
@Gyannea 10 месяцев назад
This is where I want to go, but I could not get the font size to work. I had to delete the width and height and do width and height in css instead. Is that because my svg icon width and height units are px?
@TheNomanAhmed
@TheNomanAhmed 4 года назад
Thanks Eric this is great video. I had been using FA in many of my projects and this is a great way to optimize the size. But i am just wondering how would you approach the problem if we have to use FA in the pseudo elements in css. Would there be a better way to do it ?
@EricMurphyxyz
@EricMurphyxyz 4 года назад
Thanks! Yes, copy the SVG code and convert it to a data URL using a site like this: yoksel.github.io/url-encoder/ Now you can use it like a background-image in CSS. You have to manually style the pseudo-element it to make it look right so not be as convenient as FA, but still works well.
@TheNomanAhmed
@TheNomanAhmed 4 года назад
@@EricMurphyxyz Thanks for the reply. I will try this approach. 👍🏽
@gopalloharnew5948
@gopalloharnew5948 2 года назад
That's what I wanted !
@hamzakhiar3636
@hamzakhiar3636 Год назад
I'm kind of thinking on making a community plug-in on for instance figma where designers design icons and stuff and getting them with JavaScript as svg's or png's and replace font awesome
@bettercalldelta
@bettercalldelta 11 месяцев назад
You could probably still use the fontawesome tags but make a server-side script to "compile" it into what will actually be served to the client.
@ishaanagarwal
@ishaanagarwal 3 года назад
Thank you so much!!! ❤️
@bartickmaiti3049
@bartickmaiti3049 3 года назад
Thanks man.
@helloanshu4080
@helloanshu4080 Год назад
thanks mate!
@septimusforster
@septimusforster 8 месяцев назад
Is there a workaround to subscribe multiple times on a RU-vid channel? This one definitely deserves it.
@musicallife3062
@musicallife3062 3 года назад
Thanks bro I was not able to use font awesome Thanks for this vedio
@greggregory9029
@greggregory9029 2 года назад
you helped me! thanks
@nelsonazolukwamprojects
@nelsonazolukwamprojects 3 года назад
I thought the browser downloads the files once, or is downloaded on every request?
@alexdem98
@alexdem98 2 года назад
Very nice!
@TarunChkravarthi
@TarunChkravarthi 3 года назад
That really looks cool! Any suggestions to avoid too much svg code which could get hard to identify the specific icons when we are working on big projects or massive codebase? Just like creating our own icon-fonts using any svg code we choose for? Keep going!
@EricMurphyxyz
@EricMurphyxyz 3 года назад
Thanks! You can move all the SVG code to a separate file and replace it with inside the SVG tag.
@muhammadhaiqal531
@muhammadhaiqal531 Год назад
@@EricMurphyxyz how can I do that?
@EricMurphyxyz
@EricMurphyxyz Год назад
@@muhammadhaiqal531 I explained it pretty clearly? Copy the SVG code to a separate file, name it something like your-icon.svg and then reference it with the tag I showed above
@muhammadhaiqal531
@muhammadhaiqal531 Год назад
@@EricMurphyxyz yes I did exactly that, but somehow it doesn't work, but I figured a workaround so yeah
@caesarliftz
@caesarliftz Год назад
@@muhammadhaiqal531 i tried too, but it didn't work
@MicRodrgz
@MicRodrgz 10 месяцев назад
thanks for the idea! subscribe done 👍
@frank-lx2yn
@frank-lx2yn 7 месяцев назад
thank you very much! 🙏🙏🙏🙏
@aneeshrc6848
@aneeshrc6848 2 года назад
Thank you bro it's working 💓💓💓😊😊😊😊😊😊
@giovannimichel5506
@giovannimichel5506 2 года назад
Thank you for the intel.
@kedigiller111
@kedigiller111 2 года назад
really helpfull, thanks a lot
@mrtmore1038
@mrtmore1038 2 года назад
Thank you!
@jake445
@jake445 2 года назад
This kind of video is what I needed. I am very much a beginner, but I wondered why I have to link huge external libraries, when I needed only 1-2 icons. Lots of unused codes in the libraries, and damn, now I am using svg, it makes codes appear larger, but i just embed it inside span tag and collapse it.
@mtycoder
@mtycoder 3 года назад
im using boxicons and is open source, besides that with that library they easily allow you to copy the SVG file, give them a try.,
@alexhardao2742
@alexhardao2742 8 месяцев назад
wow nice tip!
@marcelositonio2495
@marcelositonio2495 2 месяца назад
Awesome :)
@asdffacil
@asdffacil 2 года назад
Nice tip
@nelsonazolukwamprojects
@nelsonazolukwamprojects 3 года назад
Wonderful content though. never knew that existed.
@tomslaterdesignillustratio4391
Genius!
@timawid
@timawid 2 года назад
actually font awesome gives me some problem not letting the icon apear. i wont ever use fontawesome Thanks❤❤
@samo4502
@samo4502 2 года назад
niceeeeeee thanks and i like it
@jaykay5486
@jaykay5486 3 года назад
Would this work with the code from Illustrator SVG,
@EricMurphyxyz
@EricMurphyxyz 3 года назад
I would assume so, should work with any SVG code.
@digitalminister5687
@digitalminister5687 3 года назад
Iconmonstr has many cool icons as well
@EricMurphyxyz
@EricMurphyxyz 3 года назад
Nice, great resource! Never heard about this before
@dc-tlc9654
@dc-tlc9654 2 года назад
Thanks 👍
@vishveshpratapsingh
@vishveshpratapsingh 2 года назад
Thanks bro
@sharonamaina3553
@sharonamaina3553 Год назад
Thank you
@TheTimeProphet
@TheTimeProphet 3 года назад
I do a similar thing, but you can put all your svg icons into one file and give them an id and use xlink to show them. This way you only have one file to load, as it gets cached. eg This code would show the icon with the id of hat. The svg file can have hundreds of icons with a different id. Of course you have to set the width and height in css, as SVG has to have a width and a height. Let me know if you want to know more
@TheTimeProphet
@TheTimeProphet 2 года назад
@Entertainment Roller Coaster I am always around
@TheTimeProphet
@TheTimeProphet 2 года назад
@Entertainment Roller Coaster Once you made your file. Use the first code I posted to show it. eg Just change the xlink line to whatever icon you want to show eg
@TheTimeProphet
@TheTimeProphet 2 года назад
@Entertainment Roller Coaster You have all your icons in one file. That means your icons will load faster as it is one call to the file. As for the individual icons you can either make them yourself in illustrator and export the data, or download and use other peoples svgs. I do a bit of both. the important part is the viewBox, and the paths. Personally I would optimise your svg online before putting it in the file. This removes all the unnessary groups which you don't need on the web. I also remove colours. Then you can colour your svg using css.
@md.ridwanulhassanrafi6851
@md.ridwanulhassanrafi6851 3 года назад
thanks a lot 🤍🤍
@softwarereviews2496
@softwarereviews2496 3 года назад
Thanks Dear Give me to great skills
@peterpeter8421
@peterpeter8421 3 месяца назад
たすかったよ ありがとう
@j.m.p.8739
@j.m.p.8739 Год назад
remove the xlmns and let's see if it loads the icon.
@jimohyinka4895
@jimohyinka4895 Год назад
this looks nice, but I think a link would be needed?
@EricMurphyxyz
@EricMurphyxyz Год назад
You mean an attribution link?
@luckybairagi7294
@luckybairagi7294 2 года назад
which OS are you using??
@EricMurphyxyz
@EricMurphyxyz 2 года назад
Arch Linux!
@biyanwho
@biyanwho 2 года назад
The real question is, how do you display this icon as pseudo element
@craigburton4447
@craigburton4447 2 года назад
Could you perhaps save the SVG to your images folder and put it's URL in the content " " property? I haven't tried it, but that's what I would try first
@bettercalldelta
@bettercalldelta 11 месяцев назад
turn it into a data url
@Nature-calm-song
@Nature-calm-song Год назад
Awesome
@agentsmith2189
@agentsmith2189 2 года назад
ty
@MarttyLovato
@MarttyLovato Год назад
genio te quiero mucho
@gudneighbour
@gudneighbour 5 месяцев назад
thanks
@R.A.G.U.L
@R.A.G.U.L Месяц назад
You are a fucking genius broo☠Even after 3years you solved my problem
@ilovancristian
@ilovancristian 2 года назад
thx
@Ayomikun
@Ayomikun 3 года назад
I'm probably just being silly, but is this definitely allowed?
@EricMurphyxyz
@EricMurphyxyz 3 года назад
Font Awesome is under an open source license, so it's all good.
@Ayomikun
@Ayomikun 3 года назад
@@EricMurphyxyz Thanks, this is fucking awesome then 🤣
@ck0024
@ck0024 3 года назад
I use boxicon
@EricMurphyxyz
@EricMurphyxyz 3 года назад
Wow, there's a lot of great icon resources I never knew about
@thakurtilak2860
@thakurtilak2860 Год назад
Thank you, you have shown easy path otherwise I was getting box instead of icon i desired.Thanks again to solve it without going through all that process.By do by, u decoded font-awesome secret so its coming for u.
@golf_wangg48
@golf_wangg48 2 года назад
@Ilyas_Alrai
@Ilyas_Alrai 2 года назад
But as programmer you allways want a way simplify things and let machine do all stuff for you instead of copying every single icon code. I think javascript itself is a bloated language but we use it anyways because it does the job.
@EricMurphyxyz
@EricMurphyxyz 2 года назад
There are more efficient ways to use icons without bringing in the bloated Font Awesome library. I know react-icons for React is good, but I'm not sure of an easier way to do it in just HTML. That said, I only really need around 5 icons for a given website and copy & pasting a small amount of icons is not a big deal for me. The performance savings are worth it for me, but it's up to you.
@kamdanibwp
@kamdanibwp 7 месяцев назад
جزاک اللہ خیرا
@sovereignlivingsoul
@sovereignlivingsoul Год назад
that is a good suggestion until they close the sight or change their policies, using programs like GIMP and Inkscape to create your own icons would be a useful skill to learn.
@EricMurphyxyz
@EricMurphyxyz Год назад
There are still tons of ways to get the svg code without that specific website, it's not just something they can change their policies and remove. Making your own icons may be a useful skill but nobody is going to hand render a Facebook icon for their website
@sovereignlivingsoul
@sovereignlivingsoul Год назад
@@EricMurphyxyz yeah, i know, i think knowing how to insert svg files into their website is a god skill, that's all, your advice is sound.
@donmorris4506
@donmorris4506 3 года назад
Dude, just get a font awesome pro license and then can include just the icons you want.
@EricMurphyxyz
@EricMurphyxyz 3 года назад
Even the official Font Awesome library brings in a bunch of unnecessary JavaScript. React Icons is a lot more light weight.
@timawid
@timawid 2 года назад
Thanks bro
Далее
Why Are Open Source Alternatives So Bad?
13:06
Просмотров 576 тыс.
Каха заблудился в горах
00:57
Просмотров 3,9 млн
УРА! Я КУПИЛ МЕЧТУ 😃
00:11
Просмотров 922 тыс.
СЛУЧАЙ В ЧЕРНОБЫЛЕ😰#shorts
00:19
Просмотров 243 тыс.
Learn CSS icons in 8 minutes! 🐤
8:33
Просмотров 28 тыс.
Nobody Understands Online Privacy.
14:11
Просмотров 176 тыс.
Setting up Font Awesome icons as pseudo-elements
17:15
How to use Font Awesome 6 icons offline
5:50
Просмотров 33 тыс.
Top 10 CSS One Liners That Will Blow Your Mind
13:34
Просмотров 929 тыс.
"Caring about privacy almost ruined my life."
12:40
Просмотров 77 тыс.
Can You REALLY Trust Proton Mail?
16:57
Просмотров 191 тыс.
Using AI to Create the Perfect Keyboard
12:05
Просмотров 1,4 млн
Battery  low 🔋 🪫
0:10
Просмотров 13 млн