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

Remove standalone icon SVG files #1028

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

frankieroberto
Copy link
Contributor

These standalone .svg icon files aren't used by any of the components, as each component either embeds the SVG directly within the Nunjucks macro or includes it using a data-url in the CSS.

On the one hand, maybe it’s useful to have these as standalone files just as a reference, so that all the icons can be easily reviewed together?

But on the other hand, duplicating them here runs the risk of them accidentally deviating from the actual icons used by the components?

Including them within the nhsuk-frontend package also adds another 100kb to the package (as they’re included twice, once in packages/assets and once in dist/app/asset).

Note: It’s possible that these are used somewhere and I’ve missed it somehow, but I’ve done a bunch of services across the code, and I can’t find anything that does.

These standalone .svg icon files aren't used by any of the components, as each component either embeds the SVG directly within the Nunjucks macro or has includes it using a data-url in the CSS.
@edwardhorsford
Copy link
Contributor

My guess might be that these are considered the 'master assets' and are archived here - that the data-uri's are generated from them, and the macros copy from them. The repo is being used for persistent storage. If that's the case, I would leave them - though perhaps with a text file describing their purpose. Do you have any clues about their origin / usage?

@frankieroberto
Copy link
Contributor Author

@edwardhorsford I can't see any scripts to generate the data-uris from the files, but perhaps that's been done manually?

I have a hunch they they were previously used as the target of <img> tags, but I’ve not dug through the git history to find out.

Could keep them as a reference, but will just have to remember to keep them up-to-date if changing the icons in the css or macros!

If keeping them for that purpose, they could be removed from the build process so that they're not included in the distributed package?

@edwardhorsford
Copy link
Contributor

If the purpose is for archival purposes, their location could probably be clearer - and removed from the build process as you say. Perhaps someone who's worked on this repo longer might have some ideas.

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.

2 participants