-
Notifications
You must be signed in to change notification settings - Fork 24
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
Support require
on tailwind config
#151
Labels
area:visual-editor
Impacts Page Visual Editor (Visual Page Builder)
roadmap
Priority issues that will be released in the short term
Milestone
Comments
26 tasks
leandrocp
added
the
area:visual-editor
Impacts Page Visual Editor (Visual Page Builder)
label
May 9, 2024
leandrocp
added
the
roadmap
Priority issues that will be released in the short term
label
May 24, 2024
Closed it by mistake |
Summary of today:
|
Proof and example BeaconCMS/beacon_demo@d903e61 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area:visual-editor
Impacts Page Visual Editor (Visual Page Builder)
roadmap
Priority issues that will be released in the short term
The Visual Page Builder has built-in Tailwind integration with custom configuration per site, which means we have to dynamically load the tailwind config in order to apply the styles in the visual editor so every customization like fonts, colors, and others must match what the user see on the preview.
Since tailwind is a node package we're using https://github.com/mhsdesign/jit-browser-tailwindcss to mock some APIs to make it work on the browser, ie: whenever the user change something in the page builder it will compile the stylesheet again.
This is done at
beacon_live_admin/assets/svelte/components/PageWrapper.svelte
Line 26 in e466a84
The
tailwind
object is instantiated with a tailwind config:beacon_live_admin/assets/svelte/components/PageWrapper.svelte
Line 21 in e466a84
The whole Page Builder is a Svelte application running inside a LiveView so that
tailwindConfig
is actually provided by the backend as a string.That works fine for simple use cases but the problem is that we can't require modules (plugins) inside the config, ie: we can't call this in the config module:
That breaks due to the async dynamic loading mechanism we use:
beacon_live_admin/assets/svelte/components/PageWrapper.svelte
Lines 16 to 19 in e466a84
Ref #111 (comment)
The text was updated successfully, but these errors were encountered: