@@ -11,51 +11,51 @@ The font is developed to be used with [Framework7](http://framework7.io/), but y
11
11
1 . Download and extract the font pack
12
12
2 . Copy the ` framework7-icons.css ` to your project or add this CSS to your own CSS file:
13
13
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
+
48
48
3 . Copy the ` fonts ` folder to your project
49
49
4 . Ensure the font urls within ` framework7-icons.css ` properly reference the ` fonts ` path within your project.
50
50
5 . Include a reference to the ` framework7-icons.css ` file from every webpage you need to use it:
51
51
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
+ ```
55
55
56
56
Or with [ component] ( https://github.com/componentjs/component ) :
57
57
58
- $ component install nolimits4web /framework7-icons
58
+ $ component install framework7io /framework7-icons
59
59
60
60
Or with [ bower] ( http://bower.io/ ) :
61
61
@@ -80,10 +80,10 @@ Then you can import the module like so:
80
80
import ' framework7-icons' ;
81
81
```
82
82
83
-
84
83
## HTML Example
85
84
86
85
You 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
+
87
87
``` html
88
88
<i class =" f7-icons" >house</i >
89
89
```
@@ -97,10 +97,18 @@ This example uses a typographic feature called [ligatures](http://alistapart.com
97
97
Framework7 Icons look best at 28px, but if an icon needs to be displayed in an alternative size, just use CSS ` font-size ` rule:
98
98
99
99
``` 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
+ }
104
112
```
105
113
106
114
``` html
@@ -115,13 +123,16 @@ Framework7 Icons look best at 28px, but if an icon needs to be displayed in an a
115
123
Using the icon font allows for easy styling of an icon in any color.
116
124
117
125
``` 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
+ }
120
132
```
121
133
122
134
``` 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 >
125
136
```
126
137
127
138
## Using in ` data- ` attributes
@@ -130,8 +141,8 @@ Add the following CSS rule:
130
141
131
142
``` css
132
143
.f7-icons [data-icon ]:before {
133
- content : attr (data-icon );
134
- color : inherit ;
144
+ content : attr (data-icon );
145
+ color : inherit ;
135
146
}
136
147
```
137
148
@@ -141,26 +152,88 @@ And now you can use it with `data-` attributes:
141
152
<i class =" f7-icons" data-icon =" house" ></i >
142
153
```
143
154
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 >
144
217
145
218
## Build Instructions
146
219
147
220
This 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:
148
221
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:
150
223
151
- $ brew install fontforge ttfautohint
224
+ $ brew install fontforge ttfautohint
152
225
153
- 2 ) Install woff2
226
+ 2 . Install woff2
154
227
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
158
231
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.
160
233
161
- 4 ) Run the build command:
234
+ 4 . Run the build command:
162
235
163
- python ./build/generate.py
236
+ python ./build/generate.py
164
237
165
238
## License
166
239
0 commit comments