Skip to content

Conversation

@Bregor
Copy link
Owner

@Bregor Bregor commented Oct 26, 2025

Description

Add user-configurable overflow-wrap behavior for table header and body cells to prevent horizontal overflow with long, unbreakable content.

Changes

New CSS variables

  • --vcw-set-table-head-overflow-wrap: Controls word wrapping in table header cells (default: break-word)
  • --vcw-set-table-body-overflow-wrap: Controls word wrapping in table body cells (default: break-word)

Style Settings integration

  • Added "Table head overflow wrap" dropdown setting with three options:
    • break-word (recommended): Breaks words only when necessary
    • normal: Only breaks at spaces (standard behavior)
    • anywhere: Breaks at any character to prevent overflow
  • Added "Table body overflow wrap" dropdown setting with same options
  • Enhanced descriptions with inline explanations for better UX

CSS improvements

  • Refactored preview.css: nested table selectors for better maintainability
  • Refactored source.css: nested table editor selectors
  • Applied overflow-wrap to both preview mode (div.el-table > table) and source/editor mode (.table-wrapper > table.table-editor)
  • Targeted specific cell wrappers for precise control

Motivation

Tables with long URLs, code snippets, or compound words can cause horizontal overflow, breaking the reading experience especially in narrow panels. This change gives users control over how content wraps while maintaining a sensible default (break-word) that prevents overflow without being overly aggressive.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Add user-configurable overflow-wrap behavior for table header and body
cells to prevent horizontal overflow with long, unbreakable content.

**Changes**
New CSS variables
- `--vcw-set-table-head-overflow-wrap`: Controls word wrapping in table
  header cells (default: break-word)
- `--vcw-set-table-body-overflow-wrap`: Controls word wrapping in table
  body cells (default: break-word)

Style Settings integration
- Added "Table head overflow wrap" dropdown setting with three options:
  - `break-word` (recommended): Breaks words only when necessary
  - `normal`: Only breaks at spaces (standard behavior)
  - `anywhere`: Breaks at any character to prevent overflow
- Added "Table body overflow wrap" dropdown setting with same options
- Enhanced descriptions with inline explanations for better UX

CSS improvements
- Refactored `preview.css`: nested table selectors for better maintainability
- Refactored `source.css`: nested table editor selectors
- Applied `overflow-wrap` to both preview mode (`div.el-table > table`) and
  source/editor mode (`.table-wrapper > table.table-editor`)
- Targeted specific cell wrappers for precise control

**Motivation**
Tables with long URLs, code snippets, or compound words can cause
horizontal overflow, breaking the reading experience especially in
narrow panels. This change gives users control over how content wraps
while maintaining a sensible default (break-word) that prevents overflow
without being overly aggressive.
@Bregor Bregor merged commit f2e1650 into main Oct 26, 2025
1 check passed
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