Skip to content

AB#671 - Inline @hsl-fi/design-system-core styles instead of leaving them as a passthrough import - #5901

Merged
vesameskanen merged 1 commit into
v3from
traffic-now-theme-fixes
Aug 7, 2026
Merged

AB#671 - Inline @hsl-fi/design-system-core styles instead of leaving them as a passthrough import#5901
vesameskanen merged 1 commit into
v3from
traffic-now-theme-fixes

Conversation

@VillePihlava

@VillePihlava VillePihlava commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

  • Fixes font-weight not working correctly with themes

AI summary:

Root cause:
sass/_main.scss  imported  @hsl-fi/design-system-core/css/styles.css  with an explicit  .css  extension. Dart Sass leaves  .css -suffixed imports as literal passthroughs instead of inlining them, so webpack's  splitChunks  picked it up as its own module (resolved under  node_modules/@hsl-fi/ ) and extracted it into the shared  digitransit-components.css  chunk — which loads after each theme's own CSS in the HTML. Since  @hsl-fi/design-system-core@2.7.1  added  --font-weight-medium: 500 / --font-weight-book  to that stylesheet, it silently overrode every non-HSL theme's correct value sitewide (HSL coincidentally used 500 already, so it looked fine there).

Fix:
dropped the  .css  extension so Sass inlines the file directly into  sass/_main.scss , before  base/helper-mixins  (which sets each theme's real value) — restoring correct cascade order within a single file.

Verified:
stylelint clean, 52/52 trafficnow tests pass, and a real production build ( CONFIG=oulu ) confirms  --font-weight-medium  now resolves to 600 in the theme bundle, is gone from the shared chunk, and all other design-system-core tokens (colors/shadows) remain intact.

@vesameskanen
vesameskanen merged commit d95c6c1 into v3 Aug 7, 2026
7 checks passed
@vesameskanen
vesameskanen deleted the traffic-now-theme-fixes branch August 7, 2026 05:48
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.

2 participants