<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="261579" data-post-id="261579">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="thomas.fortes" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/thomas.fortes/120/19404_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  thomas.fortes
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="jmnda" data-post="1" data-topic="50282">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/j/90db22/48.png" class="avatar"> jmnda:</div>
<blockquote>
<p>I tried to use CDN’s since configuring tailwind in my phoenix project was not working as well.</p>
</blockquote>
</aside>
<p>Can you tell us what you’re doing that isn’t working?</p>
<p>This specific tailwind CDN is a kinda of JIT but in the web (you can see that it is a script, not a stylesheet), since it generates the css on the fly and live_redirects doesn’t reload the <code>&lt;head&gt;</code> and rerun the js the cdn probably is in some weird state, if you can install tailwind we can isolate the problem.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="261579" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/tailwind-javascripts-stop-working-after-live-redirects-between-liveviews/50282/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-261579" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="261579"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="261580" data-post-id="261580">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="jmnda" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  jmnda
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I did install tailwind based on this guide <a href="https://tailwindcss.com/docs/guides/phoenix" rel="noopener nofollow ugc">Install Tailwind CSS with Phoenix</a>, then I installed Flowbite using <code>npm i flowbite --prefix assets</code>, add it to <code>tailwind.config.js</code> like this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">content: [
    './js/**/*.js',
    '../lib/*_web.ex',
    '../lib/*_web/**/*.*ex',
    './node_modules/flowbite/**/*.js'
  ],
</code></pre>
<p>then</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">plugins: [
    require('@tailwindcss/forms'),
    plugin(({ addVariant }) =&gt; addVariant('phx-no-feedback', ['&amp;.phx-no-feedback', '.phx-no-feedback &amp;'])),
    plugin(({ addVariant }) =&gt; addVariant('phx-click-loading', ['&amp;.phx-click-loading', '.phx-click-loading &amp;'])),
    plugin(({ addVariant }) =&gt; addVariant('phx-submit-loading', ['&amp;.phx-submit-loading', '.phx-submit-loading &amp;'])),
    plugin(({ addVariant }) =&gt; addVariant('phx-change-loading', ['&amp;.phx-change-loading', '.phx-change-loading &amp;'])),
    require('flowbite/plugin'),
  ]
</code></pre>
<p>and finally in <code>app.js</code></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">import 'flowbite'
import "phoenix_html"
import { Socket } from "phoenix"
import { LiveSocket } from "phoenix_live_view"
import topbar from "../vendor/topbar"
</code></pre>
<p>This was my initial config, the flowbite components were working, but when I redirect to another LiveView they stop. I decided to use CDNs just for convenience as I had to spin up a sample project t test things out, and had to share a repo as you can see from above replies.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="261580" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/tailwind-javascripts-stop-working-after-live-redirects-between-liveviews/50282/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-261580" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="261580"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="284505" data-post-id="284505">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="selimyoussry" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/selimyoussry/120/30223_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  selimyoussry
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hey all, the solution will be soon merged into Flowbite JS, see <a href="https://github.com/themesberg/flowbite/pull/487" rel="noopener nofollow ugc">Support phoenix liveview by jmnda-dev · Pull Request #487 · themesberg/flowbite (github.com)</a>.</p>
<p>I’ve pasted my patch as a PR comment if you want to get going right now.</p>
<p>Cheers</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="284505" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/tailwind-javascripts-stop-working-after-live-redirects-between-liveviews/50282/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-284505" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="284505"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>