-
Notifications
You must be signed in to change notification settings - Fork 79
[MarkdownTextBlock] Add a lot more styling properties #729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @niels9001! This is great to see, massively helpful.
To give us a clear picture on the coverage here, I've taken source code inventories and comparisons (all manually triple checked) using Copilot locally to evaluate feature parity between the 7x and 8x versions of MarkdownTextBlock before and after your PR.
Here follows a brief summary of my findings, what it means for 7x/8x feature parity progress in your PR, and what feature parity work still remains on this component.
Summary
- Restores the majority of 7x styling capabilities to Labs 8x.
- Adds per-heading foregrounds, robust code/quote/table/list/hr/image/link styling, and
IsTextSelectionEnabled. - Removes shared
HeadingForegroundin favor of H1–H6 foregrounds; tweaks some defaults (H1 weight, H1–H4 margins). - Approximately 33 of 48 previously missing properties are covered; ~15 remain (non-blocking for this PR).
What this PR adds
- Headings:
H1Foreground…H6Foreground(replacesHeadingForeground). - Code blocks: background, border brush/thickness, padding, margin, font family, foreground, corner radius.
- Quotes: background, border brush/thickness, foreground, margin, padding, corner radius.
- Tables: border brush/thickness, cell padding, table margin.
- Paragraph/List: paragraph margin, line height, list bullet spacing, gutter width, list margin.
- Horizontal rule: brush, thickness, margin.
- Links: foreground applied across Markdown/HTML/hyperlink button paths.
- Images: max width/height constraints, stretch mode.
- YAML: border brush/thickness placeholders.
- Control:
IsTextSelectionEnableddependency property.
Validation performed
- Comprehensive property inventory: Catalogued all 71 properties from the original 7x control across 12 categories (headers, code blocks, inline code, quotes, tables, lists, paragraphs, horizontal rules, images, links, YAML, and general functionality).
- Baseline 8x assessment: Documented the 43 properties available in Labs before this PR (32 theme properties + 11 dependency properties), identifying a 48-property gap representing 78% missing functionality.
- PR delta analysis: Extracted and categorized all 35 new properties from the patch/diff, mapping each to specific 7x equivalents and noting architectural changes (e.g.,
HeadingForeground→ per-level foregrounds). - Implementation verification: Confirmed through diff inspection that properties are actively wired into renderers and components:
- Headings (
MyHeading), code blocks (MyCodeBlock), quotes (MyQuote), tables (MyTable,MyTableCell,MyTableUIElement), thematic breaks (MyThematicBreak), links (MyHyperlink,MyHyperlinkButton,HtmlWriter), paragraphs/lists (MyParagraph), images (MyImage).
- Headings (
- Gap closure calculation: Determined that 33 of the original 48 missing properties are now covered (~69% gap closure), with remaining gaps primarily in advanced scenarios (syntax highlighting, URI customization, etc.).
- Sample configuration validation: The provided comprehensive
MarkdownThemesconfig exercises the new styling surface across all element types, demonstrating practical usage patterns.
Non-blocking follow-ups (parity gaps)
- Syntax highlighting: bring back 7x-level support (
UseSyntaxHighlighting, token style surface /CodeStyling). - Layout toggles: expose
TextWrappingand code-block wrap control (WrapCodeBlock). - URI customization:
UriPrefix,SchemeListequivalents for app navigation. - Emoji font:
EmojiFontFamilyor equivalent. - Live updates: consider DP-ifying theme props or adding a change-notification/refresh hook.
Notes on defaults/breaks
HeadingForegroundremoved in favor of per-level foregrounds (clearer, more flexible).- Defaults adjusted:
H1FontWeight→ SemiBold; H1–H4 top margins 14 → 16.
Approval
- LGTM — this is a substantial step toward styling parity and a clear improvement for consumers. Approving PR #729.
Suggested tracking checklist
- Design/implement syntax highlighting surface and behavior
- Consider
TextWrappingand code-wrap options - Evaluate
UriPrefix/SchemeListequivalents - Consider DP or refresh mechanism for
MarkdownThemes - Optional: Emoji font handling
I asked Copilot to help me bridge the gap between styling properties of the former
MarkdownTextblockwith this version.HeadingsForegroundforeground in favor of H1/H2/etc. foreground properties.To validate, add this config: