LogoLogo
Siteglide.comAdminRoadmap
  • ๐Ÿ‘‹Welcome
  • Get Started
    • ๐Ÿš€Quickstart Guides
    • โ”Support & FAQs
      • โ„น๏ธSiteglide Support Policy
      • โ„น๏ธSiteglide Technology Stack
      • โ„น๏ธExternal Resources
      • โ„น๏ธFront-end Browser Support
  • Portal
    • Account
    • Sites
      • ๐Ÿš€Quickstart: Create a Site
      • โ„น๏ธSite Details
      • โ„น๏ธSite Users
      • ๐Ÿ“‹Install & Manage Modules
      • ๐Ÿ’ณGo Live
      • ๐Ÿ’ณSubscription
      • ๐ŸŒDomains
        • ๐Ÿ“‹Add a Fully Delegated Domain
        • ๐Ÿ“‹Add an External Domain
        • ๐Ÿ’ปSubdomain on a separate instance
        • ๐Ÿ“‹How to setup a multi domain start page
      • โ˜๏ธSite Backups and Disaster Recovery
    • Users
      • ๐Ÿ“‹User Roles
      • ๐Ÿ“‹Invite & Manage Users
    • Billing
      • ๐Ÿ’ณBilling Setup
      • ๐Ÿ’ณSubscriptions and Changes
      • ๐Ÿ’ณAutomatic Site Upgrades
      • ๐Ÿ’ณInvoices
    • Tickets
    • Marketplace
    • Agencies
      • ๐Ÿ‘ฉโ€๐Ÿ’ปAgency Account
      • ๐Ÿ‘ฉโ€๐Ÿ’ปClients
      • ๐Ÿ‘ฉโ€๐Ÿ’ปSite Copies
      • ๐Ÿ‘ฉโ€๐Ÿ’ปAgency Whitelabelling
  • Developer Tools
    • CLI
      • ๐Ÿš€Quickstart: CLI
      • โ„น๏ธAbout
      • ๐Ÿ“‹Site Setup
      • โ”Troubleshooting
      • ๐Ÿ’ปReference
      • ๐Ÿ›ณ๏ธCLI Changelog
      • ๐Ÿง™โ€โ™‚๏ธGo Further: CLI
        • Creating WebApps via CLI
    • Liquid
      • โ„น๏ธAbout
      • ๐Ÿ’ปReference
      • Accessing Data in Liquid Variables - Tutorial 1 - Using Dot Notation
      • Accessing Data in Liquid Variables - Tutorial 2 - Iterating over Arrays and Objects
      • Using Collections with WebApps and Modules
      • Accessing Data from the Global Context Variable
      • Truthiness - Using Liquid to determine if a field is empty or blank
      • ๐Ÿ“‹Alternatives to Storing and Executing Liquid from Database Items
    • GraphQL
      • โ„น๏ธAbout GraphQL
      • ๐Ÿ“‹Tutorials
        • Tutorial 1 - Your First Query
        • Tutorial 2 - Pagination
        • Tutorial 3 - Filtering the Results
        • Tutorial 3 - (Answers)
        • Tutorial 4 - Advanced Filtering
        • Tutorial 4 - (Answers)
        • Tutorial 5 - Using Liquid to run GraphQL queries on your Site
        • Tutorial 6 - Variables
        • Tutorial 6 - (Answers)
        • Tutorial 7 - Sorting
        • Tutorial 8 - Building a Liquid API GET Endpoint Page powered by GraphQL queries
        • Tutorial 9 - Using Mutations to Create New Records
        • Tutorial 10 - Using Mutations to Edit a Record
        • Tutorial 11 - Using Mutations to Delete an Item
        • Tutorial 12 - Related Records and Datasources
    • Configuration
      • โ„น๏ธField Types
      • โ„น๏ธCustom Field IDs
    • Zapier Integration
      • โ„น๏ธFormatting arrays correctly
    • Developer Marketplace
      • โ„น๏ธAbout Building Modules
      • โ„น๏ธModule Setup
      • โ„น๏ธSite Template Modules - and How to Make Your Own
      • โ„น๏ธCreate Folder Structure
      • โ„น๏ธUpdating Modules
      • โ„น๏ธSubmit Module for Approval
      • โ„น๏ธAdding Payment to a Module
      • โ„น๏ธTheme Module Example
      • โ„น๏ธData & UI Module Example
      • ๐Ÿ’ปReference
      • ๐ŸŒณFile Structure
    • Release Notes
      • ๐Ÿ›ณ๏ธSiteglide Admin/API - Changelog
      • ๐Ÿ›ณ๏ธModule - System Files - Changelog
      • ๐Ÿ›ณ๏ธModule - eCommerce - Changelog
      • ๐Ÿ›ณ๏ธModule - Menu - Changelog
      • ๐Ÿ›ณ๏ธModule - Slider - Changelog
      • ๐Ÿ›ณ๏ธModule - Secure Zones - Changelog
      • ๐Ÿ›ณ๏ธModule - FAQ - Changelog
      • ๐Ÿ›ณ๏ธModule - Events - Changelog
      • ๐Ÿ›ณ๏ธModule - Blog - Changelog
  • SiteBuilder
    • Build Sites Faster
      • ๐Ÿš€Quickstart: SiteBuilder
      • About
      • Site Setup
        • ๐Ÿ—๏ธMarketplace Themes & Templates
        • ๐Ÿ—๏ธCreate Site From Template
        • ๐Ÿ—๏ธInstall SiteBuilder Module
        • ๐Ÿ—๏ธCreate a Page Template
        • ๐Ÿ—๏ธSet Up Tailwind CSS with the recommended CLI method
      • Styling
        • ๐Ÿ—๏ธEditing Tailwind CSS using the recommended CLI method
        • ๐Ÿ—๏ธTailwind CSS Themes - Choosing a Build Method
        • ๐Ÿ—๏ธTailwind CSS - Preview Mode
        • ๐Ÿ—๏ธTailwind's JIT Compiler Via CDN (deprecated)
        • ๐Ÿ—๏ธTheme Presets
        • ๐Ÿ—๏ธExample Tailwind Project Setup
      • Layouts
        • ๐Ÿ—๏ธInsert Static Layouts
        • ๐Ÿ—๏ธInstalling Dynamic Layouts
        • ๐Ÿ—๏ธEditing Dynamic Layouts
        • About Layouts
          • ๐Ÿ—๏ธDynamic Layouts
          • ๐Ÿ—๏ธStatic and Dynamic Form Layouts
          • ๐Ÿ—๏ธSliders
      • ๐Ÿ’ปReference
    • Advanced Features
      • ๐ŸงžSiteBuilder Live Updates API
        • ๐Ÿ‘€Live Updates Reference
        • ๐Ÿ”นLive Updates Markup Example
        • ๐Ÿ“‹Steps to Setting Up Live Updates API in a Module/WebApp Layout
        • ๐Ÿ”นLive Updates Example - Enforcing Filters
        • ๐Ÿ“‹Steps to Use Live Updates Methods
        • ๐Ÿ“‹Steps to Initialise Live Updates with JS
        • ๐Ÿ—“๏ธLive Updates Changelog
      • โ„น๏ธSiteBuilder JavaScript
        • โ„น๏ธForms JS
        • โ„น๏ธSocial Sharing JS
        • โ„น๏ธSliders JS
        • โ„น๏ธDark Mode JS
        • โ„น๏ธCookie Settings JS
      • โ„น๏ธSiteBuilder Liquid Includes
        • โ„น๏ธPagination
      • โ„น๏ธSiteBuilder Liquid Functions
        • โ„น๏ธDetail Page Valid
        • โ„น๏ธField Mapping
        • โ„น๏ธGet Table Config
        • โ„น๏ธCase From Order ID
      • ๐Ÿ—“๏ธSiteBuilder Changelog
    • Extend SiteBuilder
      • โ„น๏ธCreate SiteBuilder Themes
      • โ„น๏ธCreate Marketplace Modules
      • โ„น๏ธAdding Dynamic Layouts to Themes & Modules
      • โ„น๏ธAdding Static Layouts to your Theme
      • ๐Ÿ’ปReference
  • CMS
    • Dashboard
    • Pages
      • ๐Ÿš€Quickstart: Pages
      • ๐ŸŽจStudio (Alpha Release)
        • ๐ŸŽจSetup
        • ๐ŸŽจCreate a Page
      • โ„น๏ธEditor (Legacy Studio)
      • โ„น๏ธCode View & Toolbox
      • โ„น๏ธAbout Pages
        • โ„น๏ธPage Settings
        • โ„น๏ธCustom Fields in Pages
        • โ„น๏ธPages with Siteglide CLI
      • โ„น๏ธAbout Page Templates
        • โ„น๏ธPage Templates with Siteglide CLI
        • Preventing Duplicate Content
      • โ„น๏ธSystem Pages
      • ๐Ÿ’ปReference
      • ๐ŸŒณFile Structure
    • Content Sections
    • File Manager
      • ๐Ÿ”นAbout Assets
      • ๐Ÿ”นLinking to Assets Explained
      • ๐Ÿ”งAssets Troubleshooting
      • ๐Ÿ”นSiteglide Scripts Explained
      • ๐Ÿ’ปAssets with CLI
      • ๐Ÿ”ผMigrating Assets
      • ๐Ÿ“‹Steps to Optimise Images on the Fly with Cloudinary
      • ๐Ÿ”นsiteglide_head_scripts and siteglide_footer_scripts Explained
      • ๐ŸŒณAssets File Structure
      • ๐Ÿ‘€Tags for Assets
    • Forms
      • Quickstart: Forms
      • โ„น๏ธAbout Forms
      • ๐Ÿ“‹Guides: Forms
        • ๐Ÿ“‹Steps to Using Separate Fields for First Name and Surname in a Form
        • ๐Ÿ“‹Steps to Programmatically Redirecting after a Form Submission
        • ๐Ÿ“‹Steps to Adding Form Confirmation Pages
        • ๐Ÿ“‹Steps to Adding a Progress Bar
        • ๐Ÿ“‹Steps to Changing Form Styling on Submission Using CSS
        • ๐Ÿ“‹Steps to Using Custom Field Set fields in a Form's Custom Layout
      • ๐Ÿง™โ€โ™‚๏ธGo Further: Forms
        • โ„น๏ธMigrating Forms
        • โ„น๏ธExplained - Preventing Spam Form Submissions and Captchas
        • โ„น๏ธExplained - Show Clearly When a User is Already Logged in When Submitting a Form
        • โ„น๏ธForms Error Callback and Validation
        • โ„น๏ธForms Success Callback
        • โ„น๏ธFile Upload Previews
      • ๐ŸŒณForms File Structure
      • ๐Ÿ’ปReference
      • โ”Troubleshooting
    • Automations
      • ๐Ÿš€Quickstart: Automations
      • โ„น๏ธAbout
        • โ„น๏ธEmail Templates
        • โ„น๏ธEmail Automations and Email Templates with Siteglide CLI
      • ๐Ÿ“‹Guides
        • โ„น๏ธIntegration Automations
        • โ„น๏ธA Transactional Email Example
        • โ„น๏ธAn API Call Action Example
        • โ„น๏ธA Custom Liquid Action Example
        • ๐Ÿ“‹Steps to Testing Emails on a Staging Site
        • ๐Ÿ“‹Steps to Authenticating Sendgrid Emails on Live Sites
      • ๐Ÿง™โ€โ™‚๏ธGo Further
      • ๐Ÿ’ปReference
      • ๐ŸŒณFile Structure
    • Categories
      • ๐Ÿš€Quickstart: Categories
      • โ„น๏ธAbout
        • โ„น๏ธOutputting Categories on WebApp / Module / eCommerce Layouts
        • โ„น๏ธFiltering WebApps and Modules by Categories Using Liquid Parameters
      • ๐ŸŒณFile Structure
      • ๐Ÿ’ปReference
    • Company Information
      • โ„น๏ธAbout
      • ๐Ÿ’ปReference
      • โ”Troubleshooting
    • URL Redirects
  • Modules
    • Core Modules
      • MenuBuilder
        • ๐Ÿš€Quickstart: Menu Builder
        • โ„น๏ธAbout
      • Secure Zones
        • ๐Ÿš€Quickstart: Secure Zones
        • โ„น๏ธAbout
          • ๐Ÿ“‹Dynamically Assign a Secure Zone during Form Submission
        • ๐Ÿง™โ€โ™‚๏ธGo Further
          • โ„น๏ธSecure Zones with Siteglide CLI
          • โ„น๏ธUsing the context.current_user object
      • Media Downloads
        • ๐Ÿš€Quickstart: Media Downloads
        • โ„น๏ธLayouts
        • ๐Ÿ’ปReference
      • Blog & Authors
        • ๐Ÿš€Quickstart: Blog & Authors
        • ๐Ÿ”นBlog Archive & Date Filtering
        • ๐Ÿ”นBlog Search
        • ๐Ÿ”นBlog Filter by Category
        • ๐Ÿ”นBlog Filter by Author
        • ๐ŸŒณFile Structure
        • ๐Ÿ’ปReference
      • Events
        • ๐Ÿš€Quickstart: Events
        • โ„น๏ธStandard List View
        • โ„น๏ธGetting Started with Event Filtering & Searching
        • โ„น๏ธFilter by Category
        • โ„น๏ธFilter By Host (Author)
        • โ„น๏ธFilter by Event Dates
        • โ„น๏ธDatasourcing the Event Host
        • โ„น๏ธSearch
        • โ„น๏ธMap List View
        • โ„น๏ธCalendar List View
      • FAQ
        • ๐Ÿš€Quickstart: FAQ
        • ๐Ÿ’ปReference
      • Testimonials
        • ๐Ÿš€Quickstart: Testimonials
        • ๐Ÿ’ปReference
      • Slider
        • ๐Ÿš€Quickstart: Slider
        • ๐Ÿ’ปReference: Slider
    • Community Modules
      • ๐Ÿ—๏ธSiteBuilder
      • ๐Ÿš€CRM Sync
        • โ„น๏ธAbout CRM Sync Module
        • ๐Ÿ“‹Steps to Set Up CRM Sync on an Automation
        • ๐Ÿ—“๏ธCRM Sync Changelog
    • Go Further: Modules
      • โ„น๏ธFront-end Submit Modules
  • WebApps
    • ๐Ÿš€Quickstart: WebApps
    • WebApp Items
      • ๐Ÿ“‹Create WebApp Items
      • ๐Ÿ“‹Importing and Exporting
    • Layouts
      • โ„น๏ธWebApp List Layout
      • โ„น๏ธWebApp Detail Layouts
    • Go Further: WebApps
      • ๐Ÿ“‹Searching by Location
      • ๐Ÿ“‹Searching - Advanced Filtering
      • ๐Ÿ“‹Searching - By Keyword
      • ๐Ÿ“‹Front End Create Forms
      • ๐Ÿ“‹Front End Update Forms
      • ๐Ÿ“‹Front End Delete
  • WebApp Troubleshooting
  • eCommerce
    • ๐Ÿš€Quickstart: eCommerce
    • Get Started
      • ๐Ÿ’กAbout the eCommerce Module
      • Settings
      • ๐Ÿ“‚Cart, Checkout and Quotes
        • ๐Ÿ’กAbout Cart, Checkout and Quotes
        • ๐Ÿ“‹Steps to Implement a Guest Checkout Flow
        • ๐Ÿ“‚Product Views
          • ๐Ÿ”นProduct Layouts
          • ๐Ÿ”นProduct List Layout
          • ๐Ÿ”นProduct Detail Layout
          • ๐Ÿ”นAdd to Cart Button
          • ๐Ÿ“‹Steps to Datasource and Display Related Products
          • ๐Ÿ”นDynamic Product Layouts based on Categories
          • ๐Ÿ“‚Attribute Selection
            • ๐Ÿ”นAttribute Layout - Presenting the Choice to the Customer
            • ๐Ÿ”นAttributes - Changing Product Price after Change
          • ๐Ÿ“‚Discount Selection
            • Discount Codes Layout
            • Minimum Payments
          • ๐Ÿ“‚Shipping Selection
            • Shipping Options Layout
        • Managing Products
          • Creating and Editing
          • Securing Products
          • Location
          • Custom Fields
          • Edit Module Structure
          • Product Custom Field Sets
          • Inventory
          • Managing Attributes
          • Pricing
          • Product Categories
          • Open Graph Fields
          • SEO Fields
          • Standard Fields
          • Product Import and Export
          • Discounts
        • ๐Ÿ“‚Cart
          • ๐Ÿ”นCart Layouts
          • Checking Inventory in Cart
          • Updating Quantity in Cart
          • Updating Displayed Cart Quantity
        • ๐Ÿ“‹How to Set Up a Shopping Cart and Guest Checkout - Tutorial
        • ๐Ÿ“‚Checkout Forms
          • ๐Ÿ”นCheckout Form Layouts
          • ๐Ÿ”นCheckout Forms with PayPal
        • ๐Ÿ“‚Orders
          • Order Confirmation
          • Re-Ordering
          • ๐Ÿ”นOrders Layouts
        • ๐Ÿ“‹Steps to Add Secure Zones and User Orders View to your Checkout Flow
        • Quotes
        • Selling Digital Products
        • ๐Ÿ”นVolume Pricing
        • ๐Ÿ“‹Steps - Alternatives to Product Grouping
      • ๐Ÿ“‚Basic Payment Forms
        • ๐Ÿ’กAbout Basic Payment Forms
        • ๐Ÿ“‹Steps to Set up a Basic Payment Form (with a Fixed Payment Amount)
        • ๐Ÿ“‹Authorize.net Basic Payment Forms
        • ๐Ÿ“‹PayPal Basic Payment Forms
        • ๐Ÿ“‹Steps to Allow User to Decide Amount they Will Pay
        • ๐Ÿ“‹Step-by-step Basic Payment Confirmations
        • ๐Ÿ‘€Basic Payment Forms Reference
        • โ„น๏ธecommerce/basic_payment
      • ๐Ÿ“‚Payment Gateways
        • ๐Ÿ’ปBuilding a Custom Payment Gateway
          • ๐Ÿ“‹Steps to Support Basic Payment Forms with your Custom Payment Gateway
          • ๐Ÿ“‹Steps to Support Checkout with your Custom Payment Gateway
        • ๐Ÿ”นPaypal Custom Parameters
        • ๐Ÿ”นStyling Stripe Card Elements
        • ๐Ÿ’กAbout Payment Gateways
        • ๐Ÿ“‹Steps to Switching Payment Gateway
        • ๐Ÿ”นTest Cards
      • ๐Ÿ“‚Currency and Tax
        • ๐Ÿ’กAbout Tax Codes
        • Currency Changer
        • Tax Code Changer
        • Formatting Currency
      • ๐Ÿ“‚Subscriptions
        • ๐Ÿ’กAbout Subscriptions
        • Managing Subscriptions
          • Creating Subscription Products
          • Changing Price and Billing Interval
          • Creating a Form for Signing Up and Changing Payment Details
          • Subscription Order Status Explained
          • Terms and Conditions (Good Practice)
        • ๐Ÿ“‹Subscriptions Payment Gateway Setup
        • Subscriptions List Layout
        • Subscriptions Detail Layout
        • User's Active Subscriptions
        • Subscription Action Required
        • Cancelling Subscriptions
      • ๐ŸŒณBasic Payment Forms Folder Structure
      • ๐ŸŒณCart and Checkout Folder Structure
  • CRM
    • ๐Ÿš€Quickstart: CRM
    • Users
      • User Details
      • User Secure Zones
      • How Users Edit their Email and Password Front End
      • Custom Field Sets & CRM Custom Fields
      • Storing User's Favourite WebApp / Module Items
    • Companies
    • Cases
      • User's Form Submissions (Cases)
  • Site Manager
    • Code Editor
    • Templates (Pages & Email)
    • Headers & Footers
    • Code Snippets (Includes)
      • ๐Ÿ”งIncludes Troubleshooting
      • ๐Ÿ‘€constants_json
      • ๐Ÿ‘€constants
      • ๐ŸŒณIncludes File Structure
      • ๐Ÿ’ปIncludes with Siteglide CLI
      • ๐Ÿ”งTags for Includes
    • System Pages
      • Automatic Site Maps
    • System Emails
    • Data Management
    • Admin Menu Editor
    • Integrations
  • Reporting
    • ๐Ÿš€Quickstart: Reports
  • Miscellaneous
    • System Features
      • Pagination on Liquid Tags
      • Custom Pagination Layouts
      • Timezones in the Siteglide Admin and on the front-end of your Site
      • Module/WebApp Caching
      • Getting Started with Liquid Caching - to Reduce Server Response time and Improve Performance
      • Translating Dates
      • Site Search
      • About Site Search
      • AI Tools for the Rich Text Editor
      • Cookies on Siteglide Sites
    • Front-End Performance
      • Video Embeds
      • Forms Above the Fold
Powered by GitBook
On this page
  • Before you Start
  • Introduction
  • Quick Start
  • How to Theme your JIT Tailwind CSS
  • Getting Ready for Production - Performance and Caching
  • Making Changes After Turning On Caching
  • Safelisting Classes Which Are Added Via User Interaction

Was this helpful?

Export as PDF
  1. SiteBuilder
  2. Build Sites Faster
  3. Styling

Tailwind's JIT Compiler Via CDN (deprecated)

PreviousTailwind CSS - Preview ModeNextTheme Presets

Last updated 5 months ago

Was this helpful?

Before you Start

This is a deprecated feature - not recommended for Production

  • Check first to choose which option suits you best.

Introduction

A quick way to use Tailwind from within the Siteglide Admin

With special thanks to the folks at Beyond Code, weโ€™ve adapted their to optimise it for the Siteglide Admin and the SiteBuilder libraries. We've also added caching for better performance. Later in this article, we may abbreviate the name of this tool to "the JIT Compiler" or simply "JIT".

Quick Start

  1. Switch to JIT Mode in SiteBuilder Tailwind Settings

    Enter the Module Admin and Scroll past the libraries to the Tailwind Settings Card and click the gear icon.

    Tailwind Settings

    Then select โ€œJITโ€.

    JIT
  2. Create a Page Template

    for your Library using SiteBuilder and add it to the Pages you're working on in the Siteglide Admin.

    And that's it; you're ready to start work! When your Page is loaded in the browser a new inline <style> tag will be created including all the Tailwind classes your page needs.

    Next, learn more about how the JIT compiler works by reading the rest of this article, including:

    • Where to theme and configure your Tailwind Build

    • Using caching to boost performance and how to update the cache when you make changes.

    • How to handle classes which show conditionally e.g. on user-interaction or after JavaScript events.

How to Theme your JIT Tailwind CSS

The JIT Compiler uses a version of the Tailwind Config file that lies within <script> tags in the <head> of the page, inside the Page Template. This is because the JIT method runs in the browser and wouldn't be able to access the standard tailwind-config.js file on the root of a project.

You can edit the config file for the JIT method at the following default path in code editor: modules/module_86/layouts/tailwind/jit_tailwind_config_v4_0_0. This path can be changed in the Page Template by adding the optional_path_to_jit_config parameter to our Tailwind Liquid tag (using the platformOS format for partial paths)[https://documentation.platformos.com/developer-guide/pages/reusing-code-across-multiple-pages#step-2-include-the-partial]:

{% include 'modules/module_86/tailwind/head', optional_path_to_jit_config: 'tailwind/custom_config_file' %}

On page rendering, this will be inserted into a <script> tag in the Page Template. For older versions of SiteBuilder the config could be edited directly in the Page Template.

By default, we set up the Tailwind config file the way the library youโ€™re using recommends in its documentation.

Getting Ready for Production - Performance and Caching

Wait! My web pages are loading really slowly!

Thereโ€™s another setting in the Tailwind Settings menu in SiteBuilder called Cache CSS.

Just In Time Tailwind Compilation is designed to be convenient for Developers. A developer adds new code to their site containing new Tailwind classes and those classes are instantly added to the CSS on the page. However, this convenience would normally come at a cost: the work being done by the JavaScript would slow the page down.

In production however, there is no need to rebuild the CSS on every page reload, we only need to do this after an update has been made.

Turning caching on in your Tailwind Settings menu turns on caching for Tailwind CSS across the site. The CSS is saved (base64 encoded) in your pagesโ€™ metadata once generated and when the page is loaded, the server will generate a <style> tag based on that at the top of the document.

With caching on, the page will load lightning fast. Furthermore, since we optimise the CSS for that page only, it only needs to contain the clases on that page, rather than the entire site, so could even have speed advantages against an ordinary CLI Tailwind build.

Making Changes After Turning On Caching

After this, the page will load slowly for the developer once while this is calculated, but then the CSS against the pageโ€™s metadata will be updated and everyone else will experience the newly improved page at fast speeds.

Safelisting Classes Which Are Added Via User Interaction

What if my page shows different content depending on user-interaction, or depending on the userโ€™s session? For example a button which either shows โ€œloginโ€ or โ€œlogoutโ€ depending on the situation?

In this case, you may find that the content which changes is missing vital CSS because the Tailwind was only generated for the initial state the components were in.

Since the CDN runs after Liquid has rendered, this includes any classes which sit inside a Liquid if statement, as well as any JavaScript or XHR requests which might add classes to the DOM after initial page load.

Alternatively, you may wish to consider using the JIT mode for quick development now for convenience and then switching to a CLI build when the site goes live for reliability.

Since the JIT Tailwind Compiler uses Tailwind version 2.0, you can use most of the configuration options from that version of Tailwind. See here:

However, there are some exceptions, for example plugins which work a little differently. See the BeyondCode teamโ€™s blog for details:

Caching Turned On

If you add new Tailwind classes to a page, you can regenerate that pageโ€™s Tailwind by adding the query parameter ?tailwind=regenerate at the end of the URL. (see for details).

Adding URL parameters to regenerate the Tailwind CSS

One option is to add classes to the safelist in your Tailwind Congfig file:

Safelisting

Another possibility, if you find that your site has a lot of user-interaction and your safelist is getting quite long, might be that your site is better suited to a instead!

๐Ÿ—๏ธ
Tailwind CSS Version 2.0 Documentation
Beyond Code Blog - Tailwind's JIT Compiler Via CDN
URL Search Parameters
https://v2.tailwindcss.com/docs/optimizing-for-production#safelisting-specific-classes
Using the Tailwind CLI with Siteglide
Choosing a Build Method
open-source Tailwinds JIT compiler via CDN
Create a Page Template