From 80609198a1573a440359fba20914b2a187b343b8 Mon Sep 17 00:00:00 2001 From: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Thu, 22 Oct 2026 23:46:53 -0400 Subject: [PATCH] refactor: compose shared .freshnessNote CSS instead of duplicating it GroupLinkStatus/styles.module.css and PeopleFreshness/styles.module.css carried an identical 4-line .freshnessNote rule (color, font-size, margin), already flagged as a clone by check:duplication's CSS/YAML jscpd scan. GroupLinkStatus/styles.module.css now composes the rule from PeopleFreshness/styles.module.css via CSS Modules composes:, the same pattern already used for EmptyFilterState.module.css's .clearButton (#1798) and OrgAvatar.module.css's shared .wrapper rule. MemberDirectory/styles.module.css's own .freshnessNote rule carries a different margin value and is left untouched. Signed-off-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- src/components/GroupLinkStatus/index.js | 5 +++++ src/components/GroupLinkStatus/styles.module.css | 4 +--- src/components/PeopleFreshness/styles.module.css | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/GroupLinkStatus/index.js b/src/components/GroupLinkStatus/index.js index fd6442a7..5c4d1b69 100644 --- a/src/components/GroupLinkStatus/index.js +++ b/src/components/GroupLinkStatus/index.js @@ -7,6 +7,11 @@ import styles from './styles.module.css'; * data/community-groups.json (set by `npm run check:community-group-links`). * Surfaces any group whose upstream repository is archived or unreachable so * that drift is visible on the page, not just in a CI log. + * + * `.freshnessNote`'s style composes it from + * `../PeopleFreshness/styles.module.css` (`composes: freshnessNote from + * '../PeopleFreshness/styles.module.css'`) rather than carrying its own + * identical copy of the rule. */ export default function GroupLinkStatus() { const generatedAt = formatDate(groupsData?.generatedAt); diff --git a/src/components/GroupLinkStatus/styles.module.css b/src/components/GroupLinkStatus/styles.module.css index 745deafa..a2b53af0 100644 --- a/src/components/GroupLinkStatus/styles.module.css +++ b/src/components/GroupLinkStatus/styles.module.css @@ -1,7 +1,5 @@ .freshnessNote { - color: var(--ifm-color-emphasis-700); - font-size: 0.85rem; - margin: -0.5rem 0 1.5rem; + composes: freshnessNote from '../PeopleFreshness/styles.module.css'; } .warning { diff --git a/src/components/PeopleFreshness/styles.module.css b/src/components/PeopleFreshness/styles.module.css index ccf6c98a..1e93f8d5 100644 --- a/src/components/PeopleFreshness/styles.module.css +++ b/src/components/PeopleFreshness/styles.module.css @@ -1,3 +1,6 @@ +/* Composed into GroupLinkStatus.module.css's own `.freshnessNote` + (`composes: freshnessNote from '../PeopleFreshness/styles.module.css'`) -- + keep both freshness-note styles in sync here. */ .freshnessNote { color: var(--ifm-color-emphasis-700); font-size: 0.85rem;