Skip to content
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

[12.x] Use compiled Tailwind styles for the Health Check Page #52608

Closed
wants to merge 1 commit into from

Conversation

caendesilva
Copy link
Contributor

Abstract

Since the Tailwind Play CDN is not supposed to be used in production, and I don't expect this view to change, this PR uses the compiled styles inline, like in the Welcome page. While this does mean the bundle size is a bit bigger, it reduces the need for a bunch of extra network requests.

Updating

If changes are made to the view, here is how I "compiled" the styles, and how it can be reproduced.

  1. Remove the inline styles
  2. Add back the original script:
    <script src="https://cdn.tailwindcss.com"></script>
    
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    fontFamily: {
                        sans: ['Figtree', 'ui-sans-serif', 'system-ui', 'sans-serif', "Apple Color Emoji", "Segoe UI Emoji"],
                    }
                }
            }
        }
    </script>
  3. Render the page in a browser, use inspect element to copy the generated styles, and paste those into the view.

@Wulfheart
Copy link

I really like the idea. I am not a maintainer of this project, however, wouldn't it be better to have an automatic build pipeline for this?

@caendesilva
Copy link
Contributor Author

I really like the idea. I am not a maintainer of this project, however, wouldn't it be better to have an automatic build pipeline for this?

Usually, yes. But I looked at some previous PRs regarding this page, and since Taylor really wants to keep this page simple I don't see it being updated often enough to warrant the complexity of a build pipeline.

@taylorotwell
Copy link
Member

I think using the CDN is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants