Skip to content

datatracker render of svg diagrams shows all black #11994

Closed

Description

@pcamarillo

Describe the issue

Hi. Please check out the svg diagram. The boxes render differently on ietf.org vs on datatracker.ietf.org
can you please review it? Thanks!

Image Image

Code of Conduct

Activity

  1. added theissue type on Nov 5, 2026
  2. jennifer-richards commented on Nov 5, 2026

    @jennifer-richards
    Member

    This is happening because the affected rectangles don't have their fill attributes set. They are inheriting it from the container they're in. There's a CSS hack at

    svg :is([fill="black"], [fill^="#000"], :not([fill])) {
    fill: var(--bs-body-color);
    }
    that matches on an absent fill attribute and substitutes the foreground color (--bs-body-color).

    This particular case would be fixed by moving the :not([fill]) case to the group that becomes --bs-body-bg instead. That might affect other SVGs, though. @martinthomson, I think you originated that CSS - do you know offhand whether that would break things?

  3. martinthomson commented on Nov 5, 2026

    @martinthomson
    Contributor

    A URL would have been a great deal of help. https://datatracker.ietf.org/doc/html/draft-camarillo-fann-lsn-00

    This SVG will never work with dark/light toggles. It will render much of the content as black on black. (Update: Seems fine with the fix.)

    As you say, the :not([fill]) matcher is activating on the rect elements, which is overriding the fill attribute on the g element.

    The fix would appear to be to switch to :not([fill], [fill] *), which only matches if the element and all its ancestors lack the attribute. That's not perfect (HTML outside of the SVG could include the attribute), but it's probably fine.

  4. jennifer-richards commented on Nov 6, 2026

    @jennifer-richards
    Member

    A URL would have been a great deal of help. https://datatracker.ietf.org/doc/html/draft-camarillo-fann-lsn-00

    Oops, sorry.

    The fix would appear to be to switch to :not([fill], [fill] *), which only matches if the element and all its ancestors lack the attribute. That's not perfect (HTML outside of the SVG could include the attribute), but it's probably fine.

    Awesome, thanks!

  5. jennifer-richards commented on Nov 10, 2026

    @jennifer-richards
    Member

    (Update: Seems fine with the fix.)

    Deployed and confirmed just now. Thanks again!

    Screenshot showing the original figure, now rendered with white instead of black fill in the boxes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions