.ai/principles/distilled/frontend-style.md
Prerequisite: If you haven't already, also read .ai/principles/distilled/frontend-vue.md - it contains foundational rules that apply to all frontend work.
common.scss that use non-design-system values.gl--prefixed Tailwind classes (e.g., gl-mt-5, gl-text-subtle).@apply in SCSS only when utility classes cannot be applied directly in HTML; prefer it for design-system-dependent properties (e.g., margin, padding).tailwind.defaults.js in GitLab UI when a needed utility is not available, rather than writing custom CSS..button, .alert) over domain-centered names (e.g., .security-report-widget).max-lg:gl-mt-3 as the default).@max-*:gl-hidden on components instead of gl-hidden + overriding display on larger containers, to avoid assuming the component's internal display value.@apply gl-mt-3 @lg:gl-mt-5 pattern in SCSS component classes for responsive styles.scripts/frontend/migrate_to_container_queries.mjs when migrating existing media queries to container queries.@apply with design token classes (e.g., gl-text-subtle) for dark mode color support.page_bundles stylesheets.snake_case for SCSS filenames.lowercase-hyphenated format for CSS class names (not snake_case or camelCase).& concatenation (e.g., &-name); write out full class names.js- for styling purposes.gl-mb-5) as selectors in stylesheets.[aria-expanded=false]) for styling; use state classes like .is-collapsed instead.@extend at-rule (causes memory leaks and does not work as intended).yarn lint:stylelint to check for style guide violations before submitting.gl-text-700-fixed) used outside of Markdown contextsFor the full picture, see: