• Stars
    star
    205
  • Rank 191,264 (Top 4 %)
  • Language
    HTML
  • License
    MIT License
  • Created about 8 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Free iOS-icons font for Framework7

Framework7 Icons

The premium and free iOS-icons font for Framework7.

The font is developed to be used with Framework7, but you can use it wherever you see it fits, personal or commercial. It is free to use and licensed under MIT.

Getting Started

  1. Download and extract the font pack

  2. Copy the framework7-icons.css to your project or add this CSS to your own CSS file:

    @font-face {
      font-family: 'Framework7 Icons';
      font-style: normal;
      font-weight: 400;
      src: local('Framework7 Icons'), local('Framework7Icons-Regular'),
        url('../fonts/Framework7Icons-Regular.woff2') format('woff2'), url('../fonts/Framework7Icons-Regular.woff')
          format('woff'), url('../fonts/Framework7Icons-Regular.ttf') format('truetype');
    }
    
    .f7-icons,
    .framework7-icons {
      font-family: 'Framework7 Icons';
      font-weight: normal;
      font-style: normal;
      font-size: 28px;
      line-height: 1;
      letter-spacing: normal;
      text-transform: none;
      display: inline-block;
      white-space: nowrap;
      word-wrap: normal;
      direction: ltr;
      -webkit-font-smoothing: antialiased;
      text-rendering: optimizeLegibility;
      -moz-osx-font-smoothing: grayscale;
      -webkit-font-feature-settings: 'liga';
      -moz-font-feature-settings: 'liga=1';
      -moz-font-feature-settings: 'liga';
      font-feature-settings: 'liga';
    }
  3. Copy the fonts folder to your project

  4. Ensure the font urls within framework7-icons.css properly reference the fonts path within your project.

  5. Include a reference to the framework7-icons.css file from every webpage you need to use it:

    <link rel="stylesheet" href="path/to/framework7-icons.css" />

Or with component:

$ component install framework7io/framework7-icons

Or with bower:

$ bower install framework7-icons

Or with npm:

$ npm install framework7-icons

Webpack

When using webpack, you must add loaders for css and fonts.

{ test: /\.css/, loader: 'style-loader!css-loader' },
{ test: /\.(woff|woff2|ttf)$/, loader: 'url-loader?limit=100000' },

Then you can import the module like so:

import 'framework7-icons';

HTML Example

You can use 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:

<i class="f7-icons">house</i>

This example uses a typographic feature called ligatures, which allows rendering of an icon glyph simply by using its textual name. The replacement is done automatically by the web browser and provides more readable code than the equivalent numeric character reference.

Styling Icons

Sizing

Framework7 Icons look best at 28px, but if an icon needs to be displayed in an alternative size, just use CSS font-size rule:

.size-14 {
  font-size: 14px;
}
.size-28 {
  font-size: 28px;
}
.size-32 {
  font-size: 32px;
}
.size-56 {
  font-size: 56px;
}
<i class="f7-icons size-14">house</i>
<i class="f7-icons size-28">house</i>
<i class="f7-icons size-32">house</i>
<i class="f7-icons size-56">house</i>

Coloring

Using the icon font allows for easy styling of an icon in any color.

.color-black {
  color: #000;
}
.color-white {
  color: #fff;
}
<i class="icon f7-icons color-black">house</i> <i class="icon f7-icons color-white">house</i>

Using in data- attributes

Add the following CSS rule:

.f7-icons[data-icon]:before {
  content: attr(data-icon);
  color: inherit;
}

And now you can use it with data- attributes:

<i class="f7-icons" data-icon="house"></i>

SVG Components

Since v 4.0.0 there are pure SVG components available for React, Svelte and Vue.

In React:

import { House, HeartCircle } from 'framework7-icons/react';

export default () {
  // ...
  return (
    <div>
      <House />
      ...
      <HeartCircle />
    </div>
  )
}

In Svelte:

<div>
  ...
  <House />
  ...
  <HeartCircle />
  ...
</div>
<script>
  import { House, HeartCircle } from 'framework7-icons/svelte';
  // ...
</script>

In Vue:

<template>
  <div>
    ...
    <f7-house />
    ...
    <f7-heart-circle />
    ...
  </div>
</template>

<script>
  import { House, HeartCircle } from 'framework7-icons/vue';

  export default {
    components: {
      f7House: House,
      f7HeartCircle: HeartCircle,
    },
    ...
  }
</script>

Build Instructions

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:

  1. Install FontForge, which is the program that creates the font files from the SVG files:

    $ brew install fontforge ttfautohint

  2. Install woff2

    $ git clone --recursive https://github.com/google/woff2.git $ cd woff2 $ make clean all

  3. Add or subtract files from the src/ folder you'd like to be apart of the font files.

  4. Run the build command:

    python ./build/generate.py

License

Framework7 Icons font is licensed under the MIT license.

More Repositories

1

framework7

Full featured HTML framework for building iOS & Android apps
JavaScript
18,045
star
2

framework7-vue

Deprecated! Build full featured iOS & Android apps using Framework7 & Vue
Vue
674
star
3

framework7-template-vue-webpack

Deprecated! Framework7 Vue Webpack starter app template with hot-reload & css extraction
Vue
384
star
4

framework7-website

Framework7 website for contributing and offline usage
JavaScript
160
star
5

framework7-template-react

Deprecated! Framework7 React starter app template with hot-reload & css extraction
JavaScript
107
star
6

framework7-appstore-react

iOS App Store UI
JavaScript
91
star
7

framework7-cli

Framework7 command line utility
JavaScript
89
star
8

framework7-template-vue-simple

Deprecated! Simple Framework7 Vue starter app template in a single HTML file
HTML
82
star
9

framework7-plugin-keypad

Keypad plugin extends Framework7 with additional custom keyboards
JavaScript
75
star
10

framework7-recipes

Framework7 proof of concept templates, layouts and scripts
HTML
68
star
11

ToDo7

Framework7 todo demo app
CSS
62
star
12

framework7-plugin-3d-panels

Framework7 plugin to add 3d effect for side panels
JavaScript
61
star
13

Weather7-Material

Framework7 weather demo app in Material style
JavaScript
49
star
14

framework7-template-tabs

Deprecated! Framework7 tabs (multiple views) starter app template
HTML
40
star
15

framework7-template-single-view

Deprecated! Framework7 single view starter app template
HTML
34
star
16

framework7-plugin-feeds

Framework7 Feeds plugin brings easy RSS feeds integration into Framework7 app.
JavaScript
33
star
17

Weather7

Framework7 weather demo app
CSS
29
star
18

framework7-nextjs-starter

JavaScript
26
star
19

framework7-template-webpack

Deprecated! Framework7 Vue Webpack starter app template with hot-reload & css extraction
HTML
24
star
20

framework7-template-vue-browserify

Depreacated! Framework7 Vue with Browserify starter app template with hot-reload & css extraction
Vue
21
star
21

framework7-template-split-view

Deprecated! Framework7 split view starter app template
HTML
19
star
22

framework7-react-static-template

A static JavaScript template for Framework7 React
JavaScript
13
star
23

framework7-loader

JavaScript
8
star
24

rollup-plugin-framework7

Rollup & Vite plugin to load Framework7 single file components
JavaScript
7
star
25

framework7-cli-template-tabs

Tabs template for Framework7 CLI
HTML
2
star
26

framework7-cli-template-singleview

Default Single View template for Framework7 CLI
HTML
2
star
27

framework7-cli-scripts

Framework7 CLI cordova hooks and scripts
JavaScript
1
star
28

.github

1
star
29

blog.framework7.io

JavaScript
1
star