Skip to content

Drop the inline <style> from the shipped logo (4.0.1) - #20

Merged
robireton merged 1 commit into
mainfrom
issue-19-logo-inline-style
Sep 24, 2026
Merged

robireton merged 1 commit into
mainfrom
issue-19-logo-inline-style

Conversation

@robireton

Copy link
Copy Markdown
Contributor

Fixes #19.

login.html uses {% include %} to put logo.svg inline, so the SVG's <style> block ended up on the sign-in page of daedalus, email_service and monitor. One inline style there rules out a Content-Security-Policy without 'unsafe-inline' in style-src, for all three apps.

Changes

  • logo.svg: deleted <defs><style>.text, .graphic {stroke-width: 0;}</style></defs>. It did nothing: the logo has no stroke, and nothing on the page gives it one (login.css is the page's only stylesheet). Also fixed <svg mlns=…> to xmlns=. The typo is harmless when inlined, but the file isn't valid on its own.
  • New test: test_login_page_has_no_inline_style_or_script renders the sign-in page and fails on any <style>, style=, on*=, or <script> without src. The chi-platform audit catches the same thing, but only when someone runs it; this test runs on every change.
  • 4.0.1: __version__, the README install snippets, an "Upgrading from 4.0.0 to 4.0.1" note, and a "Templates" rule in CLAUDE.md.

Verification

  • The new test failed before the fix with ['<style'] != [], and passes after. The full suite passes: 110 tests. ruff check and ruff format --check are clean.
  • I rendered the logo before and after at 192 dpi with ImageMagick: 0 differing pixels. I also viewed the render to confirm it's the logo and not two blank images.
  • chi-platform/audit.sh user_manager: ✓ 18 checks.

After merging

Tag v4.0.1. Each app then needs its pin bumped to pick up the fix; until all three are bumped, package-pin-consistent will flag the ones still behind.

🤖 Generated with Claude Code

login.html {% include %}s logo.svg, so its <style> block landed on every consumer's
sign-in page and ruled out a CSP without 'unsafe-inline' in style-src for all three.
The rule set stroke-width: 0 on groups that have no stroke, and nothing on the page
gives them one, so it was a no-op: rendered before and after, the logo differs by
zero pixels.

Also fixes <svg mlns=> to xmlns=, harmless inline but invalid on its own.

A test now renders the sign-in page and fails on any inline style or script, so this
is caught here rather than only by chi-platform's audit.

Fixes #19.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robireton
robireton merged commit 75bc950 into main Sep 24, 2026
8 checks passed
@robireton
robireton deleted the issue-19-logo-inline-style branch September 24, 2026 18:08
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.

logo.svg carries an inline <style>, which login.html inlines into every consumer's sign-in page

1 participant