Skip to content

Add themed Kubernetes diagrams and image contribution guidance - #3518

Open
samironsoctopus wants to merge 9 commits into
mainfrom
si/update-kubernetes-diagrams
Open

samironsoctopus wants to merge 9 commits into
mainfrom
si/update-kubernetes-diagrams

Conversation

@samironsoctopus

Copy link
Copy Markdown
Contributor

Summary

Replaces two diagrams on the Kubernetes step pages with light and dark variants that follow the site theme. Also adds contributor guidance on when to use screenshots and how to make images follow the theme.

Themed images

  • Adds theme-light-only and theme-dark-only classes in src/styles/main.css. They key off html[data-theme], so images follow the site's theme toggle as well as the OS setting. <picture> with prefers-color-scheme would only follow the OS setting, and the zoom lightbox would always show its fallback image.
  • Replaces the Deploy Container diagram on kubernetes-resources.md with light and dark SVGs exported from Figma.
  • Replaces the Load Balancer diagram on kubernetes-resources.md and kubernetes-service.md with light and dark SVGs, stored in the shared public/docs/img/kubernetes/steps/ folder.
  • Removes the old deploy-container.svg and loadbalancer.svg, which nothing else referenced.

SVG sizing

  • SVGs inside a figure now fill the content column (figure img[src$='.svg'] { width: 100%; }), because they scale without losing sharpness. This also widens high-availability.svg slightly, from 800px to the column width. The other existing SVG figures were already column-width.
  • The zoom lightbox in src/scripts/modules/figures.js no longer limits vector images to their exported width. PNG and JPG keep the existing limit.

Contributor guidance (README.md)

  • Decide whether a page needs a screenshot: when a screenshot earns its maintenance cost and when to avoid one. Light and dark pairs are reserved for high-traffic pages. Based on GitHub, GitLab, Grafana and Google style guides and research by Gellevij and van der Meij.
  • Images and theming:
    • Sizing PNGs and SVGs for the content column (up to 800px on desktop, 1056px on tablets).
    • Capturing at 2x and creating clear images.
    • Adding light and dark variants.
    • What to do when an image has only one variant.

Testing

  • markdownlint-cli2 passes on the changed pages and the README.
  • Checked in Playwright against astro dev:
    • In both themes, and after using the theme toggle, the correct variant shows on both pages.
    • Both variants load.
    • SVG figures fill the column.
    • The lightbox opens the visible variant and zooms past the exported width.
  • I haven't run a full pnpm build or the Playwright test suite.

Follow-up

  • The dark diagrams use a #16191F background. The README recommends the page colour #111A23.
  • The comment above the content-image background rule in src/styles/main.css still says content images sit on a white background. The rule now uses a colour that changes with the theme.

🤖 Generated with Claude Code

samironsoctopus and others added 3 commits October 16, 2026 10:01
Replace the Deploy Container and Load Balancer diagrams with Figma
exports in light and dark variants. Images marked theme-light-only or
theme-dark-only are hidden by the html[data-theme] attribute, so the
swap follows the site's theme toggle as well as the OS setting.

SVG figures now fill the content column, and the zoom lightbox no
longer caps vector images at their exported width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace both diagrams with revised Figma exports, and update the
Deploy Container figure's width and height to the new 480x270 size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add guidance to the README on deciding whether a page needs a
screenshot, sizing PNGs and SVGs for the content column, creating
clear images, and adding light and dark variants with the
theme-light-only and theme-dark-only classes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@team-marketing-branch-protections

Copy link
Copy Markdown

Pull request environment is available at https://stoctodocspr3518.z22.web.core.windows.net/.

You can view the ephemeral environment status in Octopus Deploy.

This environment will be automatically deprovisioned when the pull request is closed, or after 7 days of inactivity.

samironsoctopus and others added 3 commits October 19, 2026 09:57
SVG files are markup, not prose, so cspell flags attribute names such
as stroke-dasharray. Diagram labels exported from Figma are outlined
paths, so there's no text in them to check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@samironsoctopus
samironsoctopus requested review from KMajkrzakOctopus and enf0rc3 and removed request for KMajkrzakOctopus October 19, 2026 00:33
Comment thread README.md Outdated
- For a screenshot, capture the same view with Octopus in its light theme and again in its dark theme.
- For a diagram, export each variant with a solid background in the page color for that theme: `#FFFFFF` for light and `#111A23` for dark. These are the `colorBackgroundPrimaryDefault` design token in each theme, so the diagram blends into the page.
2. Name the files with a `-light` and `-dark` suffix, such as `load-balancer-light.svg` and `load-balancer-dark.svg`.
3. Add both images to the `figure` with HTML `<img>` tags, and give each one a theme class:

@borland borland Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're supposed to use the :img directive rather than raw HTML. It de-clutters the content and gives us more flexibility (e.g. if the class changes from theme-light-only to a different word, we can fix it in the directive rather than across many markdown files). It also avoids people having to duplicate alt-text and measure image sizes manually

The image resizing pipeline relies on that tag. If it doesn't handle light/dark then we would be better to fix it rather than suggesting people sidestep it with HTML

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked Claude to help with a fix here. The way the bots want me to respond to you is:

Agreed, thanks. I'd used raw HTML because the directive couldn't handle this case. It rewrote every image to a /docs/i/x/ path, but img.mjs only generates variants for PNG, JPG and WebP, so SVGs pointed at files that didn't exist. It also dropped the default resp-img class whenever a class like .theme-light-only was set.
Fixed both in f04e163. SVGs now keep their own path and take their width and height from the file. As a bonus, an @2x screenshot now shows at half its pixel size, so the README no longer tells anyone to measure images or use HTML. The diagrams now use :img{.theme-light-only …} and the README examples match.
I've left a themed flag for a follow-up. It would output both variants from one directive and remove the duplicated alt text.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this looks like slop and it ends up making our image support or theme support more flaky, just let me know. We have an upcoming project doing more renovation work in the doc set, where I can advocate for proper development resourcing to support light and dark themed images.

Comment thread README.md

1. Create a light and a dark variant of the image:
- For a screenshot, capture the same view with Octopus in its light theme and again in its dark theme.
- For a diagram, export each variant with a solid background in the page color for that theme: `#FFFFFF` for light and `#111A23` for dark. These are the `colorBackgroundPrimaryDefault` design token in each theme, so the diagram blends into the page.

@borland borland Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's on my mind is the discussion about near-future theme changes; It would invalidate guidance like "111A23 for dark"

samironsoctopus and others added 2 commits October 22, 2026 10:05
The :img directive rewrote every image to a /docs/i/ path, but img.mjs only
generates variants for raster images, so an SVG pointed at a file that never
existed. It also dropped resp-img whenever a class was set.

SVGs now keep their own path and take their width and height from the file,
and an @2x image shows at half its pixel size. The Kubernetes diagrams and the
README guidance use the directive instead of raw <img> tags, so sizes no
longer have to be set by hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

3 participants