Skip to content

Enhancement/dev 12277#2589

Merged
adamdoe merged 8 commits intodevfrom
enhancement/DEV-12277
Feb 25, 2026
Merged

Enhancement/dev 12277#2589
adamdoe merged 8 commits intodevfrom
enhancement/DEV-12277

Conversation

@adamdoe
Copy link
Copy Markdown
Collaborator

@adamdoe adamdoe commented Feb 23, 2026

This pull request is a major refactor of the CSS architecture for the @cdc/core style system. The changes aim to modernize, simplify, and clarify the structure and ownership of styles across the monorepo. The refactor was carried out in four phases: flattening directory structures, consolidating variables, co-locating component styles, and dissolving legacy files. It also introduces Stylelint for consistent code quality. The most important changes are summarized below.

CSS architecture and directory restructuring:

  • Flattened the styles/v2/ directory structure into styles/, updating all import paths and deleting the obsolete v2/ directory. This removes unnecessary version coupling and makes import paths clearer.
  • Co-located component styles next to their React components, moving files like accordion.scss, button.scss, card.scss, and others from styles/components/ to their respective component directories. All consuming files now import styles via relative paths, and the old styles/components/ directory was deleted.

Variable system consolidation:

  • Merged SCSS variables and CSS custom properties into a single file, styles/utils/_properties.scss, and updated all imports to use this unified source of truth. This eliminates duplication and confusion between v1 and v2 variables.
  • Updated all component styles (button.scss, editor.scss, etc.) to use CSS custom properties with var(--...) instead of SCSS variables, ensuring consistency and easier theming. [1] [2] [3] [4] [5] [6] F77db3a3L1, [7] [8] [9] [10] [11] [12] [13]

Legacy file cleanup and import updates:

  • Removed dead code and legacy files, including the $theme map, .loader class, and duplicate imports in cove-main.scss. Extracted Bootstrap-compat shims and restored scoped resets to prevent style bleed.
  • Moved utility and accessibility styles to more appropriate locations, updating cross-package imports as needed. [1] [2] [3]

Component style import updates:

  • Updated all component files (Button.jsx, Card.jsx, Loading.jsx, Waiting.tsx, etc.) to import their styles from co-located paths instead of the old global styles directory. [1] [2] [3] [4]

Stylelint integration:

  • Added Stylelint configuration and GitHub Actions workflow to enforce consistent CSS/SCSS style across the monorepo, and applied automated fixes to existing files.

These changes collectively improve maintainability, clarity, and scalability of the style system, making it easier for developers to locate, update, and own styles for each component.

- Flattened the `v2/` directory structure into `styles/` for clearer import paths.
- Consolidated dual-variable system into a single source of truth in `utils/_properties.scss`.
- Co-located component styles next to their respective React components, enhancing maintainability.
- Removed legacy v1 root files and dead code, including unused styles and imports.
- Moved accessibility styles to `utils/_accessibility.scss` for better organization.
- Updated imports across components to reflect new file structure.
- Added new SCSS files for loading and waiting components in their respective directories.
@adamdoe adamdoe requested review from Viseghoh and khartco February 25, 2026 17:56
@adamdoe adamdoe merged commit d0025e4 into dev Feb 25, 2026
4 checks passed
@adamdoe adamdoe deleted the enhancement/DEV-12277 branch February 25, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant