Theming
Match the gift card store to your app's colors
You can set the store's brand color, button text, background and body text, and choose light or dark. Theming uses the same bidaliProvider keys in every SDK, whether you embed the store in React Native, Flutter, Ionic React or a web view of your own. Every key is optional.
Pick your colors below to see them on the live store, then copy the generated keys into your bidaliProvider.
Background of buttons and other calls to action.
Text on buttons. Auto picks white or near-black for contrast.
Page background. A dark color switches to dark mode.
Body text. Auto keeps the theme’s text color when it’s readable.
Used when no background color is set.
Preview
window.bidaliProvider = { // name, key, paymentCurrencies, onPaymentRequest, …};Keys
| Key | Type | Default | Description |
|---|---|---|---|
brandColor | String | Bidali indigo | Background of buttons and other calls to action, ex: #35D07F |
brandTextColor | String | Automatic | Text on buttons. When unset, it is white if that reaches 4.5:1 contrast against brandColor. Otherwise it is near-black or white, whichever contrasts more |
backgroundColor | String | The theme's background | Page background. Cards, borders and muted surfaces are derived from it. A dark color switches the store to dark mode and overrides theme |
textColor | String | Automatic | Body text. When unset, it is the theme's own text color if that reaches 4.5:1 contrast against the background. Otherwise it is near-black or white, whichever contrasts more |
theme | 'light' | 'dark' | The user's system setting | Forces light or dark mode. Only used when backgroundColor is not set |
Colors must be hex values in the form #rgb or #rrggbb. Anything else is ignored.
Light and dark
The store picks light or dark mode in this order:
backgroundColor: a dark background gives dark mode and a light one gives light mode.themeis ignored.theme:'light'or'dark', when nobackgroundColoris set.- The user's system setting, when neither is set.
Inject at document start
The store reads window.bidaliProvider before it first paints, so your colors show from the first frame. That only works if the provider is on the page before the store's own scripts run. A provider injected after load still works, but users see the default colors first.
- React Native: use
injectedJavaScriptBeforeContentLoaded, notinjectedJavaScript. See Step 2. - Ionic React: use
preShowScriptInjectionTime: 'documentStart'. See Step 2. - Flutter: inject as the page starts loading, as in Step 2. If your WebView plugin supports document-start user scripts, such as
UserScriptInjectionTime.AT_DOCUMENT_STARTinflutter_inappwebview, use one.
Tips
- Pick a
brandColorwith at least 3:1 contrast against the background, so buttons stand out. - Leave
brandTextColorandtextColorunset unless the automatic pick clashes with your brand. If you set them, keep at least 4.5:1 contrast so text stays readable. - Set
backgroundColorto your app's own background so the store feels like part of your app. It also chooses light or dark mode for you.