Skip to content

Commit 6a079d5

Browse files
committed
update to @gouvfr/dsfr 1.10
1 parent 9014b31 commit 6a079d5

File tree

3 files changed

+33
-5
lines changed

3 files changed

+33
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"@babel/core": "^7.20.2",
6767
"@emotion/react": "^11.10.4",
6868
"@emotion/styled": "^11.10.4",
69-
"@gouvfr/dsfr": "1.9.3",
69+
"@gouvfr/dsfr": "1.10.0",
7070
"@mui/icons-material": "^5.11.16",
7171
"@mui/material": "^5.13.3",
7272
"@storybook/addon-a11y": "^6.5.16",

scripts/build/build.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,34 @@ import { patchCssForMui } from "./patchCssForMui";
3434
"recursive": true
3535
});
3636

37+
//Hack for @gouvfr/dsfr v1.10
38+
for (const basename of ["dsfr.css", "dsfr.min.css"]) {
39+
const cssFilePath = pathJoin(dsfrDirPath, basename);
40+
41+
fs.writeFileSync(
42+
cssFilePath,
43+
Buffer.from(
44+
(() => {
45+
let dsfrCssRaw = fs.readFileSync(cssFilePath).toString("utf8");
46+
47+
dsfrCssRaw = dsfrCssRaw.replace(
48+
/(\$color#2)/,
49+
"var(--background-disabled-grey)"
50+
);
51+
52+
// replace the first occurence of $color#2 by #E5E5E5
53+
dsfrCssRaw = dsfrCssRaw.replace(
54+
/(\$color#2)/,
55+
"var(--background-disabled-grey)"
56+
);
57+
58+
return dsfrCssRaw;
59+
})(),
60+
"utf8"
61+
)
62+
);
63+
}
64+
3765
const rawDsfrCssCode = fs.readFileSync(pathJoin(dsfrDirPath, "dsfr.css")).toString("utf8");
3866

3967
fs.writeFileSync(

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,10 +1394,10 @@
13941394
resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6"
13951395
integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==
13961396

1397-
"@gouvfr/dsfr@1.9.3":
1398-
version "1.9.3"
1399-
resolved "https://registry.yarnpkg.com/@gouvfr/dsfr/-/dsfr-1.9.3.tgz#289148c79566f6332cc930230742c4fe509d96f2"
1400-
integrity sha512-toPM1nvzSxPAwpLhnIgf7a/TJV0WOUa6sDqYummvMhZ9PBolFPGuD+3r8e3vg0bR5BkYxOt9hFErOPDU1tU4sQ==
1397+
"@gouvfr/dsfr@1.10.0":
1398+
version "1.10.0"
1399+
resolved "https://registry.yarnpkg.com/@gouvfr/dsfr/-/dsfr-1.10.0.tgz#a3f4939c728e35d8c9ecf06f7a62369ae46256db"
1400+
integrity sha512-fHqGCvc8jGtkX2AKRCWi9o3jf/kirP/BeeZ2FBVGwS9Oxd8KsG22xk/6Tls8nA+qPaI+2ZkZQxATBV8KlhwNhQ==
14011401

14021402
"@humanwhocodes/config-array@^0.5.0":
14031403
version "0.5.0"

0 commit comments

Comments
 (0)