Skip to content

Fix .videowrapper and update button and search components for consistency in text labels - #491

Merged
mlsmaycon merged 2 commits into
mainfrom
nowrap-button-fix
Nov 22, 2025
Merged

Fix .videowrapper and update button and search components for consistency in text labels#491
mlsmaycon merged 2 commits into
mainfrom
nowrap-button-fix

Conversation

@TechHutTV

@TechHutTV TechHutTV commented Nov 21, 2025

Copy link
Copy Markdown
Collaborator

Fix: YouTube video aspect ratio and alignment issues

Problem

When zooming out, embedded YouTube videos would:

  • Stretch vertically, distorting thumbnails
  • Take up the full page width instead of staying aligned with text content
  • Not maintain proper 16:9 aspect ratio at different zoom levels

Before

Screenshot 2025-11-21 at 4 30 56 PM

After

Screenshot 2025-11-21 at 4 31 03 PM

Solution

Updated .videowrapper and .videowrapperadjusted classes to use modern CSS:

Changes made:

  • Replaced padding-bottom hack with aspect-ratio: 16 / 9 for reliable 16:9 ratio
  • Added responsive max-width constraints matching prose content area:
    • 40rem on screens < 1024px
    • 50rem on screens ≥ 1024px
  • Set margin-left: 10px and margin-right: auto to align videos with text content

File: src/styles/tailwind.css

Benefits

  • ✅ Videos maintain correct 16:9 aspect ratio at all zoom levels
  • ✅ Videos stay aligned with text content instead of spanning full width
  • ✅ No vertical stretching or distortion
  • ✅ Consistent layout across different screen sizes
  • ✅ Uses modern CSS instead of legacy padding-bottom hack

Fix: Prevent UI elements from wrapping when zoomed in

Problem

When users zoom in on the documentation site, text in UI components like the search bar and buttons would wrap to multiple lines, causing layout issues and making the interface look awkward.

Before

Screenshot 2025-11-21 at 10 24 56 AM

After

Screenshot 2025-11-21 at 10 21 00 AM

Changes Made

1. Shortened Search Placeholder Text

  • Changed placeholder text from "Find something..." to "Search..." in the Search component
  • Updated in 5 locations:
    • Autocomplete placeholder configuration
    • Desktop search button text
    • Mobile search button aria-label
    • SearchButton component
    • MobileSearch component

File: src/components/Search.jsx

2. Prevented Button Text Wrapping

  • Added whitespace-nowrap CSS class to the Button component
  • Ensures all buttons (including "Try NetBird") maintain single-line text regardless of zoom level
  • Button width will now automatically expand to accommodate text instead of wrapping

File: src/components/Button.jsx

Benefits

  • ✅ Improved accessibility at higher zoom levels
  • ✅ Cleaner, more professional UI appearance
  • ✅ Consistent single-line text display across all buttons
  • ✅ Better user experience for users who need larger text sizes

Testing

Verify that:

  • Search bar displays "Search..." placeholder text
  • "Try NetBird" button text stays on one line when zoomed in
  • All other buttons throughout the site maintain single-line text at various zoom levels

- Changed button class to prevent text overflow by adding 'whitespace-nowrap'.
- Updated placeholder and button text from 'Find something...' to 'Search...' for clarity and uniformity across the search components.
- Adjusted aria-labels to match the updated button text for improved accessibility.
@TechHutTV TechHutTV changed the title Update button and search components for consistency in text labels Fix .videowrapper and update button and search components for consistency in text labels Nov 21, 2025
@mlsmaycon
mlsmaycon merged commit c40c132 into main Nov 22, 2025
1 check passed
@mlsmaycon
mlsmaycon deleted the nowrap-button-fix branch November 22, 2025 09: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.

2 participants