How to map the icons from the CSS file? - css

I downloaded a free css theme and this theme uses css file and font files for icons and unfortunately the theme has no documentation. How can I visually export them to an html file instead of looking at the CSS file line by line?
https://yadi.sk/d/K1fgjd61wWCy8Q
https://yadi.sk/d/j3tjDtwa3Gucng
https://yadi.sk/d/QCi26iPmPE5QIA
https://yadi.sk/d/POI-p5eOsmQArQ
https://yadi.sk/d/tKJY9lGomWsqmg
It was obviously created through icomoon, but I want to see visually which icons are there.

Just to clarify, you wanted to have a preview of the icons, right? That's why you're asking to convert it to HTML to easily view in the browser. If so, I hope this would do:
With the use of your .SVG file (https://yadi.sk/d/tKJY9lGomWsqmg), you can upload this to https://icomoon.io/. There, you can have a preview of the available icons with their corresponding names.
IcoMoon App has a feature of converting .SVG to icons. And with that, it also offers to have a preview of the icons with their names.
I tried opening the .SVG on itself, but (I'm not an expert here) I didn't get to have a preview of the icons.
I hope that helps.

Related

Generate content code from Icon s pack - CSS

I have downloaded a simple template from the internet and for icons, the developer used Flaticons font. Now I want to put another icon on the website but I can't get Flaticons code for CSS file. On Flaticon site only can be downloaded in PSD, SVG, BASE 64 I don't have code like .flaticon-research:before { content: "\f100"; }. How to get that? Is there any solution to convert SVG file to get that content or how? I don't want to download every single SVG file and from the SVG file get the icon. I want to use the above example method. Any help will be welcome. Thanks all
follow the instruction here https://www.flaticon.com/iconfonts
after downloading the font you will see multiple files show you how to use your icons depending on you using css or scss

I'm looking at a css sheet for a react page, and many classes are using content to generate images, but content display in VSCode is a 

I am digging into an existing reactJS site, and many images are being rendered by using the css content property. I am looking at the css sheet in VSCode, and many classes are appearing with content listed as "". I'm not sure if I need a plugin to view the actual content, but I can't find a way to see it at this point.
I can use alter the content attribute to point to a different image, but want to know where this is being generated so I can alter it at the source. The site is setup to use Contentful, but assets there are called directly on pages, not in css.
.fa-discord:after {
content: "";
}
I'd like to be able to track down where this image is being stored or generated. Any help is appreciated!
That's a Font Awesome icon for Discord, and can be found here. Yes, you need to include Font Awesome on your website if you want to render any of their glyph icons. And you can easily work out whether a website is attempting to use Font Awesome glyph icons or not, as their selectors all start with fa- and replace the content.
Font Awesome icons are generated through an included CSS file, most commonly located in a folder like /fonts/font-awesome/css/font-awesome.min.css.
This file uses unicode characters to generate the corresponding glyph representations, and the specific unicode character for the Discord icon is 392. Thus, content: "\f392" will render the relevant glyph icon.
If a box or square shows up instead of an actual glyph, that means that the font you're using doesn't incorporate that particular unicode glyph. Font Awesome rapidly expands its coverage of unicode glyphs, and you will need to update to at least Font Awesome 5.0.0 in order to use the Discord glyph.

Include only part of font-awesome

I need font-awesome to have spinner icons.
I could include the whole font-awesome library. But wouldn't that be an overkill for just one icon? Is there a way to include just one icon or component? The problem seems to be, that the library is not modularised to different files. For example, if using scss, all icons are in _icons.scss file, rather than each icon in their own file. If you use pure css, then everything is in one file.
You can't. A font is a single file, much like an image or a document. It doesn't matter how you include it in your CSS -- users will still download the whole font file. The CSS definitions just make the font available on your web site.
There are some things that you could do as an alternative. There are some companies that will allow you to generate partial font sets using custom applications (like https://icomoon.io/, for example). That might suit your needs. But, once you create a custom version of their fonts it's still a file that you can't break up. Still, a custom version of icomoon can be very small and streamlined and would likely fit the scenario you describe.
Another alternative would be to not host the font yourself but use cloud-based fonts that are more likely to be cached by your users. It's not a solution per se but would increase the chances somewhat that your users wouldn't have to download the fonts specifically for your site.
Font awesome v5 supports partial styles, in the getting-started page (https://fontawesome.com/v5.15/how-to-use/on-the-web/referencing-icons/basic-use), you could include this essential file first:
<link href=/your-path-to-fontawesome/css/fontawesome.css" rel="stylesheet">
and then, you could include one or some of those:
<link href="/your-path-to-fontawesome/css/brands.css" rel="stylesheet">
<link href="/your-path-to-fontawesome/css/regular.css" rel="stylesheet">
<link href="/your-path-to-fontawesome/css/solid.css" rel="stylesheet">
Very old question, but now you can use their JS API, which will load only selected SVG files. This incredibly lowers the bundle size.
npm install #fortawesome/fontawesome-svg-core #fortawesome/free-solid-svg-icon
and then
import { library, dom } from '#fortawesome/fontawesome-svg-core'
import { faCamera } from '#fortawesome/free-solid-svg-icons'
library.add(faCamera)
dom.watch()
<i class="fa-solid fa-camera"></i>
Two years on after this question was asked, I would suggest you use SVGs rather than an icon font. You can concatenate all your SVGs into an SVG spritesheet, so they all get loaded (and cached) using a single HTTP request. The file will be much smaller than an entire icon font, which was your requirement.
Here are some reasons to pick SVGs over icon fonts (also see here):
You're including only the icons that you want, obviously.
SVG icons allow you to create multicolored icons.
Icons fonts are anti-aliased by the browser. SVGs are not, so they look sharper.
Font icons can be hard to position. SVGs are easy.
SVG icons can have baked-in titles and descriptions, which is good for accessibility.
To get high performance, you'll need to place all your SVG icons in a sprite sheet. You can do this using svgstore (grunt and gulp and webpack versions are available) so that it's part of your build process.
FontAwesome makes all its icons available as SVG files, so you can pick the ones you want and add them to your spritesheet build.
Yes You can, try this Optimize Font Awesome To Ridiculously Low Size Of 10KB!
This is an old question. However, there is a workaround.
I will assume that you are using npm and webpack. (in my case I use Laravel, which includes npm)
Open the folder node_modules/#fortawesome/fontawesome-free/js. Now say you want to use the facebook icon only in the brands.js.
copy brands.js and past it with another name -say 'brands_used.js'- in the same folder
open brands_used.js and comment the var icons = {...}; section, keep it for reference latter
type in a new variable with the icons you want included only, which will be a copy/past from the commented section.
var icons = {
"facebook-f":[...],
};
require the newly created files in your js assets folder
compile your assets
Icomoon lets you use their standalone svgs.
https://github.com/Keyamoon/IcoMoon-Free/tree/master/SVG

Add glyphicon to a webpage that was not created with bootstrap without compromising layout

I have an old website, and I would like to add a glyphicons to a page of this site.
I cannot install bootstrap (link bootstrap.js and bootstrap.css to this page) because it will change all styled elements on the page.
Is there a way to add only "glyphicons functionality"?
You can build your bootstrap to components, which you need, on
http://getbootstrap.com/customize/
For example for only glyphicon, you can check only glyphicon checkbox and download.
Direct url for this setting is
http://getbootstrap.com/customize/?id=428c81f3f639eb0564a5
Scroll down and download it.
You download only two folders with css for glyphicon (bootstrap.min.css) and fonts files (in all only 170 Kb).
I prefer to use something called 'font-awsome' it has a huge library of icons and it only takes one line of code to include it into any project. - It works the same way as glyphicon being able to format with CSS etc.
I know this is not a answer to your question, but its a valid work around, and I prefer the font-awesome icons.
http://fortawesome.github.io/Font-Awesome/
View here how to include it on your website:
http://fortawesome.github.io/Font-Awesome/get-started/
Have Fun!
You can download glyphicons png on http://glyphicons.com/

How to add custom image to font awesome icon

I'm a fan of Font Awesome I'm using lots of icons from there. But, now I need adding my custom image to font awesome file for using as icon. I want to add them to font icons files so that I can use their property like .fa-2x .fa-lg etc By researching on internet I found that I can convert my svg image to font using icomoon or font custom But, my confusion is after downloading files of my generating images as fonts how can I add those to font awesome files. I mean, there are already some files named
FontAwesome (Open Type Font File)
fontawesome-webfont.eot
fontawesome-webfont (SVG Document)
fontawesome-webfont (True Type Font File)
fontawesome-webfont.woff
Should I've to put anything on those files after downloading my custom generated fonts files? Or, should I've to put the CSS code from custom generated fonts files to fontawesome.css? if this, what CSS code should I put on there? I ain't experienced so much with this process. So, I'm confused with this. That's why, I can't tell everything arranged way. Sorry for this. Thanks
Best bet might be using a service like Fontello where you can "create" your own custom icon font and upload the custom icons there in addition to selecting the icons you need from Font Awesome.

Resources