Skip to content

feat: padding and broderradius for blockquotes - #601

Merged
hryhoriiK97 merged 13 commits into
mainfrom
feat/103/padding-and-broderradius-for-blockquotes
Jul 31, 2026
Merged

feat: padding and broderradius for blockquotes#601
hryhoriiK97 merged 13 commits into
mainfrom
feat/103/padding-and-broderradius-for-blockquotes

Conversation

@eszlamczyk

@eszlamczyk eszlamczyk commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

What/Why?

Closes #103.

Adds padding and borderRadius options to markdownStyle.blockquote, implemented the same way as the code block background.

  • borderRadius (default 0) - rounds the full-width blockquote background box. The accent stripe is clipped to the rounded shape, and each nested quote's stripe rounds against its own box, matching per-element border-radius on web.
  • padding (default 0) - inner top/bottom spacing between the background box edges and the quote content (also applies to the trailing edge on iOS and web, same platform behavior as codeBlock.padding). Applied at every nesting level, so nested quotes pad their own box and paddings stack at shared boundaries like nested elements on web. Leading-edge spacing is still borderWidth + gapWidth.

Testing

Example app / storybook - Blockquote stories with the new borderRadius and padding controls, on iOS and Android - including nested quotes, quote as the last document element, and defaults left at 0 (unchanged rendering).

Screenshots

iOS Android
Default (before) image image
Padding: 10, borderRadius: 10 image image

PR Checklist

  • Code compiles and runs on iOS
  • Code compiles and runs on Android
  • Updated documentation/README if applicable
  • Ran example app to verify changes
  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

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

Adds new padding and borderRadius styling options for markdownStyle.blockquote, aligning behavior across web/iOS/Android (and updating example + docs) similarly to the existing code block background/padding behavior.

Changes:

  • Extend public and internal style types + normalization defaults to include blockquote.borderRadius and blockquote.padding.
  • Implement web CSS padding + border-radius for blockquote containers.
  • Implement native (iOS/Android) rendering changes to support rounded backgrounds/stripes and per-nesting padding behavior; update docs and Storybook controls.

Reviewed changes

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

Show a summary per file
File Description
packages/react-native-enriched-markdown/src/web/styles.ts Apply blockquote padding and borderRadius in web CSS styles.
packages/react-native-enriched-markdown/src/types/MarkdownStyleInternal.ts Add borderRadius/padding to internal blockquote style contract.
packages/react-native-enriched-markdown/src/types/MarkdownStyle.ts Expose borderRadius/padding on the public blockquote style type.
packages/react-native-enriched-markdown/src/normalizeMarkdownStyle.web.ts Add default normalized values for web blockquote borderRadius/padding.
packages/react-native-enriched-markdown/src/normalizeMarkdownStyle.ts Add default normalized values for native blockquote borderRadius/padding.
packages/react-native-enriched-markdown/src/EnrichedMarkdownTextNativeComponent.ts Extend Fabric/codegen style types with new blockquote fields.
packages/react-native-enriched-markdown/src/EnrichedMarkdownNativeComponent.ts Extend Fabric/codegen style types with new blockquote fields.
packages/react-native-enriched-markdown/ios/utils/StylePropsUtils.h Propagate new blockquote style fields into StyleConfig.
packages/react-native-enriched-markdown/ios/utils/BlockquoteBorder.m Redesign iOS blockquote drawing to support rounded region boxes + clipped stripes.
packages/react-native-enriched-markdown/ios/utils/BlockquoteBorder.h Export new spacer attribute constant used by renderer logic.
packages/react-native-enriched-markdown/ios/styles/StyleConfig.mm Store/copy new blockquote config fields and add accessors.
packages/react-native-enriched-markdown/ios/styles/StyleConfig.h Declare new blockquote config accessors.
packages/react-native-enriched-markdown/ios/renderer/BlockquoteRenderer.m Add vertical padding spacers and apply tail padding + updated nesting handling.
packages/react-native-enriched-markdown/ios/renderer/AttributedRenderer.m Adjust trailing-spacing trimming to account for padded blockquotes at document end.
packages/react-native-enriched-markdown/ios/internals/MeasurementCache.h Include new blockquote fields in style fingerprint hashing.
packages/react-native-enriched-markdown/android/src/main/java/com/swmansion/enriched/markdown/styles/BlockquoteStyle.kt Parse new blockquote style fields from JS (RN package).
packages/react-native-enriched-markdown/android/src/main/java/com/swmansion/enriched/markdown/spans/BlockquoteSpan.kt Draw rounded background + clip stripes per boundary; account for nested padding.
packages/react-native-enriched-markdown/android/src/main/java/com/swmansion/enriched/markdown/renderer/BlockquoteRenderer.kt Add a boundary padding span to adjust top/bottom metrics per quote.
packages/android-enriched-markdown/ui/src/main/java/com/swmansion/enriched/markdown/styles/DefaultStyles.kt Set default borderRadius/padding for UI package.
packages/android-enriched-markdown/ui/src/main/java/com/swmansion/enriched/markdown/styles/BlockquoteStyle.kt Add new blockquote style fields with defaults (UI package).
packages/android-enriched-markdown/ui/src/main/java/com/swmansion/enriched/markdown/spans/BlockquoteSpan.kt Mirror rounded background + clipped stripe drawing changes (UI package).
packages/android-enriched-markdown/ui/src/main/java/com/swmansion/enriched/markdown/renderer/BlockquoteRenderer.kt Mirror boundary padding span changes (UI package).
docs/STYLES.md Document the new blockquote style options and usage example.
apps/react-native-example/.rnstorybook/stories/components/EnrichedMarkdownText/shared/storybookStyleBuilders.ts Include new blockquote controls in style builder.
apps/react-native-example/.rnstorybook/stories/components/EnrichedMarkdownText/shared/storybookMarkdownStyles.ts Add new Storybook control fields + defaults for blockquote.
apps/react-native-example/.rnstorybook/stories/components/EnrichedMarkdownText/block/Blockquote.stories.tsx Add Storybook controls for borderRadius and padding.

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

@eszlamczyk
eszlamczyk requested a review from hryhoriiK97 July 28, 2026 10:37
@eszlamczyk
eszlamczyk marked this pull request as ready for review July 28, 2026 10:37

@hryhoriiK97 hryhoriiK97 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good! I found one bug - looks like in some cases the bottom-left border radius is not applied on Android (attaching the screenshots). Can you look into this please?

Image Image

@eszlamczyk

Copy link
Copy Markdown
Collaborator Author

Aparently the issues were of-by one calculations for bottom border radius calculations, and the fact that we increased the spacer for padding by changing line heights, that broke when we had two calculations like that line by line. Fixed by implementing it the way iOS does, by adding additional marker that we manip for paddings.

image image

@eszlamczyk
eszlamczyk requested a review from hryhoriiK97 July 31, 2026 08:19
@hryhoriiK97
hryhoriiK97 merged commit 50a082c into main Jul 31, 2026
9 checks passed
@hryhoriiK97
hryhoriiK97 deleted the feat/103/padding-and-broderradius-for-blockquotes branch July 31, 2026 08:53
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.

Add padding and borderRadius option for blockquotes

3 participants