apache / apache/apisix-website

[Site]: Enhance code samples table with responsive design and horizontal scroll for mobile devices

Open
#1,965 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
146
Forks
204
Avg merge
2d 3h
Merged PRs (30d)
21

Description

### Current State

**Description of the current state/issue**:

The current code samples table on `/docs/general/code-samples/` has several usability issues:
- Table columns are not fully visible on small devices without horizontal scrolling
- Text overlap occurs on mobile screens, making content unreadable
- No sticky column functionality for context preservation during scroll
- Inconsistent responsive behavior across different device sizes
- Poor user experience on mobile devices when accessing all 7 table columns

## Proposed Solution
Implement comprehensive responsive table enhancements to improve accessibility and user experience across all device types:

### Desktop & Large Screens (>1024px)
- All 7 columns visible without horizontal scrolling
- Proper table centering and positioning
- Enhanced column widths for better content display

### Tablets (601px - 1024px)
- Responsive layout with text ellipsis for overflow content
- Fixed table layout to fit all columns within screen width
- No horizontal scrolling required

### Mobile Devices (≤600px)
- Horizontal scroll functionality with touch optimization
- Sticky first column (Title) for context preservation during scroll
- Text wrapping enabled for long content in Description, Source code, Tutorial, and Category columns
- All 7 columns accessible via smooth horizontal scrolling
- Visual separators between columns for better content organization

## Expected Outcome
- Improved user experience across all device types
- Full accessibility to all table content on mobile devices
- Professional appearance with modern responsive design
- Better readability with proper text wrapping and spacing
- Smooth horizontal scrolling experience on touch devices

## Files to be Modified
- [website/src/css/customTheme.scss]
- [website/docs/general/code-samples.md]

**Link to the page**:
https://apisix.apache.org/docs/general/code-samples/

# **Before vs After Screenshots**

## **Before**
Screenshot 1
Screenshot 2

## **After**
Screenshot 3
Screenshot 4

### Desired State

**Description of the change you are proposing**:

This PR enhances the code samples table with comprehensive responsive design and improved mobile accessibility. The changes address usability issues on small devices and provide a better user experience across all screen sizes.

### Would you like to fix this issue?

Yes! Count me in

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading website/src/css/customTheme.scss and website/docs/general/code-samples.md, then open /docs/general/code-samples/ at desktop, tablet, and mobile widths. Check the existing table markup and styles against the listed breakpoints. Done means all seven columns remain usable, mobile supports touch horizontal scrolling with a sticky Title column, and text no longer overlaps.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown, scss
Domain
accessibility, design, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.