Git Product home page Git Product logo

ispriter's Issues

支持retina屏

貌似目前都是按px 1:1处理的,请问暂时是不是不支持移动设备上2x的方式,后面有没有计划支持呢

读取PNG文件不执行回调函数

这个问题倒是蛮奇怪的,我这里就没成功过,在创建文件读取流的之前我打印出图片的地址,那个文件的确是存在的,但是确不触发这个parsed的事件,代码如下

function readImageInfo(fileName, callback){
    fileName = path.join(spriteConfig.workspace, fileName);
    fs.createReadStream(fileName).pipe(new PNG())
    .on('parsed', function() {
        console.log('parsed')
        ...
    })   
    ... 
}

这里是我的配置

var spriteConfig = { 
    'workspace': './',
    'input': {
        'cssSource': './asset/css/index.css'
    },  
    'output': {
        'cssDist': './asset/css/dist/',
        'imageDist': './asset/image/sprite/'
    }   
};

渐变色兼容

    background-image: -owg-linear-gradient(top, transparent, rgba(0, 0, 0, 0.5));
    background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.5));
    background-image: -moz-linear-gradient(top, transparent, rgba(0, 0, 0, 0.5));
    background-image: -o-linear-gradient(top, transparent, rgba(0, 0, 0, 0.5));
    background-image: linear-gradient(top, transparent, rgba(0, 0, 0, 0.5));

ispriter会只保留一个background-image

关于合并图片的建议

有没有可能合并后的图片采用写定位的方式把相应链接图片合并成一个 比如:现在的方式;

div:nth-of-type(8) {width: 20px; height: 20px; background: url(./img/sprite_main_1.png) -268px -106px;}
div:nth-of-type(9) {width: 79px; height: 18px; background: url(./img/sprite_main_1.png) -84px -212px;}
div:nth-of-type(10) {width: 16px; height: 16px; background: url(./img/sprite_main_1.png) -268px -131px;}

新的方式:

div:nth-of-type(8),div:nth-of-type(9),div:nth-of-type(10) {background: url(./img/sprite_main_1.png) no-repeat;}
div:nth-of-type(8) {width: 20px; height: 20px; background-position:-268px -106px;}
div:nth-of-type(9) {width: 79px; height: 18px; background-position: -84px -212px;}
div:nth-of-type(10) {width: 16px; height: 16px; background-position: -268px -131px;}

这样会不会好一些.总觉得写一堆一样的图片链接地址有些累赘.

智能给没有设置宽高的样式增加宽高

给没有设置宽高的 style 加上图片的宽高来做为样式宽高, 不能单纯的加, 要加上智能判断:当前上下文有没有相同的 selector 已经设置过宽高, 有就不能加

gif图好像不能合

gif图好像不能合,现在只能合并png图吗?

另外,如果合并单独几个图片为一张,命令应该怎么写呢。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.