Skip to content

🐛 Restore brand colours and cropping on the ErrorPage default symbol - #28

Merged
damienlagae merged 1 commit into
mainfrom
fix/error-page-symbol-colours
Jul 31, 2026
Merged

damienlagae merged 1 commit into
mainfrom
fix/error-page-symbol-colours

Conversation

@damienlagae

Copy link
Copy Markdown
Member

Problem

The default symbol shipped in #22 renders as a flat grey blob floating in the corner instead of the Enabel brand mark bleeding off the top-left edge.

Two defects, both introduced by the potrace tracing:

  1. Colours lost — potrace emitted a single fill="#000000" on the <g>, flattening the three petals. This is visibly inconsistent within the same component: the default logo is a full-colour PNG, only the symbol is monochrome.
  2. Glyph does not fill its viewBox — the traced output kept viewBox="0 0 200 200" while the glyph only covers x=36..165, y=41..159, i.e. 64% x 59% of the box. The theme sizes the watermark with .bg img { width: 550px; height: 550px } and preserveAspectRatio="xMidYMid meet", so a glyph with that much padding gets centred rather than cropped by the .bg { top: -50px; left: -50px } offset.

Apps hitting this have to override symbol with their own asset to get the intended look — which is what enabel/layout-bundle used to provide out of the box.

Fix

  • Colour each of the 3 existing paths with its brand value: grey #58575A, yellow #F9B500, red #D81A1A.
  • Crop the viewBox onto the glyph bounding box: 36 41 129 118, measured with getBBox() on the transformed <g>.
  • Drop the leftover potrace <metadata> block.

Same 3 paths, no geometry change. The data: URI stays image/svg+xml;base64 (so ErrorPageTest::testDefaultSymbolIsDataUri still holds) and gets smaller: 1434 bytes instead of 1578.

Verification

  • vendor/bin/phpunit246 tests, 676 assertions, green (incl. the 11 ErrorPage tests).
  • Rendered the result in a browser against the theme's error.min.css at 550x550: brand mark in colour, cropped off the top-left corner, matching the pre-enabel/ux output of enabel/layout-bundle.
  • Only src/Component/Layout/Defaults/error_page_symbol.txt changes — no PHP touched, so php-cs-fixer / phpstan / composer validate are unaffected.

Follow-up

Consumers that worked around this with an explicit symbol="…" can drop the override once this is released.

The symbol shipped in #22 was traced with potrace, which flattened the
three Enabel petals into a single `fill="#000000"` and left a 200x200
viewBox in which the glyph only covers 64% x 59% of the box.

Rendered through the theme's `.bg img { width: 550px; height: 550px }`
with `xMidYMid meet`, that produced a grey blob centred in the corner
instead of the brand mark bleeding off the top-left edge — and it looked
inconsistent next to the default logo, which is a full-colour PNG.

Colour each petal with its brand value (grey #58575A, yellow #F9B500,
red #D81A1A) and crop the viewBox onto the glyph bounding box
(36 41 129 118), measured with getBBox() on the transformed group.

The data: URI stays an SVG and is now 1434 bytes instead of 1578.
@damienlagae
damienlagae merged commit ad27825 into main Jul 31, 2026
9 checks passed
@damienlagae
damienlagae deleted the fix/error-page-symbol-colours branch July 31, 2026 10:10
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.

1 participant