hivewallet / hive-js

Hive digital currency wallet
http://www.hivewallet.com
GNU General Public License v2.0
81 stars 57 forks source link

Establish a workflow for SVG icons #85

Closed haustraliaer closed 10 years ago

haustraliaer commented 10 years ago

I've been thinking about this for a while now and after checking the actual support for SVG in browsers (http://caniuse.com/#search=svg) - I've concluded that we should actually just use svg as background images (or indeed inline if it makes sense).

I'll modify my existing mixin for icons to have an argument for image URL and then @jenbennings can start pushing master assets to the img folder when/if they are ready. If we decide later on that it would be smarter to bundle the main icons as a single CSS file with inline data-URI svg then we can do that for production, but in development/beta I don't think it'll be necessary.

jenbennings commented 10 years ago

I will set up a master .sketch file that includes all svg icons/assets, along with an export script to make updates a bit easier.

jenbennings commented 10 years ago

There is now a assets-master.sketch file in the repo that includes the image assets we've generated so far (Git picks this up as a folder).

I have also added a gulp sketch task which automatically exports assets to the app/assets/img folder. This requires Sketch 3 & SketchTool to be installed locally.

jenbennings commented 10 years ago

Re-opening this because I forgot @haustraliaer still has to write the mixin for SVG background-image.

haustraliaer commented 10 years ago

closed with https://github.com/hivewallet/hive-js/commit/27b406ded5c1ce001db3b8fd7a9925a501efb34b

Use the following mixin for icons - defining width, height, display property & url:

.my_icon {
  @include icon(20px, 20px, block, '/assets/img/icon.svg');
}