-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support for Custom DOM Injection Targets #12
Comments
The external window case is a bit different. Prior to using shadow-dom I had to manually copy |
Very cool! I didn't know re-frame-10x was using spade, and I definitely wasn't familiar with these use-cases. I think the other use-case that it'd be nice to support is server-side rendering, but I don't have any projects doing that so am even less familiar with exactly what would be required. Here's some initial ideas I had after glancing at this:
The tricky part is providing the |
Spade is a powerful mechanism for integrating Garden styling. We're also going to use it to do the internal styling implementation of re-com in day8/re-com#284 So thanks for Spade @dhleong ! If the |
In fact, I think it may enable this! I haven't tested this at all, but I have a terrible idea for a solution for React/Reagent, based on this. The key is that
Non-React(ive) contexts should be able to use (let [shadow-dom ...]
(react-dom/render [spade-dom shadow-dom [app]] shadow-dom])) What do you think? |
See #14 for my first pass PR. Please let me know if this looks like it will suit your needs! |
* Refactor to support a dynamic "style container" to render CSS into See #12 * Fix factory fn name extraction in non-jvm context * Fix incorrect namespace reference * Fix missing spade.runtime ns reference in JVM context * Implement React Context-based IStyleContainer-providing solution * Refactor IStyleContainer and its implementations out of the runtime ns `runtime` is more of an "implementation detail" ns, so things that clients might reasonably want to access shouldn't live there. * Fix old, incorrect ns reference
Sorry for the huge delay, things have been busy and I got sidetracked! A snapshot of 1.2.0 just got deployed to clojars ( |
Please support injection of
<style>
tags into custom DOM targets, not just(.-head js/document)
which is hard-coded ininject!
.There are at least two use cases for this:
For example, re-frame-10x is rendered into a shadow root then sets a
*dom*
atom in a slightly modified spade so that<style>
tags are rendered inside the shadow dom.It is not clear to me if the general solution in spade should be also global; i.e. two options would be
defclass
/defglobal
render to some custom dom set early, or default to(.-head js/document)
if not setdefclass
/defglobal
arg or meta so styles can be rendered to different dom contexts on a case by case basis if needed, or default to(.-head js/document)
if not setThe text was updated successfully, but these errors were encountered: