Git Product home page Git Product logo

picon's Introduction

Usage

Picon is a ligature-based icon font, and so, it does not require any external CSS stylesheet, or any javascript.

Import it:

@font-face {
  font-family:picon;
  src:url(//yne.fr/picon/Picon-Regular.woff2);
}

Declare it the way you like it, here is some examples:

/* the safe */
.picon { font-family:picon; }
/* the brave */
i { font-family:picon; }
/* the markdown lover */
del { font-family:picon; text-decoration: none;}

Use it :

<del>app</del>

to get the app app icon

Hackable

Picon is under SIL Open Font License 1.1 Licencied, so you can

  • rebuild your own version
  • use it in any commercial project
  • modify it
  • redistribute/sell it (if you can)

Pico sized

Picon strive to be:

the lightest iconset
Name Avg. SVGs sizes
Picon 144 Bytes
Feather 378 Bytes
Material 479 Bytes
Jam 535 Bytes
Fontawesome 754 Bytes
Clarity 916 Bytes
Entypo 1070 Bytes

Those values have been computed using the following line

find -name '*.svg' -printf '%s\n' | awk '{s+=$0} END {printf s/NR}'
readable down to 8px * 8px
Iconset ๐Ÿ–ผ ๐Ÿ“ž ๐Ÿ”ˆ ๐Ÿ•ท๏ธ
Clarity pic-clarity phone-clarity vol-clarity bug-clarity
Feather pic-feather phone-feather vol-feather bug-feather
Fontawesome pic-fawesom phone-fawesom vol-fawesom bug-fawesom
Jam pic-jamicon phone-jamicon vol-jamicon bug-jamicon
Material pic-materia phone-materia vol-materia bug-materia
Picon pic-picon  phone-picon  vol-picon  bug-picon
Entypo pic-entypo phone-entypo vol-entypo bug-entypo

Font

If want to have icons on your website, you may hesistate between using a couple of SVG, or importing a for or simply use unicode glyphs.

Picon is available as SVGs or as a font. But font format offer the following advantages:

  • it will assure you to have a reproducible result on any plateform (unlike unicode).
  • it can bundle many icons while being lightweight because of it binary and compressed format (unlike SVG).
  • it can be used in text-only section like input placeholder or pseudo element (unlike SVG).
  • it can be colored to match your style (unlike unicode or SVG that needs to be embedded to do that).
  • it can have any brand logo or custom icon you may need (unlike Unicode)
Criteria Uni SVG Font
Coloration โœ— โœ— โœ“
Lightweight โœ“ โœ— โœ“
Reproductible โœ— โœ“ โœ“
Custom Glyph โœ— โœ“ โœ“
Text-based โœ“ โœ— โœ“
Multi-shade โœ“ โœ“ โœ—

Secret snippets

The following are for advanced users only.

Animation

Because why not

@keyframes wifi {
	0%,100%{content:'wifi-0'}
	20%{content:'wifi-1'}
	40%{content:'wifi-2'}
	60%{content:'wifi-3'}
	80%{content:'wifi-4'}
}
.wifi:after{
	font-family:Picon;
	content:'wifi-4';
	animation: wifi 1s infinite;
}
Icons in my form ?

Any HTML element that display text (reset button, select ...) can also display Picon icons:

<input type=reset class=picon value=cross>

<select>
	<optgroup label=iconless>
		<option>wifi-0
	</optgroup>
	<optgroup class=picon label="wifi-0">
		<option>wifi-0
		<option>wifi-4
	</optgroup>
</select>
attribut based icon

Display the language icon of a <pre lang=js>var i=0</pre> :

pre[lang]:after{
	font-family:Picon;
	content:'lang-' attr(lang);
	float:right;
}
Icon stacking

You can stack multiple icons with the following CSS snippet:

[data-picon]{
	position: relative;
	font-size:32px;
}
[data-picon]:after{
	content:attr(data-picon);
	position: absolute;
	left: 0;
	text-shadow: 0 -2px white;
}

Example: Stack a cross icon over a volume icon:

<del data-picon=cross>volume</del>

picon's People

Contributors

yne avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.