Skip to content

Commit c9d053d

Browse files
committed
💄(frontend) add generic favicon
The favicons were still with the dsfr color. We added the generic favicon in the assets folder. The favicon can be a url loaded from the theme, so when Drive will be running, we will be able to store the dsfr favicons there, and remove them from the repo.
1 parent b5f0f06 commit c9d053d

File tree

10 files changed

+42
-9
lines changed

10 files changed

+42
-9
lines changed

src/frontend/apps/impress/cunningham.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ const customColors = {
3636
'yellow-500': '#B7A73F',
3737
'yellow-600': '#66673D',
3838
};
39-
tokens.themes.default.theme.colors = {
40-
...tokens.themes.default.theme.colors,
41-
...customColors,
42-
};
4339

4440
tokens.themes.default.theme = {
4541
...tokens.themes.default.theme,
@@ -50,6 +46,10 @@ tokens.themes.default.theme = {
5046
widthHeader: '',
5147
widthFooter: '',
5248
},
49+
colors: {
50+
...tokens.themes.default.theme.colors,
51+
...customColors,
52+
},
5353
},
5454
};
5555

@@ -60,6 +60,11 @@ tokens.themes.default.components = {
6060
'home-proconnect': false,
6161
beta: false,
6262
'image-system-filter': '',
63+
favicon: {
64+
ico: '/assets/favicon-light.ico',
65+
'png-light': '/assets/favicon-light.png',
66+
'png-dark': '/assets/favicon-dark.png',
67+
},
6368
},
6469
};
6570

@@ -80,6 +85,11 @@ const dsfrTheme = {
8085
'la-gaufre': true,
8186
'home-proconnect': true,
8287
beta: true,
88+
favicon: {
89+
ico: '/assets/favicon-dsfr.ico',
90+
'png-light': '/assets/favicon-dsfr.png',
91+
'png-dark': '/assets/favicon-dark-dsfr.png',
92+
},
8393
},
8494
},
8595
};
1.03 KB
Loading
Binary file not shown.
1.03 KB
Loading

src/frontend/apps/impress/src/cunningham/cunningham-tokens.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,9 @@
491491
--c--components--home-proconnect: false;
492492
--c--components--beta: false;
493493
--c--components--image-system-filter: ;
494+
--c--components--favicon--ico: /assets/favicon-light.ico;
495+
--c--components--favicon--png-light: /assets/favicon-light.png;
496+
--c--components--favicon--png-dark: /assets/favicon-dark.png;
494497
}
495498

496499
.cunningham-theme--dark {
@@ -551,6 +554,9 @@
551554
--c--components--la-gaufre: true;
552555
--c--components--home-proconnect: true;
553556
--c--components--beta: true;
557+
--c--components--favicon--ico: /assets/favicon-dsfr.ico;
558+
--c--components--favicon--png-light: /assets/favicon-dsfr.png;
559+
--c--components--favicon--png-dark: /assets/favicon-dark-dsfr.png;
554560
}
555561

556562
.cunningham-theme--generic {

src/frontend/apps/impress/src/cunningham/cunningham-tokens.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,11 @@ export const tokens = {
367367
'home-proconnect': false,
368368
beta: false,
369369
'image-system-filter': '',
370+
favicon: {
371+
ico: '/assets/favicon-light.ico',
372+
'png-light': '/assets/favicon-light.png',
373+
'png-dark': '/assets/favicon-dark.png',
374+
},
370375
},
371376
},
372377
dark: {
@@ -431,7 +436,16 @@ export const tokens = {
431436
alt: 'Gouvernement Logo',
432437
},
433438
},
434-
components: { 'la-gaufre': true, 'home-proconnect': true, beta: true },
439+
components: {
440+
'la-gaufre': true,
441+
'home-proconnect': true,
442+
beta: true,
443+
favicon: {
444+
ico: '/assets/favicon-dsfr.ico',
445+
'png-light': '/assets/favicon-dsfr.png',
446+
'png-dark': '/assets/favicon-dark-dsfr.png',
447+
},
448+
},
435449
},
436450
generic: {
437451
theme: {

src/frontend/apps/impress/src/pages/_app.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Head from 'next/head';
33
import { useTranslation } from 'react-i18next';
44

55
import { AppProvider } from '@/core/';
6+
import { useCunninghamTheme } from '@/cunningham';
67
import { useOffline, useSWRegister } from '@/features/service-worker/';
78
import '@/i18n/initI18n';
89
import { NextPageWithLayout } from '@/types/next';
@@ -18,6 +19,8 @@ export default function App({ Component, pageProps }: AppPropsWithLayout) {
1819
useOffline();
1920
const getLayout = Component.getLayout ?? ((page) => page);
2021
const { t } = useTranslation();
22+
const { componentTokens } = useCunninghamTheme();
23+
const favicon = componentTokens['favicon'];
2124

2225
return (
2326
<>
@@ -29,17 +32,17 @@ export default function App({ Component, pageProps }: AppPropsWithLayout) {
2932
'Docs: Your new companion to collaborate on documents efficiently, intuitively, and securely.',
3033
)}
3134
/>
32-
<link rel="icon" href="/favicon.ico" sizes="any" />
33-
<link rel="icon" href="/favicon.png" type="image/png" />
35+
<link rel="icon" href={favicon['ico']} sizes="any" />
36+
<link rel="icon" href={favicon['png-light']} type="image/png" />
3437
<link
3538
rel="icon"
36-
href="/favicon.png"
39+
href={favicon['png-light']}
3740
type="image/png"
3841
media="(prefers-color-scheme: light)"
3942
/>
4043
<link
4144
rel="icon"
42-
href="/favicon-dark.png"
45+
href={favicon['png-dark']}
4346
type="image/png"
4447
media="(prefers-color-scheme: dark)"
4548
/>

0 commit comments

Comments
 (0)