Is there possibility to include image in css file? #5

Closed
pfk-beta opened this Issue Sep 18, 2012 · 7 comments

Comments

Projects
None yet
4 participants
@pfk-beta
Contributor

pfk-beta commented Sep 18, 2012

No description provided.

@imsky

This comment has been minimized.

Show comment Hide comment
@imsky

imsky Sep 18, 2012

Owner

Can you give an example of how you'd want this to work?

Owner

imsky commented Sep 18, 2012

Can you give an example of how you'd want this to work?

@pfk-beta

This comment has been minimized.

Show comment Hide comment
@pfk-beta

pfk-beta Sep 18, 2012

Contributor

I placed in css something like this:
background-image: url('holder.js/200x300');
Then Holder checks all element in DOM, in searching css atribute background-image. If found, it changes it. And I'm wondering whether is it worthwhile.

Contributor

pfk-beta commented Sep 18, 2012

I placed in css something like this:
background-image: url('holder.js/200x300');
Then Holder checks all element in DOM, in searching css atribute background-image. If found, it changes it. And I'm wondering whether is it worthwhile.

@imsky

This comment has been minimized.

Show comment Hide comment
@imsky

imsky Sep 18, 2012

Owner

It's an interesting idea, though it requires a fair amount of additional processing. I'll see if I can get this into 1.4.

Owner

imsky commented Sep 18, 2012

It's an interesting idea, though it requires a fair amount of additional processing. I'll see if I can get this into 1.4.

@timiles

This comment has been minimized.

Show comment Hide comment
@timiles

timiles Sep 19, 2012

I need this too - in the meantime, I have worked around this with custom js (requires jQuery):

            var backgroundImageContainer = $("<div>").attr("id", <some_unique_id>).addClass("hidden");
            $("body").append(backgroundImageContainer);
            Holder.add_image("holder.js?200x200", "#" + backgroundImageContainer.attr("id")).run();
            $(<my_element_selector>).css("background-image", "url(" + $("img", backgroundImageContainer).attr("src") + ")");
            backgroundImageContainer.remove();

timiles commented Sep 19, 2012

I need this too - in the meantime, I have worked around this with custom js (requires jQuery):

            var backgroundImageContainer = $("<div>").attr("id", <some_unique_id>).addClass("hidden");
            $("body").append(backgroundImageContainer);
            Holder.add_image("holder.js?200x200", "#" + backgroundImageContainer.attr("id")).run();
            $(<my_element_selector>).css("background-image", "url(" + $("img", backgroundImageContainer).attr("src") + ")");
            backgroundImageContainer.remove();
@jasperkennis

This comment has been minimized.

Show comment Hide comment
@jasperkennis

jasperkennis Sep 23, 2012

Compass allows for inline images to be declared right into the css. I don't know how it works, but it might be of help to have a look in te the source if the proposed functionality is to be included into holder.

Compass allows for inline images to be declared right into the css. I don't know how it works, but it might be of help to have a look in te the source if the proposed functionality is to be included into holder.

@imsky

This comment has been minimized.

Show comment Hide comment
@imsky

imsky Sep 23, 2012

Owner

@jasperkennis Compass encodes the image file using Base64 and embeds it using the data URI scheme. To mirror the same functionality, Holder would need to parse CSS, which at this stage would be unnecessary. I've already tested the CSS placeholder approach, it works, and will be included in 1.4 as soon as possible.

Owner

imsky commented Sep 23, 2012

@jasperkennis Compass encodes the image file using Base64 and embeds it using the data URI scheme. To mirror the same functionality, Holder would need to parse CSS, which at this stage would be unnecessary. I've already tested the CSS placeholder approach, it works, and will be included in 1.4 as soon as possible.

@imsky imsky closed this in 653b358 Sep 29, 2012

@imsky

This comment has been minimized.

Show comment Hide comment
@imsky

imsky Sep 29, 2012

Owner
Owner

imsky commented Sep 29, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment