Skip to content

Stylesheets Overview

Stylesheets are CSS files that apply across your community pages, independent of individual widgets. Use them for shared design tokens, component styles, custom fonts, or any sitewide theming that shouldn't live inside a single widget.

How Stylesheets Work

Each stylesheet you declare in the stylesheets array of extensions_registry.json becomes a <link rel="stylesheet"> tag injected into every matching page of your community. The platform publishes the file from your repository (or loads it from an external URL) and inserts the tag at the location you choose.

Stylesheets vs Widget Styles

AspectWidget stylesGlobal stylesheet
ScopeInside the widget's Shadow DOMThe whole page
ReachOnly affects the widget's own markupAffects every element on matching pages
IsolationIsolated from the page by Shadow DOMRuns directly against page HTML
Use casesA single component's appearanceSitewide theming, fonts, design tokens, cross-page overrides

Widget styles are scoped and isolated. Global stylesheets reach the whole page and every widget on it — including the community's own built-in elements.

Where Stylesheets Load

Stylesheets are injected at one of three locations, controlled by the placement field:

PlacementLocationUse case
head (default)Inside <head>Fonts, critical styles, anything that must apply before content renders
bodyStartStart of <body>Stylesheets that depend on the DOM starting to load
bodyEndEnd of <body>Non-critical styles loaded after page content

Repository-Hosted vs External

Each stylesheet has a path field. Two shapes are supported:

  • Repository path (e.g. stylesheets/theme/style.css) — the file lives in your repository and the platform publishes it.
  • External URL (e.g. https://fonts.example.com/inter.css) — the tag loads directly from that URL. The platform does not fetch or publish it.

Conditional Loading

By default, a stylesheet loads on every page of your community. Use the rules field to load a stylesheet only when the current page matches conditions like a specific page type, locale, or authenticated user. See Page Targeting for the full rule language.

Next Steps

Gainsight CC Developer Portal