Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SVG and CSS are besties

SVG and CSS are besties

Best practices in preparing the SVG images used inline or in sprite images and how to easily style SVG images using CSS with a neat tip.

This is an addendum to this initial presentations: https://speakerdeck.com/olivierobert/managing-svg-images

Olivier Robert

August 15, 2018
Tweet

More Decks by Olivier Robert

Other Decks in Programming

Transcript

  1. Introduction • Best practices in preparing the SVG images used

    inline or in sprite images • Helps in getting the most benefits from using SVG images • Addendum to the presentation “Managing SVG images”
  2. SVG styling with ease • Enforce consistent naming • Enforce

    fixed width / height for all icons ◦ 32px is a good default ▪ 2x default font size (16px) ◦ Can be anything e.g. 16px, 48px • Enforce default color for all images e.g. black ◦ Consistency ◦ It does not matter which color as it will be replaced • Use SVGO to clean up SVG images
  3. Thanks! Contact Nimbl3 [email protected] 399 Sukhumvit Road, Interchange 21 Klongtoey

    nua, Wattana Bangkok 10110 28C Stanley St, Singapore 068737 20th Floor, Central Tower 28 Queen's Road Central, Hong Kong nimbl3.com