This document describes the modernized CSS architecture for the XtremeIdiots Portal.
The portal uses a structured SCSS-based architecture that compiles to a single minified app.css file. All styles are organized into logical modules using modern Sass 3.0 @use syntax.
Styles/
├── tokens/ # Design system variables
│ ├── _colors.scss # Color palette and CSS custom properties
│ ├── _spacing.scss # Spacing scale and component spacing
│ └── _typography.scss # Font families, sizes, weights, $stat-value-size
├── base/ # Foundation styles
│ ├── _reset.scss # CSS reset
│ ├── _base.scss # HTML element styles
│ ├── _accessibility.scss # Accessibility improvements
│ └── _animations.scss # CSS animations (fadeInRight etc.)
├── layout/ # Page structure
│ ├── _responsive.scss # Breakpoints and responsive mixins
│ ├── _navbar.scss # Top navigation bar
│ ├── _sidebar.scss # Off-canvas sidebar
│ └── _wrapper.scss # Main content wrapper
├── utilities/ # Helper classes
│ ├── _spacing.scss # Margin and padding utilities
│ ├── _flex.scss # Flexbox utilities
│ ├── _text.scss # Text alignment, colors, sizing
│ └── _zindex.scss # Z-index layering utilities
├── components/ # Reusable UI components
│ ├── _buttons.scss # Button styles + btn-xs bridge
│ ├── _cards.scss # ibox card component + float-e-margins no-op
│ ├── _tables.scss # Table styles
│ ├── _forms.scss # Form controls
│ ├── _badges.scss # Badge components
│ ├── _pagination.scss # Pagination controls
│ ├── _detail-fields.scss # Label-value display for detail pages
│ ├── _empty-state.scss # Empty state placeholder component
│ ├── _page-header.scss # Page-level heading component
│ └── _sticky-footer.scss # Sticky form footer for long pages
├── features/ # Page-specific styles
│ ├── _admin-actions.scss # Admin actions + list-filters component
│ ├── _players.scss # Players pages
│ ├── _chatlog.scss # Chat log pages
│ ├── _maps.scss # Maps pages
│ ├── _demos.scss # Demos pages
│ ├── _users.scss # User management pages
│ ├── _game-servers.scss # Game server reorder
│ ├── _map-rotations.scss # Map rotation editor
│ ├── _changelog.scss # Change log dashboard
│ └── ... # Other feature files
├── vendor/ # Third-party overrides
│ ├── _bootstrap-overrides.scss # Bootstrap customizations
│ └── _datatable-overrides.scss # DataTables + table column utilities
└── app.scss # Main entry point (imports all partials)
The SCSS files are automatically compiled during dotnet build:
dotnet build # Compiles SCSS with source mapsFor development with watch mode:
npm run watch:css # Watches for SCSS changesProduction builds compile SCSS without source maps:
dotnet build --configuration ReleaseYou can also compile SCSS manually:
npm run build:css # Production (no source maps)
npm run build:css:dev # Development (with source maps)All SCSS compiles to:
wwwroot/css/app.css- Single compiled CSS filewwwroot/css/app.css.map- Source map (development only)
The SCSS is imported in a specific order to ensure proper CSS cascade:
- Tokens - Variables and CSS custom properties
- Base - HTML element defaults
- Layout - Page structure and navigation
- Utilities - Helper classes
- Components - Reusable UI components
- Features - Page-specific styles
- Vendor - Third-party library overrides
Variables are centralized in the tokens/ directory:
// From tokens/_colors.scss
$xi-primary: #1ab394;
$xi-secondary: #293846;
// From tokens/_spacing.scss
$spacing-md: 1rem;
$ibox-margin: 25px;
// From tokens/_typography.scss
$font-family-base: "Open Sans", sans-serif;
$font-weight-semibold: 600;Use semantic breakpoint mixins from layout/_responsive.scss:
@include media-md {
// Styles for >= 768px
}
@include media-max-md {
// Styles for < 768px
}Components like the ibox card are self-contained:
// From components/_cards.scss
.ibox {
margin-bottom: $ibox-margin;
background-color: $white-bg;
border: 1px solid $border-color;
// ... more styles
}Page-specific styles are isolated in features/:
// From features/_admin-actions.scss
.admin-action-card {
transition: all 0.3s ease;
// ... admin-specific styles
}The compiled CSS is referenced in Views/Shared/_Layout.cshtml:
<environment names="Development">
<link rel="stylesheet" href="~/css/app.css" asp-append-version="true" />
</environment>
<environment names="Staging,Production">
<link rel="stylesheet" href="~/css/app.css" asp-append-version="true" />
</environment>The asp-append-version tag helper ensures proper cache busting when CSS changes.
Third-party CSS libraries are loaded separately and only overridden in vendor/ partials:
Included as external files:
- Bootstrap 5.3
- DataTables
- Font Awesome
- Toastr
Overridden in SCSS:
vendor/_bootstrap-overrides.scss- Bootstrap customizationsvendor/_datatable-overrides.scss- DataTables styling
The previous Inspinia theme (inspinia.css) has been absorbed into the structured SCSS:
- Layout styles →
layout/_navbar.scss,layout/_sidebar.scss - ibox components →
components/_cards.scss - Navigation →
layout/_sidebar.scss - Utilities →
utilities/directory
- Create a new file in
features/:Styles/features/_mypage.scss - Add feature-specific styles
- Import in
Styles/app.scss:@use 'features/mypage'; - Rebuild:
dotnet build
- Create a new file in
components/:Styles/components/_mycomponent.scss - Add reusable component styles
- Import in
Styles/app.scss:@use 'components/mycomponent'; - Rebuild:
dotnet build
- Edit variables in
tokens/_colors.scssor other token files - The changes cascade throughout the application
- Rebuild:
dotnet build
- Use variables - Always use tokens variables instead of hardcoded values
- Use mixins - Leverage responsive mixins for breakpoints
- Scope features - Keep page-specific styles in
features/ - Component reuse - Extract reusable patterns into
components/ - Avoid !important - Use proper specificity instead
- Mobile-first - Design for mobile first, enhance for desktop
- Test responsive - Always test changes across breakpoints
- Follow UI standards - See UI Standards Guide for button hierarchy, icon usage, form layout, detail-field patterns, and destructive operation gating
If SCSS doesn't compile on build:
# Install/reinstall npm dependencies
npm install
# Manually compile to check for errors
npm run build:css:devIf changes aren't reflected:
- Clear browser cache (Ctrl+F5)
- Rebuild the project:
dotnet clean && dotnet build - Check that
app.csstimestamp is current
SCSS compilation may show informational warnings that don't affect functionality. These are kept up-to-date with the latest Sass best practices.