Skip to content

feat(web): custom style#653

Open
kacperzolkiewski wants to merge 6 commits into
@kaceprzolkiewski/feat-custom-style-androidfrom
@kaceprzolkiewski/feat-custom-style-web
Open

feat(web): custom style#653
kacperzolkiewski wants to merge 6 commits into
@kaceprzolkiewski/feat-custom-style-androidfrom
@kaceprzolkiewski/feat-custom-style-web

Conversation

@kacperzolkiewski

@kacperzolkiewski kacperzolkiewski commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add custom style for foreground and background colors handling

Test Plan

  • Run the example web app and experiment with applying foreground and background colors through the toolbar across different text styles.
  • Run yarn test:e2e:web to see if all the tests pass

Screenshots / Videos

Screen.Recording.2026-06-22.at.15.58.38.mov

Compatibility

OS Implemented
iOS
Android
Web

Checklist

  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

@kacperzolkiewski kacperzolkiewski changed the base branch from @kacperzolkiewski/custom-style to @kaceprzolkiewski/feat-custom-style-android June 22, 2026 11:43

Copilot AI 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.

Pull request overview

Adds web support for applying/serializing custom foreground/background colors via a new TipTap mark, updates state reporting so toolbar/UI can reflect active colors, and extends the example web app + Playwright coverage to exercise the new behavior.

Changes:

  • Introduces customStyle TipTap mark for foregroundColor / backgroundColor and wires it into the web editor instance.
  • Updates web HTML normalization to preserve color / background-color spans and updates onChangeState hashing/state to include custom colors.
  • Adds example-web toolbar color pickers and new Playwright e2e + visual/round-trip tests.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/web/useOnChangeState.ts Reads customStyle mark attributes into state and includes them in the state hash to trigger updates.
src/web/normalization/htmlNormalizer.ts Preserves color / background-color on <span> while still converting other CSS styles to inline tags.
src/web/formats/EnrichedCustomStyle.ts New TipTap mark implementing custom foreground/background color styling + commands.
src/web/EnrichedTextInput.tsx Registers the new mark and implements the imperative setStyle API on web using the mark commands.
apps/example-web/src/components/Toolbar.tsx Adds UI controls for selecting/clearing text/background colors.
apps/example-web/src/components/Toolbar.css Styles the new color picker UI.
.playwright/tests/customStyleColors.spec.ts Adds e2e coverage for round-trip serialization, toolbar interaction, and a visual regression snapshot.

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

Comment thread src/web/normalization/htmlNormalizer.ts Outdated
@kacperzolkiewski kacperzolkiewski marked this pull request as ready for review June 22, 2026 15:13

Copilot AI 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.

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.

Comment thread src/web/normalization/tiptapHtmlNormalizer.ts
Comment thread apps/example-web/src/components/Toolbar.tsx
Comment thread apps/example-web/src/components/Toolbar.tsx
Comment thread src/web/EnrichedTextInput.tsx
Comment thread apps/example-web/src/components/Toolbar.css
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