Embed Theming
Embed can be customized to match your brand using the theme
property. The
theme property allows you to set common styles such as the font, color and
border styles.
Overview
Embed is a composition of UI components such as a Payment Header, Content and Lists. These components can change over time and so we therefore do not support direct styling of these. The following diagram shows an example of how basic theming is applied. Embed styles are derived from the theme values you provide.
Usage
To apply a theme, embed can be passed an Object containing Theme Options.
The theme options will override the default theme.
Options
Fonts
Fonts can be customized with a valid CSS property.
Using Google Fonts
Fonts prefixed with google:
are downloaded automatically from
Google Fonts. This allows you to choose the closest
font to your brand. We recommend choosing a font with support for the weights
400
, 600
and 700
.
Colors
Colors are named semantically, for example primary
or danger
. This allows us
to update introduce new features or UI elements without explicitly requiring you
to update your theme. As an example, we may introduce a ‘Default Card’ button at
a later stage that would be based on the danger
set of colors.
Borders Widths
Borders can be set using an alias of thin
for a 1px
border width or thick
for a 2px
border width.
Radii
Radii can be set to either none
, subtle
or rounded
. These aliases
correspond to 0
, 2px
and 4px
. Setting the radii to none
will remove it
entirely.
Focus Ring
The focus ring is set using a CSS box-shadow
instead of the default browser
focus ring. It can be overridden, but we advise at least keeping a visible focus
ring for accessibility. This will override any focus styles set elsewhere in the
theme.