create-svg-size

1.1.0 • Public • Published

create-svg-size Build Status

Create an svg object with a given x/y width/height

Install

$ npm install --save create-svg-size

Usage

var size = require('create-svg-size')
 
size({x: 10, y: 20})
//=> {width: '10px', height: '20px', viewBox: '0 0 10 20'}

API

size(dimensions) -> object

dimensions

Required
Type: object

An object with x/y dimensions for the svg. The dimensions can also contain an optional responsive boolean that will set the width/height to 100% but set the viewBox appropriately.

License

MIT © Ben Drucker

Readme

Keywords

Package Sidebar

Install

npm i create-svg-size

Weekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • bendrucker