Fix: Code block overflow on mobile in N/M Base docs using responsive grid #476
+24
−40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem: Code block layout overflow on mobile devices in N/M Base documentation
The code examples in the N/M Base documentation page were displayed using a fixed 2-column grid layout (
gridTemplateColumns: '1fr 1fr'), causing horizontal overflow and breaking the layout on mobile devices.Root Cause
The N/M Base documentation page used a fixed 2-column grid layout that caused horizontal overflow on mobile devices.
Solution: Implemented dedicated ExampleGrid component for MDX
Background:
While DevupUI's
Gridcomponent supports responsive arrays, it cannot be used directly in MDX files because the MDX parser (acorn) cannot parse array syntax within JSX:Solution:
Created a separate
.tsxcomponent to be processed by DevupUI's compiler at build time:Design decisions:
Gridcomponent for consistency with existing codebasechildren: ReactNodetype for flexible number of child elementsResult
20251031-0540-55.3463390.mp4
❌ Fixed 2-column grid causes horizontal overflow and content cut off
❌ Users must scroll horizontally to view code examples
✅ Responsive grid: 1 column on mobile, 2 columns on desktop
✅ All content visible and properly laid out within viewport