Getting ready

To make this recipe work, you will need to include the SCSS code from the preceding recipe. The reason for this is that the previous recipe already specifies the custom button classes used in this recipe too (classes of btn-tomato, btn-green, and btn-purple).

An alternative approach would be to use Bootstrap's default buttons, but if you choose to do it this way, bear in mind that you will need to change the references to btn-tomato, btn-green, and btn-purple in the following code to any of the default Bootstrap button classes, such as btn-primary, btn-info, and so on.

Get Bootstrap 4 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.