Fork me on GitHub
#hoplon
<
2016-06-26
>
adamw03:06:10

oh man, now I know why there is no much 'bind-in' going on in the code.

adamw03:06:49

Anyway, thanks @jumblerg and @micha. Ok so one other question: the (image* code contains a lot of set elements: `(bind-in! img [.-style .-display] :block) (bind-in! img [.-style .-position] :relative) (bind-in! img [.-style .-width] "100%") (bind-in! img [.-style .-height] :initial) (bind-in! img [.-src] url) (bind-in! e [in .-style .-position] :absolute) (bind-in! e [in .-style .-top] 0) (bind-in! e [in .-style .-width] "100%")))))''' Is there a good reason or just to get the image in quickly? Or should I force (say height & width) by forcing max-width & max-height on a parent elem?

adamw03:06:55

(bind-in! img [.-style .-display]   :block)
        (bind-in! img [.-style .-position]  :relative)
        (bind-in! img [.-style .-width]     "100%")
        (bind-in! img [.-style .-height]    :initial)
        (bind-in! img [.-src]               url)
        (bind-in! e [in .-style .-position] :absolute)
        (bind-in! e [in .-style .-top]      0)
        (bind-in! e [in .-style .-width]    "100%")))))

jumblerg20:06:47

@adamw: this was an experiment to see if we could have an image elem capable of conforming to the shape of the image itself while allowing it to parent children

jumblerg20:06:57

to explain, i’ve been trying to avoid introducing other positioning schemes (fixed, absolute, and relative models) because they make the composition of the elements more difficult. they also make responsive layouts more challenging since they don’t flow left to right with the other inline elems.

jumblerg20:06:54

however, consider the case where you need an overlay on an image

jumblerg20:06:47

maybe the overlay is :w (r 1 1) so it will span the width of that image

jumblerg20:06:23

but you also want the elem parentng the overlay to get its width from the size of the image itself

jumblerg20:06:15

this enables that. however, it also breaks vertical alignment, as i haven’t figured out a way to get :av :bottom to work properly on it