Commit f7cb3288 by 李伟康

style(build): 格式化CSS生成规则并调整精灵图间距

- 移除了图标CSS样式中的多余换行符以优化输出格式
- 将精灵图生成器的图片间距从10调整为20像素
- 优化了CSS类名生成的代码结构
1 parent 5db63f5b
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -11,8 +11,7 @@ const spritesmithFunction = data => { ...@@ -11,8 +11,7 @@ const spritesmithFunction = data => {
.map(sprite => { .map(sprite => {
let { name, width, height, offset_x, offset_y } = sprite let { name, width, height, offset_x, offset_y } = sprite
;((width = toRpx(width)), (height = toRpx(height)), (offset_x = toRpx(offset_x)), (offset_y = toRpx(offset_y))) ;((width = toRpx(width)), (height = toRpx(height)), (offset_x = toRpx(offset_x)), (offset_y = toRpx(offset_y)))
return `.icon-${name} { width: ${width}; height: ${height}; return `.icon-${name} { width: ${width}; height: ${height};background-position: ${offset_x} ${offset_y};}`
background-position: ${offset_x} ${offset_y};}`
}) })
.join('\n') .join('\n')
// let shared = `.sprite-icon { background-image: url(${ // let shared = `.sprite-icon { background-image: url(${
...@@ -117,7 +116,7 @@ module.exports = { ...@@ -117,7 +116,7 @@ module.exports = {
}, },
// 每个图片间距 // 每个图片间距
spritesmithOptions: { spritesmithOptions: {
padding: 10 padding: 20
} }
}) })
] ]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!