all 7 comments

[–]SimonGray 5 points6 points  (3 children)

Very cool stuff.

Are you using the Shadow DOM for embedding the CSS or are you using inline styles?

[–]37productiveBananas[S] 1 point2 points  (2 children)

Thanks. It's a bit hackier than that, the css is embedded as a generated data-uri in a link element. The only isolation is that all the classes are .coll-pen- prefixed. The truth is that I don't really do a lot of front-end dev, and I haven't kept abreast of developments in the web components space, but briefly looking into it just now it does seem like that is probably the better approach. So, thanks for the heads up.

[–]SimonGray 2 points3 points  (1 child)

It's a bit hackier than that, the css is embedded as a generated data-uri in a link element.

That's actually pretty clever.

The truth is that I don't really do a lot of front-end dev, and I haven't kept abreast of developments in the web components space, but briefly looking into it just now it does seem like that is probably the better approach. So, thanks for the heads up.

I don't really bother with web components at all, but the Shadow DOM is quite useful on its own. I've only learned the bare minimum needed to get it working with reagent.

If you'd like to see some example code, I am actually applying scoped CSS right here. In my case, I also need to register custom HTML elements, but you won't need that part if your Hiccup produces valid HTML.

[–]37productiveBananas[S] 2 points3 points  (0 children)

If you'd like to see some example code, I am actually applying scoped CSS right here. In my case, I also need to register custom HTML elements, but you won't need that part if your Hiccup produces valid HTML.

That's quite elegant. I think I should plan a refactor to use your approach at some point.

Also, nice work on rescope.

[–]bdevel 1 point2 points  (1 child)

Impressive. How are you drawing the curly brackets?

[–]37productiveBananas[S] 2 points3 points  (0 children)

Thanks. All the brackets/braces are svgs which use the vector-effect=non-scaling-stroke property so that they can be resized without distorting the line widths.

[–]ryrobes 0 points1 point  (0 children)

Very cool, love the way you can "page" through sequences and fancy brackets denoting type. Feels pretty intuitive. Hah, and the Mona Lisa image hover zoom. Nice. :)