The Members Portal uses Bootstrap 5.3 with SCSS customisation, CSS Modules for component-scoped styles, and CSS custom properties for runtime theming. This page explains how these layers work together and how to make changes at each level.Documentation Index
Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
Use this file to discover all available pages before exploring further.
Architecture overview
style.scss determines which layer can override which.
Folder structure
All SCSS source files live undersrc/assets/scss/:
Default colour palette
Default colours are defined in_defaults.scss using the !default flag, which means they can be overridden by any value set before the import:
_variables.scss then derives contrast colours, subtle variants, and border colours from these base values and exports them as a $theme-colors map. Bootstrap uses this map to generate CSS custom properties like --bs-primary, --bs-primary-bg-subtle, etc.
How components are styled
Components use one of three patterns (often combined):CSS Modules (scoped styles)
Component-specific styles live in a.module.scss file next to the component. Class names are locally scoped at build time so they never leak.
Bootstrap utility classes
Most layout and spacing is handled with Bootstrap 5 utility classes directly in JSX:custom/_utilities.scss with additional helpers such as fixed-pixel heights (h-40px), viewport heights (vh-100), and more.
Global SCSS (unscoped)
Some components import a plain.scss file for global styles. These affect the entire page and are typically used for animation keyframes or third-party library overrides:
Runtime branding (per-location colours)
Each location can set its own brand colours in the Nexudus dashboard. The portal loads these at runtime through a two-step process:- The client fetches
/api/scss-to-css?businessId=<id>&hash=<colorHash>. - The endpoint compiles a virtual SCSS file that overrides
$primary,$secondary, etc. before importing the fullstyle.scss. - The compiled CSS is cached in Vercel Blob storage with a hash-based filename.
- An edge function serves the cached file with CDN headers for fast delivery.
_defaults.scss uses !default, the runtime values take precedence.
Dark mode
Dark mode is controlled via thedata-bs-theme attribute on the <html> element. The _dark-mode.scss file redefines CSS custom properties when this attribute is set:
useLayoutContext hook:
localStorage and restored on load.
When writing component styles, always use CSS custom properties (
var(--bs-body-bg)) instead of hard-coded colour values. This ensures your styles work in both light and dark modes.Extending Bootstrap utilities
Custom utility classes are registered incustom/_utilities.scss using Bootstrap’s utility API. To add a new utility:
.custom-opacity-25, .custom-opacity-50, etc. with responsive variants if you add responsive: true.
Overriding Bootstrap component styles
Bootstrap component customisations live incustom/ as partial SCSS files (e.g., _buttons.scss, _card.scss). These are imported after Bootstrap core, so they can override default styles.
To adjust a Bootstrap component:
Find the right partial
Look in
src/assets/scss/custom/ for an existing file that matches the component (e.g., _buttons.scss for buttons).Adding styles to a new component
The _user.scss file
_user.scss is imported last in style.scss and is intended for project-level custom rules that don’t belong to a specific component or Bootstrap override. It currently contains helpers like .sticky-top-20, .no-select, and .disabled-component.
Add rules here when you need a global utility that doesn’t fit into Bootstrap’s utility API or a component module.
Key conventions
| Practice | Rationale |
|---|---|
| Use CSS Modules for new components | Prevents style leaking between components |
Use var(--bs-*) for colours | Ensures light/dark mode and branding compatibility |
| Never hard-code colour values in components | Runtime branding would not apply |
Put Bootstrap overrides in custom/ | Keeps overrides organized and discoverable |
Put vendor/library overrides in components/vendor/ | Separates third-party concerns from project styles |
Use !default for new SCSS variables | Allows runtime and theme-level overrides |