Add Tailwind Pre-flight and Custom CSS <link> Options

When using a Theme which contains a pre-compiled external Tailwind CSS file in the <head> partial, there is an edge case undesirable behaviour that the Play CDN default version of Tailwind it uses re-runs Tailwind Preflight, which can overwrite certain styles which have already been set by the first Tailwind file.

In this example, font-size set by the main external CSS file is overwritten by the PlayCDN’s version of Tailwind, even though no font-size is explicitly set in Play CDN, because of pre-flight browser normalisation. Since the initial external Tailwind file already handled this, it doesn’t need setting again.


Suggested Solution:

1. We should give users an option to disable Tailwind pre-flight on the play CDN in their theme settings.

https://tailwindcss.com/docs/preflight#disabling-preflight
2. We should create an alternative theme setting (with associated file behind the scenes) for storing external CSS files for the Theme, parallel to “custom_css” which is currently just for raw CSS text, not external links. This would give finer control over the load order, allowing someone to load external CSS links after Play CDN has run, giving higher specificity to the external file.


Please authenticate to join the conversation.

Upvoters
Status

Planned

Board
🎨

Studio

Date

4 months ago

Author

Matt Jones

Subscribe to post

Get notified by email when there are changes.