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

[Request] Tailwind CSS in CMS #95

Open
CanopusFalling opened this issue Aug 25, 2023 · 5 comments
Open

[Request] Tailwind CSS in CMS #95

CanopusFalling opened this issue Aug 25, 2023 · 5 comments

Comments

@CanopusFalling
Copy link

It would be a big step up for this project if tailwind worked within the CMS, right now it works only for the styles that are compiled on build and not for any classes exclusively rendered from the database.

This would mean doing the same job that tailwind does at build using workers and I have no idea if that's even technically possible but if it is it would make the project a lot easier to modify in the CMS. Let me know if I've missed something here.

@wenbinf
Copy link
Member

wenbinf commented Aug 25, 2023

You can put tailwind cdn at /admin/settings/code-editor/?type=shared#webHeader
And customize tailwind.config there.

For example, this microfeed instance is using tailwind:
https://brand-assets.listennotes.com/

Screenshot 2023-08-25 at 1 13 15 PM

Does this work for you?

@CanopusFalling
Copy link
Author

That does work, and is a good patch solution while there is nothing else but it's explicitly not a production solution.

The Play CDN is designed for development purposes only, and is not the best choice for production.

@wenbinf
Copy link
Member

wenbinf commented Aug 25, 2023

I agree that the current approach may not be well-suited for high-traffic production websites requiring fast rendering. However, it is important to consider the typical use-cases for microfeed at this stage:

  • Simple websites with minimal traffic.
  • Scenarios where the primary user interface is through RSS/JSON feeds rather than the web UI (akin to a headless CMS).

Looking ahead, we could make it easy to integrate custom themes into existing microfeed instances. This will enable proper implementation of pre-built themes, including those based on Tailwind CSS or other frameworks.

@CanopusFalling
Copy link
Author

Incredibly valid if it's low on the priority list, are you happy to just leave the issue here and give it a low priority tag or similar? Or would you rather close it for now and open an issue with a more fleshed out idea of a styling system later on? I'd quite like the feature personally just as a quality of life improvement so when I have the time I might submit a pull request for it.

@wenbinf
Copy link
Member

wenbinf commented Aug 25, 2023

Right now, you have the option to build a Tailwind CSS bundle and place it in R2, thereby replacing the Tailwind CDN referenced in the screenshot below:
image

However, this doesn't offer an optimal developer experience :( Consider implementing a GitHub Action to automate this process for improved efficiency.

Re: this issue & future PR -

Let's keep this issue open to encourage further community input.
Contributions via PR are highly welcome :)

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

No branches or pull requests

2 participants