-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docs): rename defects "infirma -> infima" + precise how to use sc…
…ss theme file
- Loading branch information
Showing
10 changed files
with
92 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Tabs } from '@codegouvfr/react-dsfr/Tabs'; | ||
import { Source } from '@storybook/blocks'; | ||
|
||
import ViteTab from '@dsfrc/docs/stories/usage/dsfr-scss-vite.mdx'; | ||
import WebpackTab from '@dsfrc/docs/stories/usage/dsfr-scss-webpack.mdx'; | ||
|
||
Mais comme notre fichier `.scss` importe des variables directement depuis le DSFR, vous devez installer leur librairie : | ||
|
||
<Tabs | ||
tabs={[ | ||
{ label: 'npm', isDefault: true, content: <Source language="shell" code="npm add @gouvfr/dsfr@^1.9.3"></Source> }, | ||
{ label: 'yarn', isDefault: false, content: <Source language="shell" code="yarn add @gouvfr/dsfr@^1.9.3"></Source> }, | ||
{ label: 'pnpm', isDefault: false, content: <Source language="shell" code="pnpm add @gouvfr/dsfr@^1.9.3"></Source> }, | ||
]} | ||
/> | ||
|
||
Et comme la librairie DSFR utilise des alias lors de ces imports de style, nous somme obligés de définir d'en définir un minimum pour que la compilation SCSS fonctionne dans votre "module bundler" : | ||
|
||
<Tabs | ||
tabs={[ | ||
{ label: 'Projet utilisant Webpack', isDefault: true, content: <WebpackTab /> }, | ||
{ label: 'Projet utilisant Vite', isDefault: false, content: <ViteTab /> }, | ||
]} | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Spécifiez le thème CSS dans Docusaurus v2 : | ||
|
||
```ts | ||
// docusaurus.config.js | ||
|
||
module.exports = { | ||
// ... | ||
presets: [ | ||
[ | ||
'@docusaurus/preset-classic', | ||
{ | ||
theme: { | ||
customCss: [require.resolve('dsfr-connect/dist/infima-v1/index.css')], | ||
}, | ||
}, | ||
], | ||
], | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import DsfrScssExplanation from '@dsfrc/docs/stories/usage/dsfr-scss.mdx'; | ||
|
||
Pour utiliser du SCSS il faut d'abord suivre leurs instructions sur [https://docusaurus.io/docs/styling-layout#sassscss](https://docusaurus.io/docs/styling-layout#sassscss). | ||
|
||
Puis spécifiez le thème SCSS : | ||
|
||
```ts | ||
// docusaurus.config.js | ||
|
||
module.exports = { | ||
// ... | ||
presets: [ | ||
[ | ||
'@docusaurus/preset-classic', | ||
{ | ||
theme: { | ||
customCss: [require.resolve('dsfr-connect/src/infima-v1/index.scss')], | ||
}, | ||
}, | ||
], | ||
], | ||
}; | ||
``` | ||
|
||
<DsfrScssExplanation /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Tabs } from '@codegouvfr/react-dsfr/Tabs'; | ||
import { Meta } from '@storybook/blocks'; | ||
|
||
import CssTab from '@dsfrc/docs/stories/usage/infima-v1-css.mdx'; | ||
import ScssTab from '@dsfrc/docs/stories/usage/infima-v1-scss.mdx'; | ||
|
||
<Meta title="dsfr-connect/Utilisation/infima-v1" /> | ||
|
||
# infima-v1 | ||
|
||
_Note: il est peu probable que vous utilisiez Infima hors du cadre d'usage de Docusaurus, c'est pourquoi cet outil est mentionné ci-dessous._ | ||
|
||
<Tabs | ||
tabs={[ | ||
{ label: 'CSS (thème rigide)', isDefault: true, content: <CssTab /> }, | ||
{ label: 'SCSS (thème flexible)', isDefault: false, content: <ScssTab /> }, | ||
]} | ||
/> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,5 @@ export default { | |
vuetifyV3: vuetifyV3, | ||
muiV5: muiV5, | ||
storybookV7: storybookV7, | ||
infirmaV1: {}, | ||
infimaV1: {}, | ||
}; |