@@ -2,13 +2,9 @@ import { it, expect } from "vitest";
22import { generateIconsRawCssCode } from "../../../../src/bin/css_to_ts/icons" ;
33
44it ( "Successfully css with only used icons" , ( ) => {
5- const rawCssCode = `
6- [target=_blank]::after {
7- flex: 0 0 auto;
8- }
9-
10- [target=_blank][class^=fr-icon-]::after,
11- [target=_blank][class*=" fr-icon-"]::after,
5+ const patchedRawCssCodeForCompatWithRemixIcon = `
6+ [target=_blank][class^=ri-]::after,
7+ [target=_blank][class*=" ri-"]::after,
128[target=_blank][class^=fr-fi-]::after,
139[target=_blank][class*=" fr-fi-"]::after {
1410 flex: 0 0 auto;
@@ -26,19 +22,14 @@ it("Successfully css with only used icons", () => {
2622 margin-left: 0.25rem;
2723}
2824
29- .fr-icon--xs::before,
30- .fr-icon--xs::after {
31- --icon-size: 0.75rem;
32- }
33-
34- .fr-btns-group--sm .fr-btn:not([class^=fr-icon-]):not([class*=" fr-icon-"]):not([class^=fr-fi-]):not([class*=" fr-fi-"]) {
25+ .fr-btns-group--sm .fr-btn:not([class^=ri-]):not([class*=" ri-"]):not([class^=fr-fi-]):not([class*=" fr-fi-"]) {
3526 font-size: 0.875rem;
3627 line-height: 1.5rem;
3728 min-height: 2rem;
3829 padding: 0.25rem 0.75rem;
3930}
4031
41- .fr-follow__social .fr-btns-group:not(.fr-btns-group--sm):not(.fr-btns-group--lg) .fr-btn:not([class^=fr-icon- ]):not([class*=" fr-icon -"]):not([class^=fr-fi-]):not([class*=" fr-fi-"]) {
32+ .fr-follow__social .fr-btns-group:not(.fr-btns-group--sm):not(.fr-btns-group--lg) .fr-btn:not([class^=ri- ]):not([class*=" ri -"]):not([class^=fr-fi-]):not([class*=" fr-fi-"]) {
4233 font-size: 1rem;
4334 line-height: 1.5rem;
4435 min-height: 2.5rem;
@@ -52,18 +43,8 @@ it("Successfully css with only used icons", () => {
5243}
5344
5445@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
55- .fr-enlarge-link [href] {
56- text-decoration: none;
57- }
58-
59- [href],
60- .fr-reset-link {
61- text-decoration: underline;
62- }
63-
64-
65- [class^=fr-icon-]::before,
66- [class*=" fr-icon-"]::before,
46+ [class^=ri-]::before,
47+ [class*=" ri-"]::before,
6748 [class^=fr-fi-]::before,
6849 [class*=" fr-fi-"]::before {
6950 background-color: transparent;
@@ -72,22 +53,7 @@ it("Successfully css with only used icons", () => {
7253 width: 1.5rem;
7354 height: 1.5rem;
7455 }
75-
76- .fr-icon--xs::before {
77- width: 0.75rem;
78- height: 0.75rem;
79- }
80-
81- }
82-
83- @media (min-width: 36em) { }
84-
85- @media (min-width: 48em) { }
86-
87- @media (min-width: 62em) { }
88-
89- @media (min-width: 78em) { }
90- ` ;
56+ }` . replace ( / ^ \n / , "" ) ;
9157
9258 const expected = `
9359.fr-icon-ancient-gate-fill::before,
@@ -126,7 +92,6 @@ it("Successfully css with only used icons", () => {
12692
12793}
12894
129- /* This is all the parts of dsfr.css related to icons with .fr-icon- replaced by .ri- so that we can use remixicon as dsfr icons*/
13095[target=_blank][class^=ri-]::after,
13196[target=_blank][class*=" ri-"]::after,
13297[target=_blank][class^=fr-fi-]::after,
@@ -180,7 +145,7 @@ it("Successfully css with only used icons", () => {
180145}` . replace ( / ^ \n / , "" ) ;
181146
182147 const got = generateIconsRawCssCode ( {
183- rawCssCode ,
148+ patchedRawCssCodeForCompatWithRemixIcon ,
184149 "usedIcons" : [
185150 {
186151 "prefix" : "fr-icon-" ,
0 commit comments