Skip to content

Stylesheet Modules

css/modules/

For ease of navigation and maintenance, all style elements are organized into logical groups. These modules are processed through a preprocessor and compiled into a single CSS file.

This modular approach makes the codebase more manageable by separating concerns and allowing you to quickly locate specific styling components. It also facilitates collaboration, as different team members can work on separate modules without creating conflicts.

Module Organization

The system uses SCSS preprocessing to compile these separate modules into a single optimized CSS file. This approach offers several advantages:

  • Variables and mixins can be shared across modules
  • Styles can be nested for better readability
  • Complex calculations and functions streamline development
  • Changes to one module won't impact others unexpectedly

The complete module structure is organized as follows:

css/
│
├── modules/
│   │
│   ├── align/                    # Alignment utilities
│   │   ├── _align.scss           # Alignment classes
│   │   ├── _flex.scss            # Flexbox utilities
│   │   └── _position.scss        # Positioning utilities
│   │
│   ├── bricks/                   # Holders and wrappers
│   │   ├── _cards.scss           # Cards and the card grid
│   │   ├── _contain-outdents.scss # Mixin and lists: outdents held inside cards, panels, collapsibles (Sass only)
│   │   ├── _legend.scss          # Legend rows, items and swatches
│   │   ├── _page-roles.scss      # Mixins: a surface takes back the page's roles (Sass only)
│   │   ├── _panels.scss          # Panels, panel grid and panel row
│   │   ├── _sections.scss        # Section styles
│   │   └── _stats.scss           # KPI figures: label, value, direction
│   │
│   ├── charts/                   # Chart tokens
│   │   ├── _index.scss           # --chart-*: series, text, axes, controls, tooltip
│   │   └── _roles.scss           # Mixin: chart tokens resolved again on a surface (Sass only)
│   │
│   ├── colors/                   # Color variables and palettes
│   │   ├── _base.scss            # Base colors: grays, red, green, yellow, blue
│   │   ├── _brand.scss           # Brand colors
│   │   ├── _color-classes.scss   # Mixin: the text, background and link classes of each color (Sass only)
│   │   ├── _semantic.scss        # Roles: semantic colors, signal, surface
│   │   └── _supporting.scss      # Supporting colors
│   │
│   ├── decorations/              # Visual enhancements
│   │   ├── _borders.scss         # Borders
│   │   ├── _icons.scss           # Icons
│   │   ├── _media.scss           # Images, videos, and other media styles
│   │   ├── _separators.scss      # Separators
│   │   ├── _shadows.scss         # Shadow styles
│   │   └── _skeleton.scss        # Skeleton styles
│   │
│   ├── elements/                 # Controls: plain elements inside .rd
│   │   ├── _buttons.scss         # Buttons: variants, sizes, icons, states, groups
│   │   ├── _control-face.scss    # Mixins: the face buttons and fields share (Sass only)
│   │   └── _forms.scss           # Form fields, checkbox and radio, groups, validation
│   │
│   ├── layout/                   # Layout components
│   │   ├── _containers.scss      # Content containers styles (header, main, footer)
│   │   ├── _grid.scss            # Grid system definitions
│   │   ├── _spacing.scss         # Margin and padding utilities
│   │   └── _spacing-aliases.scss # Spacing aliases for easier use
│   │
│   ├── navigation/               # Navigation components
│   │   ├── _link-look.scss       # Mixins: the link underline and hover fill (Sass only)
│   │   ├── _links.scss           # Link styles
│   │   ├── _navigation.scss      # Navigation bars styles
│   │   ├── _sidebar.scss         # Sidebar styles
│   │   ├── _tags.scss            # Topic tags
│   │   └── header/               # Site header
│   │       ├── _hamburger.scss   # Hamburger menu styles
│   │       ├── _header-container.scss # Header container
│   │       └── _search.scss      # Search panel styles
│   │
│   ├── special/                  # Special components
│   │   ├── _carousel.scss        # Image carousel
│   │   ├── _collapsible.scss     # Collapsible elements
│   │   ├── _construction.scss    # Construction notice
│   │   ├── _cookie-consent.scss  # Cookies consent
│   │   ├── _mockups.scss         # Browsers mockups
│   │   ├── _rare.scss            # Rare branding helpers
│   │   └── _web-reusable.scss    # Sticky WhatsApp button
│   │
│   ├── typography/               # Typography components
│   │   ├── _body.scss            # Paragraph and inline text styles
│   │   ├── _figures.scss         # Figures, captions and sources
│   │   ├── _font-faces.scss      # Self-hosted font faces (generated)
│   │   ├── _fonts.scss           # Font imports and definitions
│   │   ├── _headings.scss        # Heading styles
│   │   ├── _lists.scss           # List styles
│   │   ├── _notes.scss           # References and Notes
│   │   ├── _small-print.scss     # Mixins: small muted type (Sass only)
│   │   ├── _tables.scss          # Table styles
│   │   └── _text-content.scss    # Blockquotes, code blocks, etc.
│   │
│   └── utilities/                # Helper classes
│       ├── _a11y.scss            # Focus ring, skip link, visually hidden
│       ├── _breakpoints.scss     # Responsive breakpoint definitions
│       ├── _contracts.scss       # Selector lists: rules stop at an embedded chart, a link-button (Sass only)
│       ├── _display.scss         # Display and visibility helpers
│       ├── _print.scss           # Print styles
│       ├── _resets.scss          # CSS resets
│       └── _states.scss          # State classes rd-is-*
│
├── rare.scss                     # Main entry file that imports all modules
│
└── vendor/                       # Third-party styles
    └── normalize.css             # CSS normalization

    

The tree is in alphabetical order. Each folder also has an _index.scss that forwards its files in the order they load.

When adding new features, place them within the appropriate existing module rather than creating isolated stylesheets. This maintains system coherence and makes relationships between elements clear.

The main rare.scss file imports all modules in the correct order, ensuring dependencies are resolved properly during compilation. This automated build process eliminates the need to manually manage stylesheet references in your HTML.