-
Notifications
You must be signed in to change notification settings - Fork 42
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
Adapt spriting syntax/features to match transforms.processImages #34
Comments
In doing this refactoring I think we should rename the commands. If we're not in CSS domain any more the prefix can go. Also I think a sprite group is the base trigger for if an image is a part of a sprite or not, so that's the most common use case. We should drop the '-group' part to make it more easily accessible. So my suggestion is Also I think we should introduce a new sprite group. A global sprite group. One that things will go into if no specific group is mentioned. That enables the following syntax: |
Post processing a spriteThis requires a bit more thought. We could make it chainable through cgi-params, like has already been done in the image post processing with the order being significant. But we are going to run into trouble because post processing the sprite sheet itself is going to pull in post processing instructions from a number of different images. In the worst case this will cause a conflict in settings and/or a post processing step that was unintended for the rest of the images in the sprite sheet. I think we need to find a way to define a post processing step of sprite sheets outside the image url's. Maybe stick to the concept of vendor prefixed css properties for defining a specific sprite sheets options. In that case the only sprite related cgi param would be the sprite group name. And the configuration and post processing would be handled somewhere else. A CSS block maybe? |
Yeah, pretty much. I'm not sure there's much left, except the 2nd bullet:
... which probably isn't that interesting anyway. |
Postprocessing a sprite is still a bit ugly. You have to do something like this: .foo {
-sprite-selector-for-group: theGroup;
-sprite-location: url(?pngquant=128);
background: red !important; /* optional, will be preserved */
}
.bar {
background-image: url(bar.png?sprite=theGroup);
} But I wasn't able to come up with something better. The only really ugly part is the |
Well, it is what it is. Open a new issue if you have a good idea about how to get rid of the |
I have no new ideas on this. I think we've improved on the common use case. Post processing a sprite sheet other than the default optimizations, which we do anyway, doesn't seem to be that big of a use case. |
…ls when source asset has a file: url. Fixes #34.
-ag-sprite-group
into a GET parameter so that different images mentioned in the same CSS rule can be added to different sprites<img src="foo.png?sprite=abc">
⇒<img src="blank.png" style="background-image:url(sprite.png);background-position: ...">
The text was updated successfully, but these errors were encountered: