Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to return unit(rem),not fixed value(px) #35

Closed
cloudAi opened this issue Jan 8, 2015 · 2 comments
Closed

I want to return unit(rem),not fixed value(px) #35

cloudAi opened this issue Jan 8, 2015 · 2 comments

Comments

@cloudAi
Copy link

cloudAi commented Jan 8, 2015

can you update to support?

--- a/lib/spritesheet-templates.js
+++ b/lib/spritesheet-templates.js
@@ -4,6 +4,7 @@ var fs = require('fs');
var _ = require('underscore');
var mustache = require('mustache');
var jsonContentDemux = require('json-content-demux');
+var unit = 'px';

/**

  • @param {Object} params Container for parameters
    @@ -34,6 +35,9 @@ function templater(params, options) {
    options = options || {};
    var format = options.format || 'css';
    var template = templater.templates[format];

    • if(options.unit === 'rem'){
    • unit = 'rem';
    • }

    // Assert that the template exists
    assert(template, 'The templater format "' + format + '" could not be found. P
    @@ -100,7 +104,7 @@ templater.ensureOffsetAndPx = function (item) {
    // For each of the x, y, offset_x, offset_y, height, width, add a px after th
    ['x', 'y', 'offset_x', 'offset_y', 'height', 'width', 'total_height', 'total_
    if (item[key] !== undefined) {

    •  px[key] = item[key] + 'px';
      
    •  px[key] = item[key] + unit;
      
      }
      });
      };
@twolfson
Copy link
Owner

twolfson commented Jan 8, 2015

It is possible to add support but can you elaborate further on why you want this?

@twolfson
Copy link
Owner

Still no clarification from @cloudAi. Closing this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants