mail
, similarly to other features discussed in Backend-initiated actions. When the import is triggered, the front-end downloads the specified stylesheet and creates a style
element with its contents.
The import_stylesheet
method takes the stylesheet_key
and path
arguments. The first works as an identifier that will let you override the stylesheet later if needed. The second is the path to the CSS file.The path specified needs to be available to the front-end, so storing it in the /static
folder of your app is recommended.
The following code imports a stylesheet when handling an event.
/static/custom.css?3
.bubblegum
, can be found below. Note how the !important
flag is used when targetting style attributes that are configurable via the Builder. If the flag isn’t included, these declarations will not work, because built-in Framework styling is of higher specificity.
bubblegum
class, its children will also have a pink background by default.
stylesheet_key
in subsequent calls. This allows you to implement a “theme” logic if desired, targeting the whole or a specific part of your app.