Skip to content

docs: add html2canvas export notes - #5

Merged
hiyouga merged 1 commit into
mainfrom
codex/add-html2canvas-export-notes
May 20, 2026
Merged

docs: add html2canvas export notes#5
hiyouga merged 1 commit into
mainfrom
codex/add-html2canvas-export-notes

Conversation

@hiyouga

@hiyouga hiyouga commented May 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Document html2canvas export-safe color usage for pseudo-elements
  • Document safer SVG connector guidance for PDF export

Tests

  • Not run; documentation-only change

Copilot AI review requested due to automatic review settings May 20, 2026 05:52
@hiyouga
hiyouga merged commit 4c52444 into main May 20, 2026
6 checks passed
@hiyouga
hiyouga deleted the codex/add-html2canvas-export-notes branch May 20, 2026 05:53

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request updates the AGENTS.md documentation to include specific styling guidelines for ensuring compatibility with html2canvas during PDF export, specifically regarding CSS color functions and SVG usage. A review comment suggests broadening the restriction on modern CSS color functions to all export-visible content, rather than just pseudo-elements, to prevent parsing errors with functions like color-mix() and oklch().

Comment thread AGENTS.md
## `src/styles/`

- `global.css`: Global styles, theme variables, slide layout, reusable block styling, top-right abstract mark styling, and export canvas styling.
- Avoid modern CSS color functions in export-visible pseudo-elements because `html2canvas` cannot reliably parse computed values such as `color(srgb ...)`; use `rgb(...)`, `rgba(...)`, or hex instead.

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.

medium

The restriction on modern CSS color functions should be applied to all export-visible elements, not just pseudo-elements. While exportPdf.js attempts to normalize color() functions for standard elements, it does not currently handle color-mix() (which is used in .slide-canvas in global.css) or other modern syntaxes like oklch(). Since html2canvas cannot reliably parse these computed values, it is safer to avoid them in any content intended for export.

Suggested change
- Avoid modern CSS color functions in export-visible pseudo-elements because `html2canvas` cannot reliably parse computed values such as `color(srgb ...)`; use `rgb(...)`, `rgba(...)`, or hex instead.
- Avoid modern CSS color functions (such as `color()`, `color-mix()`, or `oklch()`) in export-visible content because `html2canvas` cannot reliably parse these computed values; use `rgb(...)`, `rgba(...)`, or hex instead.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates contributor/project documentation with guidance for making slide visuals export-safe when generating PDFs via html2canvas.

Changes:

  • Added notes about avoiding modern CSS color functions in export-visible pseudo-elements to improve html2canvas compatibility.
  • Added guidance to prefer full-region SVG overlays over small standalone SVG connector graphics for more reliable PDF export.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AGENTS.md
@@ -70,6 +70,8 @@ This is the reusable content component layer.
## `src/styles/`

- `global.css`: Global styles, theme variables, slide layout, reusable block styling, top-right abstract mark styling, and export canvas styling.
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.

2 participants