Skip to main content
Swagger
All documentation pages

Custom CSS

This guide explains how to write custom CSS for the SwaggerHub Portal consumer interface, covering the selector API, property allowlist, dark mode, cascade behavior, and known limitations.

Overview

Portal admins can apply custom CSS to the consumer-facing portal from Settings → Appearance → Custom CSS.

CSS is written in the editor, validated server-side, and injected into every page of the consumer portal. Custom CSS can change colors, typography, borders, shadows, and spacing of named portal components. It cannot restructure layout, load external fonts directly, or target arbitrary DOM elements. The various sections of the guide are as follows:

  1. Token Variable and Generic Component Classes

  2. Selector API

  3. Property Allowlist and Dark mode

  4. Cascade behaviour

  5. Best Practices and Limitations

  6. Accessibility and quick-start template

Was this page helpful?