Skip to content

Iteration over pictograms #425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 10, 2025
Merged

Conversation

Maxenceee
Copy link
Contributor

This PR resolves #424 and the comments made by @ddecrulle in #417.

It includes :

  • SVG path grouping, according to the DSFR specs (major, minor & decorative)
  • artwork classes usage instead of hardcoded colors
  • color variation & dark mode support

The pictogram components now follows this structure:

export default createIcon(
    <>
        <g className="fr-artwork-minor">
            <path d="..." />
            ...
        </g>
        <g className="fr-artwork-major">
            <path d="..." />
            ...
        </g>
    </>,
    "Name"
);

I've added new examples to the storybook such as color variation.

Also, I edited the import section and replaced it with an individual import: import { Accessibility } from "@codegouvfr/react-dsfr/picto"; => import Accessibility from "@codegouvfr/react-dsfr/picto/Accessibility";

Pictogram can still be imported from the index file, I only changed the example.

Sorry for the back and forth, I had started this implementation for a project and it was enough but I should have thought about reading the DSFR specs on the subject better before proposing my first PR, we would have saved time :)

@ddecrulle
Copy link
Collaborator

Very nice work! No worries about the back and forth — DSFR pictograms are indeed a bit unconventional and not the easiest to work with 😅.

Now, we need to update the components that use pictograms — like Tile, for example — to make them composable.
In other words, we should be able to pass exported pictograms as props and use them inside components like Tile.

Thanks a lot!

@ddecrulle ddecrulle merged commit 8016974 into codegouvfr:main Jun 10, 2025
6 checks passed
@Maxenceee Maxenceee deleted the feature/pictogrammes branch June 11, 2025 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Iteration over pictograms
2 participants