-
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.
- Loading branch information
Showing
33 changed files
with
247 additions
and
87 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
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
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
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
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.
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,11 @@ | ||
Le fichier CSS statique : | ||
|
||
- Contient tout le style Bootstrap compilé avec nos personnalisations | ||
- Est facile à importer | ||
- Rend par contre difficile la sur-personnalisation si jamais vous vouliez changer des choses | ||
|
||
Pour s'en servir, remplacez juste l'import de style Bootstrap officiel par : | ||
|
||
```ts | ||
import 'dsfr-connect/dist/bootstrap-v5/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,14 @@ | ||
import DsfrScssExplanation from '@dsfrc/docs/stories/usage/dsfr-scss.mdx'; | ||
|
||
Le fichier SCSS : | ||
|
||
- Vous permet d'étendre ou de surcharger nos personnalisations pour qu'elles se répercutent sur tous les composants Bootstrap | ||
- Nécessite un peu plus de configuration du fait de compiler le style final dans votre projet | ||
|
||
Pour s'en servir, remplacez l'import de style Bootstrap officiel par : | ||
|
||
```ts | ||
import 'dsfr-connect/src/bootstrap-v5/index.scss'; | ||
``` | ||
|
||
<DsfrScssExplanation /> |
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
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/bootstrap-v5-css.mdx'; | ||
import ScssTab from '@dsfrc/docs/stories/usage/bootstrap-v5-scss.mdx'; | ||
|
||
<Meta title="dsfr-connect/Utilisation/bootstrap-v5" /> | ||
|
||
# bootstrap-v5 | ||
|
||
Remplacez l'import du style par défaut de Bootstrap au sein de votre applicatif. | ||
|
||
<Tabs | ||
tabs={[ | ||
{ label: 'CSS (thème rigide)', isDefault: true, content: <CssTab /> }, | ||
{ label: 'SCSS (thème flexible)', isDefault: false, content: <ScssTab /> }, | ||
]} | ||
/> |
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 @@ | ||
Dans votre fichier `vite.config.js` vous devez déclarez l'alias suivant au sein de votre configuration actuelle : | ||
|
||
```ts | ||
const path = require('path'); | ||
|
||
// ... | ||
|
||
const viteConfig = { | ||
// ... | ||
resolve: { | ||
// ... | ||
alias: { | ||
// ... | ||
module: path.resolve(__dirname, './node_modules/@gouvfr/dsfr/module'), | ||
}, | ||
}, | ||
}; | ||
``` |
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 @@ | ||
Dans votre fichier `webpack.config.js` vous devez déclarez l'alias suivant au sein de votre configuration actuelle : | ||
|
||
```ts | ||
const path = require('path'); | ||
|
||
// ... | ||
|
||
const webpackConfig = { | ||
// ... | ||
resolve: { | ||
// ... | ||
alias: { | ||
// ... | ||
module: path.resolve(__dirname, './node_modules/@gouvfr/dsfr/module'), | ||
}, | ||
}, | ||
}; | ||
``` |
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 le fichier `.scss` du thème 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 d'en définir un minimum pour que la compilation SCSS fonctionne dans le préprocesseur : | ||
|
||
<Tabs | ||
tabs={[ | ||
{ label: 'Projet utilisant Webpack', isDefault: true, content: <WebpackTab /> }, | ||
{ label: 'Projet utilisant Vite', isDefault: false, content: <ViteTab /> }, | ||
]} | ||
/> |
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,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.
File renamed without changes.
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
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,8 @@ | ||
Dans votre fichier `vite.config.js` vous devez adapter votre configuration actuelle pour avoir : | ||
|
||
```ts | ||
vuetify({ | ||
// ... | ||
styles: { configFile: 'node_modules/dsfr-connect/src/vuetify-v3/settings.scss' }, | ||
}); | ||
``` |
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,8 @@ | ||
Dans votre fichier `webpack.config.js` vous devez adapter votre configuration actuelle pour avoir : | ||
|
||
```ts | ||
new VuetifyPlugin({ | ||
// ... | ||
styles: { configFile: 'node_modules/dsfr-connect/src/vuetify-v3/settings.scss' }, | ||
}); | ||
``` |
Oops, something went wrong.