Skip to content

fix: resolve invalid CSS percentage value for lineHeight in RhythmRuler#6737

Open
CodeBySayak wants to merge 1 commit intosugarlabs:masterfrom
CodeBySayak:lineh
Open

fix: resolve invalid CSS percentage value for lineHeight in RhythmRuler#6737
CodeBySayak wants to merge 1 commit intosugarlabs:masterfrom
CodeBySayak:lineh

Conversation

@CodeBySayak
Copy link
Copy Markdown
Contributor

Problem

The RhythmRuler widget was setting an invalid CSS value for the lineHeight property of its ruler cells. In js/widgets/rhythmruler.js, the code was:

rulerSubCell.style.lineHeight = 60 + " % ";

This produced the string "60 % ". According to CSS standards, percentage values must not contain whitespace between the number and the percent sign. This invalid syntax often causes browsers to ignore the property, leading to inconsistent vertical alignment of note labels within the cells.

Solution

Corrected the lineHeight assignment to a valid CSS percentage string:

rulerSubCell.style.lineHeight = "60%";

Changes

  • File: js/widgets/rhythmruler.js
  • Correction: Removed spaces in the percentage string to comply with CSS syntax rules.

Impact

  • Ensures proper vertical text centering in RhythmRuler cells.
  • Cleans up "invalid property value" warnings in browser developer tools.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change
  • Documentation update

closes #6736

@github-actions github-actions bot added bug fix Fixes a bug or incorrect behavior size/XS Extra small: < 10 lines changed area/javascript Changes to JS source files labels Apr 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

✅ All Jest tests passed! This PR is ready to merge.

Coverage: Statements: 42.54% | Branches: 35.12% | Functions: 46.7% | Lines: 42.95%

Copy link
Copy Markdown
Contributor

@Ashutoshx7 Ashutoshx7 left a comment

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/javascript Changes to JS source files bug fix Fixes a bug or incorrect behavior size/XS Extra small: < 10 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI/UX] Invalid CSS for Line Height

2 participants