Add gradient Buttons to Bubble
DJ

Damian Janzi

Created Oct 17, 2021

Add gradient Buttons to Bubble

347
    b

Bubble

7 Steps
1

Enable ID attribute field

Go to Settings / General and make sure the "Expose the option to add an ID attribute to HTML elements" option is checked

Enable ID attribute field
2

Install the Classify plugin

This plugin lets you add CSS classes to your Bubble elements

Install the Classify plugin
3

Add a Button and an HTML element to your page

Add a Button and an HTML element to your page
4

Copy & past the CSS code to your HTML element

<style>

.btn-grad {

background-image: linear-gradient(to right, #1D2B64 0%, #F8CDDA 50%, #1D2B64 100%) !important;

transition: 0.5s !important;

background-size: 200% auto !important;

}

.btn-grad:hover {

background-position: right center !important;

}

</style>

If you have multiple button styles, you need to use another class name e.g. btn-grad2. Make sure to also adjust the hover pseudo e.g. class btn-grad2:hover

Copy & past the CSS code to your HTML element
5

Adjust the colors as needed

Note: the first and the 3rd color should be the same e.g.:
#1D2B64 0%, #F8CDDA 50%, #1D2B64 100%

Adjust the colors as needed
6

Add your CSS class to your Button

Add the following text to the ID attribute of your Button (not the HTML element):

{addClass: "btn-grad"}

Make sure the class name is the same you have used in the class definition in the HTML element in step 4.

Add your CSS class to your Button
7

Click on Preview and check if everything worked as intended :)

Feel free to have a look at my example setup here https://bubble.io/page?type=page&name=buttons&id=bh-examples&tab=tabs-1

Click on Preview and check if everything worked as intended :)
Well done!
Create how-to guides like this in a snap. Get Tango now.