re-use of images with css offsets


I’m creating a component and decided that I would like to reuse the down icon from a select component. The way I ended up doing it was creating a label and then applying the same css as a select:

	background: transparent url("../base/common/img/sprites.png") no-repeat -5px -8px;

which seems a bit clunky. Is there a way to apply css properties to using a straight up Embedded object?



Well, nothing out of the box, if I understood your question correctly. You could always try to use the CSSInject add-on, but that’s a bit clunky as well.

Why not use the actual down icon from the theme, rather than the combined sprite image? All the source images are actually packaged inside the JAR as well. You’ll find them inside the component folders in the theme folder, e.g.:

Thanks Jouni,

Yes, I was thinking about the CSSInject route, but if you say its a bit clunky I’ll wait on that. I did not realize that the original images are part of the deployment, that helps out a lot and I’m going to do that instead.

You’re the best!