Description of the issue
When using certain forced colour made browser extensions, in this case Dark Reader which changes colours by rotating hue, certain in-page template svgs like the GOV.UK logo lockup and the OGL logo in the footer incorrectly change with the colour mode, making them functionally impossible to see with the
Steps to reproduce the issue
- Go to a GOV.UK service on a browser with Dark Reader installed, with Dark Reader turned off
- Scroll down to the bottom of the page, note the OGL logo in the footer
- Turn Dark Reader on
Actual vs expected behaviour
Expected
The OGL logo is the same colour as the page's text colour, forced or otherwise eg: it'll be black if text is set to black, white if text is set to white.
Actual
The OGL logo is an off-black against the dark footer background
Environment (where applicable)
- Operating system: MacOS Tahoe 26.4.1
- Browser: Chrome
- Browser version: 147.0.7727.117
- GOV.UK Frontend Version: >= 5.14
Notes
What seems to be happening here is Dark Reader is adding attributes to change the colour of the SVG by rotating it's hue 180 degrees. At least for the OGL logo, this is overriding the fill="currentcolour" applied to the path of the OGL svg. That attribute is setting the svg to the page text colour, which the extension is overriding back to black.
Removing fill="currentcolour" resolves this and, from some very shallow testing, seems to work fine without any forced colours and with other forced colour methods. It looks like there are some team tasks to do here:
- Decide if this is something we want to try to figure out at our level or if we call this a bug in Dark Reader instead and not make it our concern
- Investigate if removing
fill="currentcolour" causes other unexpected problems
- Try to understand Dark Reader's behaviour further and if there's something we're doing that's triggering Dark Reader to apply that hue rotation styling
Description of the issue
When using certain forced colour made browser extensions, in this case Dark Reader which changes colours by rotating hue, certain in-page template svgs like the GOV.UK logo lockup and the OGL logo in the footer incorrectly change with the colour mode, making them functionally impossible to see with the
Steps to reproduce the issue
Actual vs expected behaviour
Expected
The OGL logo is the same colour as the page's text colour, forced or otherwise eg: it'll be black if text is set to black, white if text is set to white.
Actual
The OGL logo is an off-black against the dark footer background
Environment (where applicable)
Notes
What seems to be happening here is Dark Reader is adding attributes to change the colour of the SVG by rotating it's hue 180 degrees. At least for the OGL logo, this is overriding the
fill="currentcolour"applied to thepathof the OGL svg. That attribute is setting the svg to the page text colour, which the extension is overriding back to black.Removing
fill="currentcolour"resolves this and, from some very shallow testing, seems to work fine without any forced colours and with other forced colour methods. It looks like there are some team tasks to do here:fill="currentcolour"causes other unexpected problems