@@ -11,51 +11,51 @@ The font is developed to be used with [Framework7](http://framework7.io/), but y
11111 . Download and extract the font pack
12122 . Copy the ` framework7-icons.css ` to your project or add this CSS to your own CSS file:
1313
14- ``` css
15- @font-face {
16- font-family : ' Framework7 Icons' ;
17- font-style : normal ;
18- font-weight : 400 ;
19- src : url (" ../fonts/Framework7Icons-Regular.eot" );
20- src : local (' Framework7 Icons' ),
21- local ( ' Framework7Icons-Regular' ),
22- url (" ../fonts/Framework7Icons-Regular.woff2 " ) format (" woff2 " ),
23- url ( " ../fonts/Framework7Icons-Regular.woff " ) format ( " woff " ),
24- url ( " ../fonts/Framework7Icons-Regular.ttf " ) format ( " truetype " );
25- }
26-
27- .f7-icons , .framework7-icons {
28- font-family : ' Framework7 Icons ' ;
29- font-weight : normal ;
30- font-style : normal ;
31- font-size : 28 px ;
32- line-height : 1 ;
33- letter-spacing : normal ;
34- text-transform : none ;
35- display : inline-block ;
36- white-space : nowrap ;
37- word-wrap : normal ;
38- direction : ltr ;
39- -webkit-font-smoothing : antialiased ;
40- text-rendering : optimizeLegibility ;
41- -moz-osx- font-smoothing : grayscale ;
42- -webkit -font-feature-settings : " liga" ;
43- -moz-font-feature-settings : " liga=1 " ;
44- -moz- font-feature-settings : " liga" ;
45- font-feature-settings : " liga " ;
46- }
47- ```
14+ ``` css
15+ @font-face {
16+ font-family : ' Framework7 Icons' ;
17+ font-style : normal ;
18+ font-weight : 400 ;
19+ src : url (' ../fonts/Framework7Icons-Regular.eot' );
20+ src : local (' Framework7 Icons' ), local ( ' Framework7Icons-Regular ' ),
21+ url ( ' ../fonts/Framework7Icons-Regular.woff2 ' ) format ( ' woff2 ' ), url ( ' ../fonts/ Framework7Icons-Regular.woff ' )
22+ format ( ' woff ' ), url (' ../fonts/Framework7Icons-Regular.ttf ' ) format (' truetype ' );
23+ }
24+
25+ .f7-icons ,
26+ .framework7-icons {
27+ font-family : ' Framework7 Icons ' ;
28+ font-weight : normal ;
29+ font-style : normal ;
30+ font-size : 28 px ;
31+ line-height : 1 ;
32+ letter-spacing : normal ;
33+ text-transform : none ;
34+ display : inline-block ;
35+ white-space : nowrap ;
36+ word-wrap : normal ;
37+ direction : ltr ;
38+ -webkit-font-smoothing : antialiased ;
39+ text-rendering : optimizeLegibility ;
40+ -moz-osx-font-smoothing : grayscale ;
41+ -webkit- font-feature-settings : ' liga ' ;
42+ -moz -font-feature-settings : ' liga=1 ' ;
43+ -moz-font-feature-settings : ' liga' ;
44+ font-feature-settings : ' liga' ;
45+ }
46+ ```
47+
48483 . Copy the ` fonts ` folder to your project
49494 . Ensure the font urls within ` framework7-icons.css ` properly reference the ` fonts ` path within your project.
50505 . Include a reference to the ` framework7-icons.css ` file from every webpage you need to use it:
5151
52- ```html
53- <link rel="stylesheet" href="path/to/framework7-icons .css">
54- ```
52+ ``` html
53+ <link rel =" stylesheet" href =" path/to/framework7-icons.css" / >
54+ ```
5555
5656Or with [ component] ( https://github.com/componentjs/component ) :
5757
58- $ component install nolimits4web /framework7-icons
58+ $ component install framework7io /framework7-icons
5959
6060Or with [ bower] ( http://bower.io/ ) :
6161
@@ -80,10 +80,10 @@ Then you can import the module like so:
8080import ' framework7-icons' ;
8181```
8282
83-
8483## HTML Example
8584
8685You can use [ framework7.io] ( http://framework7.io ) or included ` cheatsheet.html ` file to easily find the icon you want to use. It’s easy to incorporate icons into your web page. Here’s a small example:
86+
8787``` html
8888<i class =" f7-icons" >house</i >
8989```
@@ -97,10 +97,18 @@ This example uses a typographic feature called [ligatures](http://alistapart.com
9797Framework7 Icons look best at 28px, but if an icon needs to be displayed in an alternative size, just use CSS ` font-size ` rule:
9898
9999``` css
100- .size-14 { font-size : 14px }
101- .size-28 { font-size : 28px }
102- .size-32 { font-size : 32px }
103- .size-56 { font-size : 56px }
100+ .size-14 {
101+ font-size : 14px ;
102+ }
103+ .size-28 {
104+ font-size : 28px ;
105+ }
106+ .size-32 {
107+ font-size : 32px ;
108+ }
109+ .size-56 {
110+ font-size : 56px ;
111+ }
104112```
105113
106114``` html
@@ -115,13 +123,16 @@ Framework7 Icons look best at 28px, but if an icon needs to be displayed in an a
115123Using the icon font allows for easy styling of an icon in any color.
116124
117125``` css
118- .color-black { color : #000 }
119- .color-white { color : #fff }
126+ .color-black {
127+ color : #000 ;
128+ }
129+ .color-white {
130+ color : #fff ;
131+ }
120132```
121133
122134``` html
123- <i class =" f7-icons color-black" >house</i >
124- <i class =" f7-icons color-white" >house</i >
135+ <i class =" f7-icons color-black" >house</i > <i class =" f7-icons color-white" >house</i >
125136```
126137
127138## Using in ` data- ` attributes
@@ -130,8 +141,8 @@ Add the following CSS rule:
130141
131142``` css
132143.f7-icons [data-icon ]:before {
133- content : attr (data-icon );
134- color : inherit ;
144+ content : attr (data-icon );
145+ color : inherit ;
135146}
136147```
137148
@@ -141,26 +152,88 @@ And now you can use it with `data-` attributes:
141152<i class =" f7-icons" data-icon =" house" ></i >
142153```
143154
155+ ## SVG Components
156+
157+ Since v 4.0.0 there are pure SVG components available for React, Svelte and Vue.
158+
159+ In React:
160+
161+ ``` jsx
162+ import { House , HeartCircle } from ' framewokr7-icons/react' ;
163+
164+ export default () {
165+ // ...
166+ return (
167+ < div>
168+ < House / >
169+ ...
170+ < HeartCircle>
171+ < / div>
172+ )
173+ }
174+ ```
175+
176+ In Svelte:
177+
178+ ``` html
179+ <div >
180+ ...
181+ <House />
182+ ...
183+ <HeartCircle >
184+ ...
185+ </div >
186+ <script >
187+ import { House , HeartCircle } from ' framewokr7-icons/svelte' ;
188+ // ...
189+ </script >
190+ ```
191+
192+ In Vue:
193+
194+ ``` html
195+ <template >
196+ <div >
197+ ...
198+ <f7-house />
199+ ...
200+ <f7-heart-circle />
201+ ...
202+ </div >
203+ </template >
204+ ```
205+
206+ <script >
207+ import { House , HeartCircle } from ' framewokr7-icons/svelte' ;
208+
209+ export default {
210+ components: {
211+ f7House: House,
212+ f7HeartCircle: HeartCircle,
213+ },
214+ ...
215+ }
216+ </script >
144217
145218## Build Instructions
146219
147220This repo already comes with all the files built and ready to go, but can also build the fonts from the source. Requires Python, FontForge and woff2:
148221
149- 1 ) Install FontForge, which is the program that creates the font files from the SVG files:
222+ 1 . Install FontForge, which is the program that creates the font files from the SVG files:
150223
151- $ brew install fontforge ttfautohint
224+ $ brew install fontforge ttfautohint
152225
153- 2 ) Install woff2
226+ 2 . Install woff2
154227
155- $ git clone --recursive https://github.com/google/woff2.git
156- $ cd woff2
157- $ make clean all
228+ $ git clone --recursive https://github.com/google/woff2.git
229+ $ cd woff2
230+ $ make clean all
158231
159- 3 ) Add or subtract files from the ` src/ ` folder you'd like to be apart of the font files.
232+ 3 . Add or subtract files from the ` src/ ` folder you'd like to be apart of the font files.
160233
161- 4 ) Run the build command:
234+ 4 . Run the build command:
162235
163- python ./build/generate.py
236+ python ./build/generate.py
164237
165238## License
166239
0 commit comments