Skip to content
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

Generate components from SVGs in doc site #474

Merged
merged 7 commits into from Dec 6, 2019
Merged

Conversation

thyhjwb6
Copy link
Collaborator

@thyhjwb6 thyhjwb6 commented Dec 5, 2019

Related issue

#437

Overview

Replaced the loading of inline SVGs with a build process which converts SVGs to React components to be added to the documentation.

Reason

There is a dependency on gatsby-plugin-react-svg which has upstream issues with outputting SVGs that contains elements with the same ID. This leads to the document being badly structure and therefore issues with presenting SVGs.

There is the added benefit that this automates the manual task which is optimising SVGs.

Work carried out

  • Add SVGR to build
  • Use React components
  • Tidy up package.json scripts
  • Tidy up docs site files
  • Remove gatsby-plugin-react-svg dependency

Screenshot

Screenshot 2019-12-06 at 08 17 13

Developer notes

Special attention should be given to the styles which have been moved to masthead.scss. This is because the masthead is dependent on site-logo.svg which had embedded styles and SVGR could not convert it to a component without errors.

@thyhjwb6 thyhjwb6 self-assigned this Dec 5, 2019
@thyhjwb6 thyhjwb6 force-pushed the feature/docs-site-svgr branch 2 times, most recently from 0e8cc01 to 38c7944 Compare December 5, 2019 16:50
@thyhjwb6 thyhjwb6 force-pushed the feature/docs-site-svgr branch 4 times, most recently from 38c7944 to d5b03a4 Compare December 5, 2019 18:46
@thyhjwb6 thyhjwb6 changed the title [WIP] Feature/docs site svgr Generate components from SVGs in doc site Dec 6, 2019
@m7kvqbe1 m7kvqbe1 marked this pull request as ready for review December 6, 2019 11:00
Copy link
Member

@m7kvqbe1 m7kvqbe1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@thyhjwb6 thyhjwb6 merged commit c5140fd into develop Dec 6, 2019
@thyhjwb6 thyhjwb6 deleted the feature/docs-site-svgr branch December 6, 2019 13:57
@thyhjwb6 thyhjwb6 mentioned this pull request Dec 10, 2019
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.

None yet

2 participants