Bubble File Manager: Generate and Replace Hosted File?

I have a .css link that is hard coded into the app – I want to make regular updates to that .css file which is hosted on bubble (in the file manager)

I am not finding an answer the following process
1 - Create a .css file that will be stored on bubble cdn
2 - Run another WF to update the contents of the .css content with new code
3 - Purge CDN if neccessary

How can I accomplish this?

The question is, why do you have a CSS file hard-coded into the app? Where is it referenced and used?

I have the css link to the file hardcoded – that way, I only need to modify the code of the .css to update the ui without needing to reload the entire app to see changes to the ui

Your CSS should probably be a dynamic data on the page then. Click the page in the element tree, find the HTML header and insert the dynamic data source of your CSS script. Then just add a section in an admin panel to update the CSS script.

1 Like

No, that is not what I am asking for, I have a specific need

Which is what? I can assure you hosting a CSS file in Bubble storage that you want to use in your Bubble app isn’t the answer.

I actually use supabase for this.

We run a whitelabel sass service. Each app has its own branding. Loading colors from bubbles db was too slow so

We store the css on supabase for its GET query speed

In the header in bubble settings I injected a code to call out to supa, grab the css, and inject it at run time. This happens incredibly quick and almost always…before the rest of our data from the bubble db loads. Items that require this css are transparent on page load and receive a color from the css to avoid flashes of 2 colors for 1 element.

This allows our cxm team to manage the supabase data via a nice airtable interface and update supabase values with the click of a button from airtable.

Then the data is consumed and applied on page load before the rest of the page.

Sounds jenky but is actually rather seamless.

1 Like

That’s interesting - GET to Supabase was quicker than GET for a data type field? Does the Supabase API call run from the client or have to go through Bubble’s server?

I have made a whitelabelled app that uses custom primary colours and the CSS is loaded instantly (from Current User’s Agency’s color where color is a HEX). There’s no flashes of the default colours because the default color is Current user’s agency color and is empty when the data is loading. Just trying to work out why that didn’t work for you.

Edit: here’s a demo with an ugly square in the top right:

CleanShot 2023-12-23 at 00.41.34

Watching the network traffic. Even with the script deferred, the data calls and loads before the rest of my calls to the db.

1 Like

@georgecollier quick question. Assuming you have set binding on the Current User’s Agency Colour, what if a bored or creative user plays around with the colour picker changing colours for a while - how would this impact WU?

Just the WU cost of changing something through auto binding. Always a risk, but not worth preventing.

This topic was automatically closed after 70 days. New replies are no longer allowed.