Sprite CSS with classes too big

125 views
Skip to first unread message

Thiago Festa

unread,
May 14, 2012, 7:46:40 PM5/14/12
to compas...@googlegroups.com
Hi,

The sample at Compass Sprite documentation:

@import "my-icons/*.png";
@include all-my-icons-sprites;

It generates:
.my-icons-sprite,
.my-icons-delete,
.my-icons-edit,
.my-icons-new,
.my-icons-save   { background: url('/images/my-icons-s34fe0604ab.png') no-repeat; }

.my-icons-delete { background-position: 0 0; }
.my-icons-edit   { background-position: 0 -32px; }
.my-icons-new    { background-position: 0 -64px; }
.my-icons-save   { background-position: 0 -96px; }

But I want generate this way:
.my-icons-sprite { background: url('/images/my-icons-s34fe0604ab.png') no-repeat; }

.my-icons-delete { background-position: 0 0; }
.my-icons-edit   { background-position: 0 -32px; }
.my-icons-new    { background-position: 0 -64px; }
.my-icons-save   { background-position: 0 -96px; }

I have many sprites and it is making my CSS file too big, since it generates to much text (css classes).

Is there a configuration for that?

Thanks

Chris Eppstein

unread,
Jun 5, 2012, 1:26:44 PM6/5/12
to compas...@googlegroups.com
You need to run:

compass sprite --skip-overrides "my-icons/*.png"

Then edit the generated file to your liking and import that file instead of importing the "*.png" magic import.

Chris

--
You received this message because you are subscribed to the Google Groups "Compass" group.
To view this discussion on the web visit https://groups.google.com/d/msg/compass-users/-/o74f7zKfdQgJ.
To post to this group, send email to compas...@googlegroups.com.
To unsubscribe from this group, send email to compass-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/compass-users?hl=en.

Reply all
Reply to author
Forward
0 new messages