You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The viewBox attribute on the SVGs within some of the UI components (e.g. https://design-system.service.gov.uk/styles/page-template/ ) are in lowercase (viewbox). This isn't an issue when used in most browsers as they convert it to camel case and all works correctly, however I'm using Angular and their compiler does not so the SVGs get cut off or are incorrectly sized.
Maybe Angular should handle this better but it's probably safer for the attribute to be updated to be camel cased in the example HTML code for components.
As raised in #1780, lowercasing this attribute causes issue with Angular.
I've searched the codebase for any other camel-cased SVG attributes and viewBox is the only one that we use:
```
$ ag 'allowReorder|attributeName|attributeType|autoReverse|baseFrequency|baseProfile|calcMode|clipPathUnits|contentScriptType|contentStyleType|diffuseConstant|edgeMode|externalResourcesRequired|filterRes|filterUnits|glyphRef|gradientTransform|gradientUnits|kernelMatrix|kernelUnitLength|keyPoints|keySplines|keyTimes|lengthAdjust|limitingConeAngle|markerHeight|markerUnits|markerWidth|maskContentUnits|maskUnits|numOctaves|pathLength|patternContentUnits|patternTransform|patternUnits|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|referrerPolicy|refX|refY|repeatCount|repeatDur|requiredExtensions|requiredFeatures|specularConstant|specularExponent|spreadMethod|startOffset|stdDeviation|stitchTiles|surfaceScale|systemLanguage|tableValues|targetX|targetY|textLength|viewBox|viewTarget|xChannelSelector|yChannelSelector|zoomAndPan' src
src/govuk/components/footer/template.njk
61: viewBox="0 0 483.2 195.7"
src/govuk/components/button/template.njk
27:<svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" aria-hidden="true" focusable="false">
src/govuk/components/header/template.njk
24: viewBox="0 0 132 97"
src/govuk/assets/images/govuk-mask-icon.svg
1:<svg xmlns="http://www.w3.org/2000/svg" width="132" height="97" viewBox="0 0 132 97" version="1.1">
```
Fixes#1780.
The
viewBox
attribute on the SVGs within some of the UI components (e.g. https://design-system.service.gov.uk/styles/page-template/ ) are in lowercase (viewbox
). This isn't an issue when used in most browsers as they convert it to camel case and all works correctly, however I'm using Angular and their compiler does not so the SVGs get cut off or are incorrectly sized.Maybe Angular should handle this better but it's probably safer for the attribute to be updated to be camel cased in the example HTML code for components.
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox
The text was updated successfully, but these errors were encountered: