Skip to content

posts: fix mobile css rendering#54

Merged
gapry merged 1 commit intomainfrom
fix-mobile-css
Apr 1, 2026
Merged

posts: fix mobile css rendering#54
gapry merged 1 commit intomainfrom
fix-mobile-css

Conversation

@gapry
Copy link
Copy Markdown
Owner

@gapry gapry commented Apr 1, 2026

No description provided.

Copy link
Copy Markdown

@amazon-q-developer amazon-q-developer bot left a comment

Choose a reason for hiding this comment

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

The PR addresses mobile CSS rendering issues with a mobile-first approach and enhanced overflow handling. Most changes correctly implement responsive fixes for tables, code blocks, and container widths.

One logic error was identified in src/styles/index.css where flexbox alignment properties are applied to a display: block element, causing them to be ignored until the viewport reaches 801px. This should be corrected to avoid confusion and ensure clean, maintainable CSS.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Comment on lines +3 to 5
display: block;
justify-content: center;
align-items: center;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Logic Error: justify-content and align-items properties have no effect on display: block elements. These flexbox alignment properties are ignored until the display mode changes to flex at 801px, potentially causing confusion during maintenance.

Suggested change
display: block;
justify-content: center;
align-items: center;
display: block;

Copy link
Copy Markdown

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

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 improves the responsive layout and scroll behavior of the application by adjusting body styles, table displays, and scrollbar visibility for markdown content. Key changes include switching the main layout to a block display on mobile while maintaining flex centering on larger screens via media queries. Feedback suggests using "overflow-x: auto" for tables to prevent content clipping on small screens and recommends consolidating CSS rules for markdown elements to improve maintainability and ensure consistent scrollability for code blocks.

border-collapse: collapse;
margin: 20px 0;
font-size: 0.95rem;
overflow-x: hidden;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using overflow-x: hidden on a table that is set to display: block will cause content to be clipped on mobile devices if the table is wider than the viewport. Changing this to auto allows users to scroll horizontally to see all the data, which is the standard approach for responsive tables.

Suggested change
overflow-x: hidden;
overflow-x: auto;

Comment on lines +122 to 132
.markdown-body pre,
.markdown-body div,
.markdown-body code {
scrollbar-width: none !important;
}

.markdown-body pre,
.markdown-body div,
.markdown-body code {
-ms-overflow-style: none !important;
} No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

These two blocks can be combined for better maintainability. Additionally, since MarkdownRenderer.jsx uses div as the container for syntax-highlighted code blocks (via SyntaxHighlighter), the div elements should also have overflow-x: auto !important to ensure they are scrollable on mobile, similar to the pre tag styling on line 102.

Suggested change
.markdown-body pre,
.markdown-body div,
.markdown-body code {
scrollbar-width: none !important;
}
.markdown-body pre,
.markdown-body div,
.markdown-body code {
-ms-overflow-style: none !important;
}
.markdown-body pre,
.markdown-body div {
overflow-x: auto !important;
scrollbar-width: none !important;
-ms-overflow-style: none !important;
}
.markdown-body code {
scrollbar-width: none !important;
-ms-overflow-style: none !important;
}

@gapry gapry merged commit d1250ee into main Apr 1, 2026
2 checks passed
@gapry gapry deleted the fix-mobile-css branch April 1, 2026 15:09
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.

1 participant