Reference app's styles from inside plugin?

Is there a way to reference to the styles of the app from a plugin?

Let’s say I’ve got a plugin that outputs <h1>, <h2>, and <p>. Instead of creating a wall of options for each type of element, is there a way to have the plugin use the styles from app on which it’s installed? Then I can tell the user that the plugin will use the styles plugin-h1 , plugin-h2 , plugin-body , etc. (edited)

I’ve tried looking through the sources/css files, but Bubble doesn’t really use css for that. It seems to add everything in the HTML itself.

Ah, it goes without saying that I’m an ogre, aka javascript semi-illiterate.

First of all, you should really be asking this question on the Plug-in Builders thread.

Second, yes you can! You can access selected styles from the properties object in the update function.

Thanks, Jonah. To clarify, what I would like to do is access these styles

Via the properties object I have some access, but it’s not to the editor’s defined styles, correct?

I would love to “surf” :man_surfing: on the work that the user has already done creating styles.

1 Like

Check the plug-in element in the editor, you can assign a style to it. You can’t see styles unassigned to an element. The app developer wouldn’t want you doing that anyways, they would want to tell the element what style they want to assign to it.

Your question is actually better phrased “Can I assign two styles to the same element?”

The answer is no- not for plug-in or default bubble elements

1 Like

And Bubble doesn’t create a CSS of the styles tab? I’ve been spelunking the Chrome developer tools trying to find it.

I don’t think that stuff is going to be just lying around on the client side. Even if it is, any changes they make to how that works will break your code. Honestly I don’t think it’s unreasonable to have different fields representing different options in your plug-in. It’s not worth the effort to find a workaround in my opinion, but that’s just me. Good luck