首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >罗盘混合文件夹-sprite(Imagename)-在不应该打印的情况下打印所有图像

罗盘混合文件夹-sprite(Imagename)-在不应该打印的情况下打印所有图像
EN

Stack Overflow用户
提问于 2014-10-29 19:44:10
回答 1查看 132关注 0票数 0

我用指南针来产生雪碧片,它神奇地把它拉下来。我的问题是,当我试图通过div {@include folder-sprite(js);}包含一个png时,它包含了整个精灵页,我该如何解决这个问题呢?任何帮助都非常感谢,谢谢:)

当前错误实现:

代码语言:javascript
复制
    sass
    $icons-layout: horizontal;
    @import "icons/*.png";
    div {@include icons-sprite(js);}

    css
    .icons-sprite, div {
     background-image: url('../images/generated/icons-s119197eae9.png');
     background-repeat: no-repeat; }

css应该加载雪碧表并自动利用background-position,但它没有

编辑:指南针config.rb

代码语言:javascript
复制
##
## This file is only needed for Compass/Sass integration. If you are not using
## Compass, you may safely ignore or delete this file.
##
## If you'd like to learn more about Sass and Compass, see the sass/README.txt
## file for more information.
##

# Default to development if environment is not set.
saved = environment
if (environment.nil?)
  environment = :development
else
  environment = saved
end

# Location of the theme's resources.
css_dir = "css"
sass_dir = "sass"
images_dir = "images"
generated_images_dir = images_dir + "/generated"
javascripts_dir = "js"

# Require any additional compass plugins installed on your system.
require 'compass-normalize'
require 'rgbapng'
require 'toolkit'
require 'breakpoint'
require 'singularitygs'
require 'susy'
require 'sass-globbing'

##
## You probably don't need to edit anything below this.
##

# You can select your preferred output style here (:expanded, :nested, :compact
# or :compressed).
output_style = (environment == :production) ? :expanded : :nested

# To enable relative paths to assets via compass helper functions. Since Drupal
# themes can be installed in multiple locations, we don't need to worry about
# the absolute path to the theme from the server omega.
relative_assets = true

# Output source maps in development mode.
sass_options = (environment == :production) ? {} : {:sourcemap => true}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-10-31 06:50:03

HTML必须将sprite name / sprite文件夹作为类,作为对该特定类的罗盘输出。至于为什么打印所有图像,原因很简单,因为我没有在指定的类上设置宽度/高度,并且输出整个spritesheet。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26639240

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档