npm.io
1.1.0 • Published 10 years ago

create-svg-size

Licence
MIT
Version
1.1.0
Deps
1
Vulns
0
Weekly
0
Stars
1

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

Keywords