Skip to content

Fix mobile code overflow and light/dark mode color variables#10

Merged
HelgeSverre merged 4 commits intomainfrom
copilot/fix-screen-overflow-issue
Dec 26, 2025
Merged

Fix mobile code overflow and light/dark mode color variables#10
HelgeSverre merged 4 commits intomainfrom
copilot/fix-screen-overflow-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 23, 2025

Description

Code snippets in the Quick Start section caused horizontal scrolling on mobile viewports due to long URLs and commands that wouldn't wrap. Additionally, some hardcoded colors weren't adapting properly between light and dark modes.

Changes

  • Added mobile-specific CSS rules (max-width: 640px) to enable text wrapping in code blocks
    • white-space: pre-wrap allows line breaks at appropriate points
    • word-break: break-word forces breaks for long unbreakable strings (URLs, paths)
    • Applied to both .code-block pre and .code-block code elements
  • Replaced hardcoded colors with CSS variables for proper light/dark mode support
    • .sh-comment: Changed color: #3d6a47 to color: var(--syn-comment)
    • .copy-btn.copied: Changed color: #0a0a0a to color: var(--color-bg)
  • Desktop layout unchanged (rules scoped to mobile only)

Screenshots

Mobile view (375px width) - Dark mode:

Mobile view (375px width) - Light mode:

Code now wraps properly without horizontal scrollbars. Long URLs like https://github.com/helgesverre/sql-splitter.git break appropriately. Colors properly adapt between light and dark modes.

Checklist

  • Tests pass (cargo test)
  • Code is formatted (cargo fmt)
  • Linting passes (cargo clippy)
  • Documentation updated (if needed)
Original prompt

fix screen overflow of the code snippet in quick start section that causes horizontal scroll bars on the website on mobile


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: HelgeSverre <1089652+HelgeSverre@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix screen overflow in quick start section for mobile Fix horizontal scroll overflow in Quick Start code blocks on mobile Dec 23, 2025
Copilot AI requested a review from HelgeSverre December 23, 2025 13:45
Copy link
Copy Markdown
Owner

@HelgeSverre HelgeSverre left a comment

Choose a reason for hiding this comment

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

Light mode looks off, make sure lightmode and darkmode cllors are all using variables

Co-authored-by: HelgeSverre <1089652+HelgeSverre@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 23, 2025

Light mode looks off, make sure lightmode and darkmode cllors are all using variables

Fixed in c613ece. Replaced hardcoded colors with CSS variables:

  • .sh-comment now uses var(--syn-comment) instead of #3d6a47
  • .copy-btn.copied now uses var(--color-bg) instead of #0a0a0a

Both light and dark modes now properly use their respective color values from the CSS variable system.

Light mode on mobile

Copilot AI changed the title Fix horizontal scroll overflow in Quick Start code blocks on mobile Fix mobile code overflow and light/dark mode color variables Dec 23, 2025
Copilot AI requested a review from HelgeSverre December 23, 2025 14:56
- Add theme toggle button with sun/moon icons in nav
- Add JavaScript for theme persistence via localStorage
- Fix light mode: nav background, alignment, button colors
- Change CSS from media query to data-theme attribute
@HelgeSverre HelgeSverre marked this pull request as ready for review December 26, 2025 08:57
@HelgeSverre HelgeSverre merged commit 8291750 into main Dec 26, 2025
4 of 5 checks passed
@HelgeSverre HelgeSverre deleted the copilot/fix-screen-overflow-issue branch December 26, 2025 08:57
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