GithubHelp home page GithubHelp logo

happy-ferret / thunderbird-icons Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nt1m/thunderbird-icons

0.0 2.0 0.0 526 KB

Photon icons for thunderbird

JavaScript 38.50% Shell 2.37% HTML 16.45% CSS 42.68%

thunderbird-icons's Introduction

Firefox SVG Assets Build Status

If you'd like to contribute SVG assets to Firefox, this is meant to be a handy guide for making sure you SVGs are compressed and neatly formatted as possible 🎉

Table of Contents

  1. Explanation of Pixel Grid
  2. Tips for Illustrator SVGs
  3. Tips for Sketch
  4. Contributing Other Design Workflows
  5. Bash Script for Cleaning SVGs
  6. Contributing Code

Explanation of Pixel Grid

Since so many of our SVGs appear so small, designing them on the pixel grid will help them not appear fuzzy when they’re sized down to 16x16 pixels.

For Illustrator you’ll want the following settings:

  • Document settings: Units: pixels, Advanced > check Align New Objects to Pixel Grid
  • Transform Panel: for existing artwork not on pixel grid, select and then within Transform > Advanced > check Align to Pixel Grid

You can get a more detailed breakdown with images here.

You can download a sample Illustrator file here.

Tips for Illustrator SVGs

When you’re designing your icons in a graphics editor like Adobe Illustrator, there are a lot of things you can do that will bring down the size of the file and make your SVGs easier for the developers to work with. Here are some of them:

  • Expand paths: Instead of having multiple shapes overlapping each other, expand shapes using the pathfinder. Use pathfinder to expand shapes
  • Simplify paths (Object > Path > Simplify)
  • Expand objects so that stokes become objects. This has the added benefit of keeping the stroke size intact as the SVG is resized. Expand strokes to make them objects

Devtools-Specific Requests

The devtools panel icons do a couple of things in a specific way; following these guidelines will help stick your patch:

  1. Inline fill colors. Devtools panel icons all use fill=whitesmoke in the <svg> tag.
  2. Inline opacities. Devtools panel icons also inline opacities on their relevant path.

Tips for Sketch

Sketch vector work is a little different but the fundamentals (keeping your SVG small, expanding all paths) is the same. Here's what we've found helps to build clean icons:

  • Build your icon at 16x16 with the Pixel Grid turned on. You can turn the pixel grid on at View > Canvas > Show Pixels

  • Make sure that all x/y coordinates are full pixels for lines/rectangles. Sub-pixels = not on pixel grid. Position in the upper right hand corner of Sketch

  • Expand all your paths so strokes expand properly as SVG gets resized. You can do this at Layer > Paths > Vectorize Stroke.

  • Align anything that isn't boxy to the pixel grid with item selected then Layer > Round to Nearest Pixel Edge.

Contributing Other Design Workflows

If you’re using a design tool that isn’t listed here and you’d like to add the instructions for how to expand paths, simplify paths, expand strokes, etc., please open a PR! We’d super appreciate it + you’d be the best 💯

Bash Script for Cleaning SVGs (Installation)

The executable for cleaning svgs can be found here. Its corresponding header can be found here.

  1. Save both files. clean-svg executable | header.txt
  2. npm install -g svgo (Installation instructions for Node can be found here.)
  3. Move both the executable and header.txt to usr/local/bin.
  4. Make the bash script executable with chmod 755 clean-svg.
  5. cd icons and then run clean-svg

Contributing Code

We have a bunch of things we'd like to include for version 1.0; feel free to take a look at everything in milestone 1 and take a crack at any of them.

thunderbird-icons's People

Contributors

nt1m avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.