alphagov / govuk-frontend

GOV.UK Frontend contains the code you need to start building a user interface for government platforms and services.
https://frontend.design-system.service.gov.uk/
MIT License
1.18k stars 323 forks source link

Make it possible to override or remove the Crown logotype from the header #1639

Open 36degrees opened 4 years ago

36degrees commented 4 years ago

As per https://github.com/alphagov/govuk-design-system-backlog/issues/97#issuecomment-552755688:

Would it be possible in a future update the ability to change the SVG of the crown? At CH we don't use the crown for our services and there is no simple way to swap it out using Nunjucks

kellylee-gds commented 4 years ago

Making the change itself is easy. Understanding how we want teams to use the header and in which circumstances is more complex.

DevRCRun commented 4 years ago

As a local authority, consuming the npm module, we're at this point (needing to remove / replace icons and fonts) before we can start testing our first service internally. Looking at macro-options.json for the header component I don't immediately spot an option that would let us change the embedded govuk-header__logotype-crown svg via a param.

Is there something I'm missing or are we best forking the header component and making the changes we need in our own project?

NickColley commented 4 years ago

@DevRCRun yes you're correct, for now you can't do that with the Nunjucks macro and will need to use HTML directly instead.

Dlozitskiy commented 1 month ago

I'm developing a Flask app.

I'm using govukHeader and modifying the package directly at ./node_modules/govuk-frontend/dist/govuk/components/header/template.njk replacing logo SVG, however the changes are not getting reflected after flask restart.

Any tips on what am I missing to get GOV.UK replaced with another logo? cc @NickColley

romaricpascal commented 1 month ago

@Dlozitskiy Is your Flask app loading our Nunjucks template directly? I would have thought Python apps would rely on Jinja templates (like this port of GOV.UK Frontend), as Nunjucks is a templating engine for JavaScript (although its syntax is taken from Jinja). If you're using govuk-frontend-jinja for your templates, it would be this template you need to edit instead of the one in node_modules/govuk-frontend.

Dlozitskiy commented 1 month ago

Thank you @romaricpascal, that was indeed the case, had to modify /opt/venv/lib/python3.11/site-packages/govuk_frontend_jinja/templates/components/header/macro.html