Skip to content

Commit

Permalink
🐛 Complete CSS-build was included in components.css bundle (#3427)
Browse files Browse the repository at this point in the history
* 🐛 Complete CSS-build was included in components bundle

* Update .changeset/thick-tools-behave.md

Co-authored-by: Halvor Haugan <[email protected]>

---------

Co-authored-by: Halvor Haugan <[email protected]>
  • Loading branch information
KenAJoh and HalvorHaugan authored Dec 6, 2024
1 parent 0189bd7 commit 5dedfa1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/thick-tools-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-css": patch
---

CSS: Resolved regression where the complete stylesheet was included in scoped 'components.css' file.
8 changes: 7 additions & 1 deletion @navikt/core/css/config/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ async function bundleComponents() {
const css = fs.readFileSync(indexSrc);

/* Remove @charset, baseline */
const cssString = css.toString().split("\n").slice(2).join("\n");
const cssString = css
.toString()
.split("\n")
.filter((line) => {
return line.startsWith("@import") && !line.includes("baseline");
})
.join("\n");

const result = await postcss([cssImports, combineSelectors]).process(
cssString,
Expand Down

0 comments on commit 5dedfa1

Please sign in to comment.