-
Notifications
You must be signed in to change notification settings - Fork 2
Stylesheet configuration
This document explains how stylesheets are organized and managed in the SignalWire documentation platform.
Our documentation uses three types of stylesheets with different purposes:
- Core Stylesheets - Foundation styles that define the site's visual identity and base variables
- Customization Stylesheets - Feature and component-specific styles that control how content is presented
- Plugin Stylesheets - Specialized styles for third-party and custom plugins
These stylesheets are using the SCSS file format. SCSS is a preprocessor that allows us to write more efficient and maintainable CSS. SCSS is enabled by utilizing the Docusaurus Sass plugin.
These files establish the fundamental visual framework of the site.
Core stylesheets are organized in the root /src/css/
directory:
src/css/
├── common.scss
├── signalwire.scss
└── neue-einstellung.scss
The central configuration file that establishes the site's visual foundation. Any global variables or base styles that need to be accessed throughout the platform & plugins should be defined here.
Manages SignalWire's visual identity throughout the platform. This file ensures brand consistency across all components and features of the documentation. This file makes it easy to change the brand colors, fonts, etc.
Handles all aspects of the custom font implementation to ensure consistent typography across the platform.
These files handle specific features and components of the documentation platform. This is where you can change the colors, fonts, etc. for specific components & JSX elements.
Located in /src/css/customizations/
:
customizations/
├── articles.scss
├── markdown.scss
├── site.scss
└── index.scss
Manages the visual presentation of all documentation content, ensuring consistent and readable article layouts throughout the platform.
Provides a collection of utility classes that content authors can use directly in markdown files to maintain consistent styling patterns.
Controls the overall layout and navigation structure of the documentation platform, handling how users interact with and move through the documentation.
Specialized styles for plugin integration and customization. Each plugin that requires custom styling should have its own stylesheet file to maintain separation of concerns and ensure styles don't conflict with the core platform.
Located in /src/css/customizations/plugins/
:
plugins/
├── index.scss # Main entry point for all plugin styles
└── plugin_name.scss # Individual plugin styles
Plugin stylesheets allow for custom styling of third-party and custom plugins while maintaining consistency with the platform's design language. These styles ensure that plugin components integrate seamlessly with the rest of the documentation platform.
When a plugin needs custom styling:
-
Create a new file in the plugins directory following the naming convention:
_plugin_name.scss
-
Import it in the plugins index file:
// plugins/index.scss @import "./_plugin_name";
This modular approach allows for:
- Easy addition and removal of plugin styles
- Clear separation of plugin-specific styling
- Maintainable and scalable plugin customization
Styles are processed in this order to ensure proper cascade and specificity:
-
Core Processing
- Global variables and foundations
- Brand identity elements
- Typography system
-
Customization Processing
- Component-specific styles
- Layout structures
- Utility classes
-
Plugin Processing
- Plugin-specific customizations
- Component overrides
- Special features
-
File Organization
- Group related styles together
- Follow the established file structure
- Maintain clear dependencies
-
Style Management
- Use variables for consistency
- Follow naming conventions
- Keep styles modular
-
Documentation
- Document style purposes
- Explain complex patterns
- Note dependencies
When debugging style issues:
-
Core Style Issues
- Check variable definitions
- Verify import order
- Review cascade order
-
Customization Issues
- Verify style scope
- Check class specificity
- Review media queries
-
Plugin Style Issues
- Check plugin version compatibility
- Verify style overrides
- Review plugin documentation