BidaliDocsv1.2.0

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

KeyTypeDefaultDescription
brandColorStringBidali indigoBackground of buttons and other calls to action, ex: #35D07F
brandTextColorStringAutomaticText 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
backgroundColorStringThe theme's backgroundPage background. Cards, borders and muted surfaces are derived from it. A dark color switches the store to dark mode and overrides theme
textColorStringAutomaticBody 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 settingForces 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:

  1. backgroundColor: a dark background gives dark mode and a light one gives light mode. theme is ignored.
  2. theme: 'light' or 'dark', when no backgroundColor is set.
  3. 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, not injectedJavaScript. 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_START in flutter_inappwebview, use one.

Tips

  • Pick a brandColor with at least 3:1 contrast against the background, so buttons stand out.
  • Leave brandTextColor and textColor unset unless the automatic pick clashes with your brand. If you set them, keep at least 4.5:1 contrast so text stays readable.
  • Set backgroundColor to your app's own background so the store feels like part of your app. It also chooses light or dark mode for you.

On this page