I'm Pat, a software developer. You'll find a collection of articles I've written as well as open-source code I've worked on here.

Operating at the moment.

Settings / Attributes


<path style="fill:#656c7a;" />


<svg width="24" height="24" viewBox="0 0 24 24">


Icon Finder

SVG Icons with filtering for free usage.


Trim SVG Whitespae

Sets the viewable area to the edges of the SVG, mimicking a trim of an image. After use, saving the HTML to a file preserves the changes.

// Reference:

function trimSvgWhitespace() {
  var svgs = document.getElementsByTagName("svg");

  for (var i = 0, l = svgs.length; i < l; i++) {
    var svg = svgs[i],
      // retrieves visual boundary
      box = svg.getBBox(),
      viewBox = [box.x, box.y, box.width, box.height].join(" ");

    // set viewable area
    svg.setAttribute("viewBox", viewBox);