Project

purpur

0.0
No commit activity in last 3 years
No release in over 3 years
Purpur is a possibility to generate SVG which will use for icons in modern web projects
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.6
~> 0.3.4
~> 1.6
~> 10.4
~> 2.7.0
 Project Readme

PurPur

Free ‘plug and play’ set of SVG icons designed specifically for web projects. Available as a Ruby gem. Just use icon names with your templates and styles — and all the rest will be done automagically.

The 'purpur' gem originaly based on 'EvilIcons'.

Supported browsers

We support IE 11+, Firefox, Chrome, Safari (desktop and mobile), Opera, Android 4+.

Using with rails

Add the 'purpur' gem to your Gemfile:

gem 'purpur'

This gem is under deep development, so we would reccomend to use master branch:

gem 'purpur', github: 'cimon-io/purpur'

Add the purpur icons require to your application.css:

/*
 *= require purpur
 */

Next, you have to place all svg-icons inside app/assets/icons folder and generate purpur.svg file:

bin/rake purpur:process

Finally, you can render the icon using the icon_tag helper. Here are some examples:

<%= icon_tag 'search' %>
<%= icon_tag 'arrow-right', size: :m %>
<%= icon_tag 'envelope', size: :l, class: "custom-class" %>

If you would like to use icons on the client side only, include purpur_meta_tag to the head section and require purpur.js. You'll have purpur object with method html which return raw html to insert. Example:

  purpur.html('profile')

The meta tag is needed to know the path to the purpur.svg resource.

Roadmap

  • Implement possibility to use outside rails.
  • Allow to set animated icons inside icons
  • Describe algorithm to create cvg icons
  • Implement responsive icons