WebSDK

Styling & Theming

Customize the look and feel of the FanID Widget and gated content overlays.

The widget automatically inherits your organization's branding from FanID. Every visual property is configurable via CSS custom properties.

Automatic branding

When the widget initializes, it fetches your organization's branding settings from FanID and applies them everywhere the widget renders. No configuration is needed.

FanID brand settingWidget surface
TitleFloating widget heading (falls back to <orgName> ID, then Fan ID)
Sub TitleFloating widget subtext (falls back to Sign in to access exclusive content)
LogoFloating widget brand row and gated content overlays
Primary colorSign-in button background (--fanid-primary-color, --fanid-gate-button-bg)
Accent colorText and secondary elements (--fanid-secondary-color, --fanid-gate-title-color, --fanid-gate-message-color)

Brand fields are edited in the FanID admin dashboard under Brand Settings. Changes propagate to all embeds the next time the widget initializes.

You can still override any value via CSS variables in your own stylesheet — the table below documents every property.

Floating widget styles

The floating sign-in/profile panel uses global BEM-style CSS classes. Override any of them in your own stylesheet.

Widget CSS variables

Override the floating widget's color scheme globally:

VariableDefaultUsed for
--fanid-primary-color#f26522Sign-in button, user avatar, spinner accent
--fanid-primary-color-hover#002b5cButton hover state
--fanid-secondary-color#002b5cText, close button, user name, email
:root {
  --fanid-primary-color: #e94560;
  --fanid-primary-color-hover: #c23152;
  --fanid-secondary-color: #1a1a2e;
}

Available CSS classes

ClassElement
.fanid-widgetOuter container (position, size, shadow, border-radius)
.fanid-widget__containerInner wrapper
.fanid-widget__closeClose button (top-right corner)
.fanid-widget__contentLogin state content area
.fanid-widget__brandBrand row (logo + text)
.fanid-widget__brand-labelOrganization name text
.fanid-widget__textSubtitle / description text
.fanid-widget__buttonSign-in button
.fanid-widget__content--logged-inLogged-in state content area
.fanid-widget__user-avatarUser initial avatar
.fanid-widget__user-nameDisplay name
.fanid-widget__user-emailEmail address
.fanid-widget__actionsAction buttons container
.fanid-widget__redirect-button"My profile" button
.fanid-widget__logout-buttonSign-out icon button
.fanid-widget__loadingLoading state
.fanid-widget__spinnerLoading spinner

Examples

/* Move to bottom-right */
.fanid-widget {
  top: auto;
  bottom: 16px;
  right: 16px;
}

/* Custom button */
.fanid-widget__button {
  border-radius: 4px;
  text-transform: uppercase;
}

/* Round avatar */
.fanid-widget__user-avatar {
  border-radius: 50%;
  background: #333;
}

Dark theme for floating widget

:root {
  --fanid-primary-color: #f26522;
  --fanid-primary-color-hover: #d4551a;
  --fanid-secondary-color: #e6edf3;
}

.fanid-widget {
  background: #161b22;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.fanid-widget__close {
  background: #21262d;
  color: #e6edf3;
}

.fanid-widget__redirect-button {
  color: #e6edf3;
  border-color: rgba(255, 255, 255, 0.12);
}

Gated content styles

Gated content overlays use CSS custom properties for every visual property. The internal class names are randomized at init time for ad-blocker resistance, but you never need to target them — just set the variables on the gate element, a parent, or :root.

Quick example

/* Dark theme for all gated content */
wmt-fanid-protected {
  --fanid-gate-panel-bg: #1a1a2e;
  --fanid-gate-panel-radius: 8px;
  --fanid-gate-title-color: white;
  --fanid-gate-message-color: rgba(255, 255, 255, 0.7);
  --fanid-gate-button-bg: #e94560;
  --fanid-gate-button-radius: 4px;
  --fanid-gate-overlay-bg: rgba(0, 0, 0, 0.6);
}

Complete CSS custom properties reference

Root container

VariableDefaultDescription
--fanid-gate-root-positionrelativeRoot container position
--fanid-gate-root-overflowhiddenRoot container overflow
--fanid-gate-min-height280pxMinimum height of the gated area

The gated host element also receives an inline max-height style when the maxHeight config (or data-fanid-max-height / max-height attribute) is set — see Configuration › gatedContent.maxHeight.

Overlay

VariableDefaultDescription
--fanid-gate-overlay-positionabsoluteOverlay position
--fanid-gate-overlay-inset0Overlay inset
--fanid-gate-overlay-displayflexOverlay display
--fanid-gate-overlay-alignflex-startOverlay vertical alignment (see overlayAlign config)
--fanid-gate-overlay-justifycenterOverlay horizontal alignment
--fanid-gate-overlay-padding-top24pxDistance from top of host to the prompt panel
--fanid-gate-overlay-padding-bottom24pxDistance from bottom of host to the prompt panel
--fanid-gate-overlay-z-index1Overlay z-index
--fanid-gate-overlay-bgrgba(255,255,255,0.1)Overlay background (blur mode) / #f8f9fa (cover mode)
--fanid-gate-overlay-backdropblur(2px)Overlay backdrop filter (blur mode)

Gradient layer

VariableDefaultDescription
--fanid-gate-gradient-positionabsoluteGradient layer position
--fanid-gate-gradient-inset0Gradient layer inset
--fanid-gate-gradient-pointer-eventsnoneGradient layer pointer events
--fanid-gate-gradient-bg(mode-dependent)Gradient background

Gradient mode specific

VariableDefaultDescription
--fanid-gate-overlay-align-gradientflex-endOverlay alignment in gradient mode
--fanid-gate-overlay-padding-bottom24pxOverlay bottom padding in gradient mode

Placeholder panel

VariableDefaultDescription
--fanid-gate-panel-positionrelativePanel position
--fanid-gate-panel-z-index2Panel z-index
--fanid-gate-panel-bgwhitePanel background
--fanid-gate-panel-radius12pxPanel border radius
--fanid-gate-panel-padding32px 28pxPanel padding
--fanid-gate-panel-text-aligncenterPanel text alignment
--fanid-gate-panel-max-width380pxPanel maximum width
--fanid-gate-panel-width90%Panel width
--fanid-gate-panel-shadow0 8px 32px rgba(0,0,0,0.12)Panel box shadow
--fanid-gate-fontsystem font stackPanel font family
VariableDefaultDescription
--fanid-gate-logo-height40pxLogo max height
--fanid-gate-logo-max-width160pxLogo max width
--fanid-gate-logo-fitcontainLogo object-fit
--fanid-gate-logo-margin16pxLogo bottom margin

Title

VariableDefaultDescription
--fanid-gate-title-size18pxTitle font size
--fanid-gate-title-weight700Title font weight
--fanid-gate-title-color#002b5cTitle text color
--fanid-gate-title-margin0 0 8pxTitle margin
--fanid-gate-title-line-height1.3Title line height

Message

VariableDefaultDescription
--fanid-gate-message-size14pxMessage font size
--fanid-gate-message-color#002b5cMessage text color
--fanid-gate-message-opacity0.7Message opacity
--fanid-gate-message-margin0 0 20pxMessage margin
--fanid-gate-message-line-height1.5Message line height

Button

VariableDefaultDescription
--fanid-gate-button-displayinline-flexButton display
--fanid-gate-button-aligncenterButton vertical alignment
--fanid-gate-button-justifycenterButton horizontal alignment
--fanid-gate-button-width100%Button width
--fanid-gate-button-height44pxButton height
--fanid-gate-button-padding0 20pxButton padding
--fanid-gate-button-bgorg primary / #f26522Button background
--fanid-gate-button-colorwhiteButton text color
--fanid-gate-button-bordernoneButton border
--fanid-gate-button-radius30pxButton border radius
--fanid-gate-button-size15pxButton font size
--fanid-gate-button-weight600Button font weight
--fanid-gate-button-cursorpointerButton cursor
--fanid-gate-button-transitionfilter 0.2s easeButton transition
--fanid-gate-button-fontinheritButton font family
--fanid-gate-button-hover-filterbrightness(0.9)Button hover filter
--fanid-gate-button-active-transformscale(0.98)Button active transform

Overlay host (programmatic gate)

VariableDefaultDescription
--fanid-gate-host-positionabsoluteOverlay host position
--fanid-gate-host-inset0Overlay host inset
--fanid-gate-host-z-index1Overlay host z-index

Full-page gate

VariableDefaultDescription
--fanid-gate-fullpage-positionfixedFull-page overlay position
--fanid-gate-fullpage-inset0Full-page overlay inset
--fanid-gate-fullpage-z-index999998Full-page overlay z-index
--fanid-gate-fullpage-displayflexFull-page overlay display
--fanid-gate-fullpage-aligncenterFull-page overlay vertical alignment
--fanid-gate-fullpage-justifycenterFull-page overlay horizontal alignment
--fanid-gate-fullpage-bgrgba(255,255,255,0.85)Full-page overlay background
--fanid-gate-fullpage-backdropblur(4px)Full-page overlay backdrop filter
--fanid-gate-fullpage-panel-pointer-eventsautoFull-page panel pointer events

Close button (full-page)

VariableDefaultDescription
--fanid-gate-close-positionabsoluteClose button position
--fanid-gate-close-top12pxClose button top offset
--fanid-gate-close-right16pxClose button right offset
--fanid-gate-close-bgnoneClose button background
--fanid-gate-close-bordernoneClose button border
--fanid-gate-close-size28pxClose button font size
--fanid-gate-close-cursorpointerClose button cursor
--fanid-gate-close-color#002b5cClose button color
--fanid-gate-close-opacity0.5Close button opacity
--fanid-gate-close-transitionopacity 0.2sClose button transition
--fanid-gate-close-line-height1Close button line height
--fanid-gate-close-hover-opacity1Close button hover opacity

Content (gated state)

VariableDefaultDescription
--fanid-gate-content-filterblur(8px)Content blur filter (blur mode)
--fanid-gate-content-user-selectnoneContent user-select when gated
--fanid-gate-content-pointer-eventsnoneContent pointer-events when gated
--fanid-gate-content-cover-opacity0Content opacity (cover mode)
--fanid-gate-content-cover-height0Content height (cover mode)
--fanid-gate-content-cover-overflowhiddenContent overflow (cover mode)

Reveal animation

VariableDefaultDescription
--fanid-gate-reveal-animationfade 0.3s / slide 0.4sReveal animation

Theming examples

Dark theme

wmt-fanid-protected,
[data-fanid-gated] {
  --fanid-gate-panel-bg: #161b22;
  --fanid-gate-panel-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --fanid-gate-title-color: #e6edf3;
  --fanid-gate-message-color: #8b949e;
  --fanid-gate-message-opacity: 1;
  --fanid-gate-button-bg: #f26522;
  --fanid-gate-overlay-bg: rgba(0, 0, 0, 0.6);
}

Minimal / flat

wmt-fanid-protected {
  --fanid-gate-panel-shadow: none;
  --fanid-gate-panel-radius: 0;
  --fanid-gate-panel-padding: 24px;
  --fanid-gate-button-radius: 4px;
  --fanid-gate-button-height: 36px;
  --fanid-gate-button-size: 13px;
}

Centered large panel

wmt-fanid-protected {
  --fanid-gate-panel-max-width: 500px;
  --fanid-gate-panel-padding: 48px 40px;
  --fanid-gate-title-size: 24px;
  --fanid-gate-message-size: 16px;
  --fanid-gate-button-height: 52px;
  --fanid-gate-button-size: 17px;
}

Per-element override

<wmt-fanid-protected style="--fanid-gate-panel-bg: #fff3e0; --fanid-gate-button-bg: #ff9800;">
  <p>This specific block has a warm theme.</p>
</wmt-fanid-protected>

Hiding the floating widget

Disable the floating panel at init and show it programmatically when needed:

FanIDWidget.init({
  baseUrl: 'https://your-org.fanid.co',
  floatingWidget: false,
})

// Show it later (e.g., on a button click)
FanIDWidget.showFloatingWidget()

// Hide it at any time
FanIDWidget.hideFloatingWidget()

Auth state, gated content, and the JavaScript API all continue to work without the floating panel.

Copyright © 2026