Start here → repo root
AGENTS.md(agent entry, carries the critical rules) · routerSPEC_INDEX.md. This is anai-docs/rules/fill-in; the folder README explains generic-vs-per-language routing; the repo-wide rules digest is../RULES.md. Context-efficiency: link to canonical docs — don't duplicate them; one rule per file; defer to the linter where it enforces.
In *.style.scss / *.scss files under packages/contact-center/*/src/, express spacing, sizing,
border-radius, border-width, and box-shadow offsets in rem, not hardcoded px. Use Momentum design
tokens (var(--mds-color-theme-*)) for color instead of hex codes, and avoid hardcoding font-size /
font-weight when the Momentum Text component's type prop already controls that typography.
This repo's component styles are built on the Momentum design system, which defines its own type scale
and spacing scale in rem (root-relative units respect the user/host app's base font size; px does
not). Hardcoded px values silently drift from the design tokens and break if a host app changes its
root font size for accessibility. This was flagged in review on PR #719 (e911-modal.style.scss used
px spacing and hex colors instead of the established convention).
- Convert
pxtoremat a 16px base (e.g.8px→0.5rem,4px→0.25rem,1px→0.0625rem). See the inline// Npx to remcomments inpackages/contact-center/cc-components/src/components/task/CallControl/call-control.styles.scss. - Reference:
Incorrect (pre-fix
// from packages/contact-center/cc-components/src/components/task/CampaignErrorDialog/campaign-error-dialog.style.scss .campaign-error-dialog { width: 25rem; border-radius: 0.5rem; padding: 1rem; box-shadow: 0rem 0.25rem 0.5rem 0rem rgba(0, 0, 0, 0.16), 0rem 0rem 0.0625rem 0rem rgba(0, 0, 0, 0.16); }
e911-modal.style.scss):.e911-modal { border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); } .e911-warning-box { background-color: #fff3cd; // hardcoded hex instead of a Momentum token border: 1px solid #ffc107; } .e911-modal-title { font-size: 18px; // redundant: Text type="body-large-bold" already sets this font-weight: 600; }
- Use Momentum theme tokens for color, not hex:
var(--mds-color-theme-background-alert-warning-normal),var(--mds-color-theme-outline-warning-normal),var(--mds-color-theme-text-warning-normal),var(--mds-color-theme-text-secondary-normal),var(--mds-color-theme-text-accent-normal),var(--mds-color-theme-outline-primary-normal)(seecall-control.styles.scss,user-state.scss). - Don't set
font-size/font-weightin SCSS for text rendered through the MomentumTextcomponent — itstypeprop (e.g.type="body-large-bold") already governs typography. - Exceptions: media-query breakpoints (
@media (max-width: 600px)) and exact pixel-perfect image/SVG asset dimensions (e.g. a background-image sized to a specific icon export) may stay inpx— see the samecall-control.styles.scssfile for both cases. Don't over-apply the rule to these.
Review only. yarn test:styles runs ESLint ("test:styles": "eslint" in each package's
package.json), not a CSS/SCSS linter — there is no Stylelint config in this repo, so nothing currently
bans px or hex colors in .scss files automatically. Consider adding Stylelint with
declaration-property-unit-disallowed-list (scoped to spacing/sizing properties) and color-no-hex to
make this automatic.