From fa647ebd04b337502e49e1cd9b06b546aec55b37 Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Thu, 6 Aug 2026 18:02:16 +0300 Subject: [PATCH] Inline @hsl-fi/design-system-core styles instead of leaving them as a passthrough import. --- sass/_main.scss | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sass/_main.scss b/sass/_main.scss index b5933a27b2..762ecaae62 100644 --- a/sass/_main.scss +++ b/sass/_main.scss @@ -2,7 +2,17 @@ $body-font-family: $font-family; $body-font-weight: $font-weight-medium; -@import '@hsl-fi/design-system-core/css/styles.css'; +// Note: the '.css' extension is intentionally dropped here. Dart Sass only +// leaves an '@import' as a literal, un-inlined passthrough when the path +// explicitly ends in '.css'; webpack's splitChunks then treats that +// passthrough import as its own module and, since it resolves under +// node_modules/@hsl-fi/, pulls it into the shared 'digitransit-components' +// chunk which loads *after* each theme's own CSS. That let this file's +// default '--font-weight-medium'/'--font-weight-book' values win over the +// theme-specific ones set later in this same file by base/helper-mixins. +// Importing without the extension makes Sass inline the file's contents +// here instead, so the theme override below still applies last and wins. +@import '@hsl-fi/design-system-core/css/styles'; // Apply theme specific values over standard hsl theme @import 'design-theme.css';