♻️(react) split fonts in a seperate CSS file

Fonts were de-facto included in the bundled dist/style.css file which
wasn't convenient in situations were consumers wanted to import fonts
by themselves.
This commit is contained in:
Nathan Vasse
2023-02-16 15:25:05 +01:00
committed by NathanVss
parent 479e0777b6
commit cd88e46537
8 changed files with 40 additions and 9 deletions

View File

@@ -53,6 +53,7 @@ Then, add these lines at the top of your main stylesheet file:
dark
format={false}
code={`
@import "@openfun/cunningham-react/fonts"; // Imports default fonts ( Roboto ). You can also import fonts by yourself.
@import "@openfun/cunningham-react/style"; // Imports the default theme.
@import "cunningham-tokens"; // Imports the file you just generated.
`}

View File

@@ -0,0 +1,6 @@
@import "@fontsource/roboto/100";
@import "@fontsource/roboto/300";
@import "@fontsource/roboto/400";
@import "@fontsource/roboto/500";
@import "@fontsource/roboto/700";
@import "@fontsource/roboto/900";

View File

@@ -1,9 +1,3 @@
@import "@fontsource/roboto/100";
@import "@fontsource/roboto/300";
@import "@fontsource/roboto/400";
@import "@fontsource/roboto/500";
@import "@fontsource/roboto/700";
@import "@fontsource/roboto/900";
@import "cunningham-tokens";
@import '@openfun/cunningham-tokens/default-tokens';
@import './components/Button';