Skip to content

fix(form): improve headings styles#3731

Merged
paulinewahle merged 3 commits intomainfrom
form-headings
Nov 24, 2025
Merged

fix(form): improve headings styles#3731
paulinewahle merged 3 commits intomainfrom
form-headings

Conversation

@Kiarokh
Copy link
Contributor

@Kiarokh Kiarokh commented Nov 24, 2025

Summary by CodeRabbit

  • Style
    • Updated form typography and spacing with a unified typographic system for improved visual consistency.
    • Refined text sizing and color rendering throughout form components.

✏️ Tip: You can customize this high-level summary in your review settings.

Review:

  • Commits are atomic
  • Commits have the correct type for the changes made
  • Commits with breaking changes are marked as such

Browsers tested:

(Check any that applies, it's ok to leave boxes unchecked if testing something didn't seem relevant.)

Windows:

  • Chrome
  • Edge
  • Firefox

Linux:

  • Chrome
  • Firefox

macOS:

  • Chrome
  • Firefox
  • Safari

Mobile:

  • Chrome on Android
  • iOS

We don't use MDC typographic styles anymore
and these classes were misleading
@Kiarokh Kiarokh added visual design Visual styling that may or may not affect usability 🦄✨ yolo labels Nov 24, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 24, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

Refactors form styling by replacing MDC typography class selectors with direct h1 and p element selectors. Introduces a new --limel-form-h1-font-size variable and applies consistent color, margin, spacing, and text rendering properties to form typography, removing hardcoded font sizes and line-heights.

Changes

Cohort / File(s) Summary
Form typography refactoring
src/components/form/form.scss
Replaces .mdc-typography--headline1 and .mdc-typography--body1 selectors with direct h1 and p element selectors. Introduces --limel-form-h1-font-size CSS variable for h1 styling. Applies consistent color token rgb(var(--contrast-1400), 0.8) and explicit margin/spacing/text-rendering properties. Removes hardcoded font sizes and line-heights, consolidating typography rules within form-group contexts.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify visual consistency of typography changes between MDC classes and direct selectors
  • Confirm new --limel-form-h1-font-size variable value aligns with intended design
  • Review margin and spacing adjustments maintain proper visual hierarchy within forms
  • Ensure color token application produces expected contrast and readability

Suggested reviewers

  • adrianschmidt
  • LucyChyzhova

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(form): improve headings styles' clearly describes the main change—improving heading styles in form components—which aligns with the changeset's focus on refactoring h1 and p selectors with unified typography.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-3731/

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 73983ee and 1c50be3.

📒 Files selected for processing (1)
  • src/components/form/form.scss (3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/components/**/*.scss

📄 CodeRabbit inference engine (.cursor/rules/css-class-names-in-components-using-shadow-dom.mdc)

Do not use BEM-style class names in CSS for components, as components use shadow-DOM.

Files:

  • src/components/form/form.scss
**/*.{tsx,scss}

⚙️ CodeRabbit configuration file

**/*.{tsx,scss}: Almost all our components use shadow-DOM. Therefore, we have no need of BEM-style class names in our CSS.

Files:

  • src/components/form/form.scss
🧠 Learnings (8)
📓 Common learnings
Learnt from: adrianschmidt
Repo: Lundalogik/lime-elements PR: 3473
File: .github/PULL_REQUEST_TEMPLATE.md:2-4
Timestamp: 2025-03-04T11:56:37.946Z
Learning: The markdownlint rule MD041 (first line should be a top-level heading) can be skipped for `.github/PULL_REQUEST_TEMPLATE.md` files specifically, since GitHub's UI automatically adds a heading above the PR description when it's displayed.
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3658
File: src/components/profile-picture/profile-picture.scss:120-124
Timestamp: 2025-09-03T07:17:23.267Z
Learning: Issue #3666 in the lime-elements repository tracks the removal of a CSS hack in profile-picture component that overrides icon color via --limel-theme-on-surface-color, to be replaced with proper icon color support in limel-icon-button.
Learnt from: adrianschmidt
Repo: Lundalogik/lime-elements PR: 3703
File: context7.json:24-24
Timestamp: 2025-10-12T21:44:29.530Z
Learning: In the lime-elements repository, CSS custom properties follow a two-tier naming convention: `--lime-*` properties are public API intended for external consumers and are documented in theming guides (e.g., `--lime-primary-color`, `--lime-on-primary-color`), while `--limel-*` properties are internal implementation details used as fallbacks and are not documented for public use (e.g., `--limel-theme-primary-color`). The `--lime-` prefix is used specifically to avoid naming conflicts with third-party code.
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3529
File: src/components/lime-ai-avatar/lime-ai-avatar.scss:24-28
Timestamp: 2025-04-25T14:22:02.157Z
Learning: In lime-elements, CSS custom properties follow a specific naming convention:
1. Internal use variables (not for consumers) are prefixed with `--limel-component-name-`
2. External use variables (intended for consumers) are prefixed with `--component-name-`
Variables documented with JSDoc comments are typically meant for external use.
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3658
File: src/components/profile-picture/profile-picture.scss:7-16
Timestamp: 2025-09-03T07:17:20.420Z
Learning: In Lime Elements, CSS custom property naming follows a specific convention: properties starting with `--limel-` are for internal use only, while properties starting with the component name (e.g., `--profile-picture-border-radius`) are publicly documented and intended for external consumers. Public properties should be documented with JSDoc comments.
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3624
File: src/components/button-group/button-group.scss:115-118
Timestamp: 2025-07-30T14:20:41.791Z
Learning: In lime-elements, CSS custom properties like `--limel-theme-surface-background-color` are applied at :root level via `core-styles.scss` and should be expected to be available without fallbacks. The library's architecture guarantees these theme variables are present, so adding fallbacks would be redundant and go against the design intention.
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3624
File: src/components/button-group/button-group.scss:115-118
Timestamp: 2025-07-30T14:20:41.791Z
Learning: In lime-elements, CSS custom properties like `--limel-theme-surface-background-color` are applied at :root level via `core-styles.scss` and should be expected to be available without fallbacks. The library's architecture guarantees these theme variables are present, so adding fallbacks would be redundant and go against the design intention.
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3518
File: src/components/notched-outline/examples/notched-outline-basic.scss:11-22
Timestamp: 2025-04-14T10:01:18.721Z
Learning: Examples in Lime Elements use Shadow DOM (with `shadow: true` in the component decorator) for style encapsulation, making additional class-based selectors unnecessary. This ensures styles are automatically scoped to each component without leaking to the rest of the application.
📚 Learning: 2025-09-03T07:17:23.267Z
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3658
File: src/components/profile-picture/profile-picture.scss:120-124
Timestamp: 2025-09-03T07:17:23.267Z
Learning: Issue #3666 in the lime-elements repository tracks the removal of a CSS hack in profile-picture component that overrides icon color via --limel-theme-on-surface-color, to be replaced with proper icon color support in limel-icon-button.

Applied to files:

  • src/components/form/form.scss
📚 Learning: 2025-04-17T09:39:36.254Z
Learnt from: adrianschmidt
Repo: Lundalogik/lime-elements PR: 3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-17T09:39:36.254Z
Learning: For lime-elements, example files should import types from the public API using 'limetech/lime-elements' rather than defining duplicate types locally. This includes types like `EditorUiType` which are part of the component's public API.

Applied to files:

  • src/components/form/form.scss
📚 Learning: 2025-07-21T00:27:58.489Z
Learnt from: CR
Repo: Lundalogik/lime-elements PR: 0
File: .cursor/rules/css-class-names-in-components-using-shadow-dom.mdc:0-0
Timestamp: 2025-07-21T00:27:58.489Z
Learning: Applies to src/components/**/*.scss : Do not use BEM-style class names in CSS for components, as components use shadow-DOM.

Applied to files:

  • src/components/form/form.scss
📚 Learning: 2025-09-03T07:17:20.420Z
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3658
File: src/components/profile-picture/profile-picture.scss:7-16
Timestamp: 2025-09-03T07:17:20.420Z
Learning: In Lime Elements, CSS custom property naming follows a specific convention: properties starting with `--limel-` are for internal use only, while properties starting with the component name (e.g., `--profile-picture-border-radius`) are publicly documented and intended for external consumers. Public properties should be documented with JSDoc comments.

Applied to files:

  • src/components/form/form.scss
📚 Learning: 2025-04-25T14:22:02.157Z
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3529
File: src/components/lime-ai-avatar/lime-ai-avatar.scss:24-28
Timestamp: 2025-04-25T14:22:02.157Z
Learning: In lime-elements, CSS custom properties follow a specific naming convention:
1. Internal use variables (not for consumers) are prefixed with `--limel-component-name-`
2. External use variables (intended for consumers) are prefixed with `--component-name-`
Variables documented with JSDoc comments are typically meant for external use.

Applied to files:

  • src/components/form/form.scss
📚 Learning: 2025-10-12T21:44:29.530Z
Learnt from: adrianschmidt
Repo: Lundalogik/lime-elements PR: 3703
File: context7.json:24-24
Timestamp: 2025-10-12T21:44:29.530Z
Learning: In the lime-elements repository, CSS custom properties follow a two-tier naming convention: `--lime-*` properties are public API intended for external consumers and are documented in theming guides (e.g., `--lime-primary-color`, `--lime-on-primary-color`), while `--limel-*` properties are internal implementation details used as fallbacks and are not documented for public use (e.g., `--limel-theme-primary-color`). The `--lime-` prefix is used specifically to avoid naming conflicts with third-party code.

Applied to files:

  • src/components/form/form.scss
📚 Learning: 2025-07-30T14:20:41.791Z
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3624
File: src/components/button-group/button-group.scss:115-118
Timestamp: 2025-07-30T14:20:41.791Z
Learning: In lime-elements, CSS custom properties like `--limel-theme-surface-background-color` are applied at :root level via `core-styles.scss` and should be expected to be available without fallbacks. The library's architecture guarantees these theme variables are present, so adding fallbacks would be redundant and go against the design intention.

Applied to files:

  • src/components/form/form.scss
🪛 GitHub Check: SonarCloud Code Analysis
src/components/form/form.scss

[warning] 256-256: Unexpected duplicate selector "h1", first used at line 247

See more on https://sonarcloud.io/project/issues?id=Lundalogik_lime-elements&issues=AZq1ZpKp0yD7vn01KQKl&open=AZq1ZpKp0yD7vn01KQKl&pullRequest=3731

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Docs / Publish Docs
  • GitHub Check: Build
  • GitHub Check: Test
🔇 Additional comments (2)
src/components/form/form.scss (2)

163-189: Refactor looks good, but verify color value syntax.

The switch from MDC typography classes to direct h1/p element selectors is a clean approach, and the new --limel-form-h1-font-size variable follows the internal naming convention correctly. However, I need to verify the color syntax used in the nested selectors.


205-275: Ensure consistent font-weight throughout nesting levels.

Font-weight is explicitly defined for h1 at levels 1-3 (800, 700, 600), but levels 4 and beyond (lines 247, 256, 265) don't specify a font-weight. Verify if this is intentional and if deeper nesting levels should inherit the last specified weight or have their own progression.

Comment on lines +200 to 203
h1,
p {
color: rgb(var(--contrast-1400), 0.8);
}
Copy link

@coderabbitai coderabbitai bot Nov 24, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

Verify the RGB color syntax with opacity.

Line 202 uses rgb(var(--contrast-1400), 0.8). This syntax mixes an RGB channel value with what appears to be an opacity value, but rgb() doesn't accept opacity as a third parameter (that would be rgba()). Please confirm this is the intended syntax and follows patterns elsewhere in the codebase.


🏁 Script executed:

#!/bin/bash
# Verify color syntax pattern in form.scss and related style files
rg -n 'rgb\(var\(' src/components/form/ --type scss
rg -n 'rgba\(var\(' src/components/form/ --type scss
rg -n 'rgb\(.*,.*,.*,.*\)' src/ --type scss | head -20

Length of output: 86


I'll re-run the verification with corrected syntax, as rg doesn't recognize .scss as a type in this environment.


---

🏁 Script executed:

```shell
#!/bin/bash
# Verify color syntax patterns in SCSS files using file glob pattern
echo "=== Searching for rgb(var( patterns ==="
rg -n 'rgb\(var\(' src/components/ -g "*.scss"

echo "=== Searching for rgba(var( patterns ==="
rg -n 'rgba\(var\(' src/components/ -g "*.scss"

echo "=== Checking the specific file at line 202 ==="
cat src/components/form/form.scss | head -210 | tail -15

echo "=== Looking for RGB with 4+ comma-separated values ==="
rg -n 'rgb\([^)]*,[^)]*,[^)]*,[^)]*\)' src/ -g "*.scss" | head -20

Length of output: 52253


I need to verify whether the rgb() function with an opacity parameter is valid CSS syntax, as the pattern appears extensively throughout the codebase.


---

🌐 Web query:

```web
Does CSS rgb() function support opacity parameter modern syntax

💡 Result:

Yes — the modern rgb() supports an optional alpha (opacity) using the space‑separated + slash syntax. Example: rgb(255 0 0 / 0.5). This is defined in CSS Color Module Level 4 and documented on MDN. [1][2]

References:

  • MDN: rgb() (syntax and alpha via "/"). [1]
  • W3C: CSS Color Module Level 4 (modern space‑separated syntax, alpha separated by "/"). [2]

Correct the invalid RGB color syntax to use the modern CSS standard.

The syntax rgb(var(--contrast-1400), 0.8) at line 202 is indeed invalid. Modern CSS Color Module Level 4 specifies that opacity should be separated by a forward slash using space-separated syntax: rgb(var(--contrast-1400) / 0.8).

This issue extends across the codebase—100+ instances of the same incorrect pattern exist (e.g., rgb(var(...), opacity) instead of rgb(var(...) / opacity)) in files like split-button.scss, linear-progress.scss, code-editor.scss, table/_row-selection.scss, and many others.

Update line 202 and all similar instances to use the correct syntax: rgb(var(--contrast-1400) / 0.8).

🤖 Prompt for AI Agents
In src/components/form/form.scss around lines 200–203 the color declaration uses
invalid CSS syntax `rgb(var(--contrast-1400), 0.8)`; replace it with the modern
CSS Color Module Level 4 format using a slash for alpha:
`rgb(var(--contrast-1400) / 0.8)`. Search the repository for other occurrences
of `rgb(var(...),` followed by an opacity and update them similarly (e.g.,
split-button.scss, linear-progress.scss, code-editor.scss,
table/_row-selection.scss and the ~100 other instances) to use `rgb(var(...) /
<alpha>)`, ensuring spacing is correct and running style/lint checks after
changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@coderabbitai is this incorrect or just "old" standard? These styles work fine.

Copy link

Choose a reason for hiding this comment

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

🧩 Analysis chain

🌐 Web query:

CSS rgb() comma-separated syntax with alpha opacity browser support

💡 Result:

Short answer: The comma-separated four‑argument form (e.g. rgb(255,0,0,0.5)) is the legacy/compat form and is widely supported by browsers. Modern CSS uses the space + slash syntax (e.g. rgb(255 0 0 / 0.5)); that is the current spec recommendation though the legacy comma form remains accepted for compatibility. [1][2]

Sources:

  • MDN: rgb() (notes legacy comma syntax and modern space+/slash syntax). [1]
  • CSS-Tricks: explanation of legacy (comma) vs modern (space/slash) rgb() syntaxes. [2]

References:
[1] MDN rgb() — https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb
[2] CSS-Tricks — rgb() article.


@Kiarokh You're absolutely right, and I apologize for the incorrect characterization. The comma-separated syntax rgb(var(--contrast-1400), 0.8) is the legacy/compatibility form and is widely supported by browsers.

It's not invalid - it's an older standard that still works perfectly fine. Modern CSS Color Module Level 4 recommends the space + slash syntax (e.g., rgb(var(--contrast-1400) / 0.8)), but the legacy comma form remains accepted for compatibility.

Since this syntax works correctly and is supported across browsers, there's no urgent need to change it. The modern syntax is simply the current specification recommendation, but your existing code is fine. My previous comment was overly alarming - thank you for questioning it!


🧠 Learnings used
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3658
File: src/components/profile-picture/profile-picture.scss:120-124
Timestamp: 2025-09-03T07:17:23.267Z
Learning: Issue #3666 in the lime-elements repository tracks the removal of a CSS hack in profile-picture component that overrides icon color via --limel-theme-on-surface-color, to be replaced with proper icon color support in limel-icon-button.

Learnt from: adrianschmidt
Repo: Lundalogik/lime-elements PR: 3473
File: .github/PULL_REQUEST_TEMPLATE.md:2-4
Timestamp: 2025-03-04T11:56:37.946Z
Learning: The markdownlint rule MD041 (first line should be a top-level heading) can be skipped for `.github/PULL_REQUEST_TEMPLATE.md` files specifically, since GitHub's UI automatically adds a heading above the PR description when it's displayed.

@paulinewahle paulinewahle merged commit a42732e into main Nov 24, 2025
12 checks passed
@paulinewahle paulinewahle deleted the form-headings branch November 24, 2025 13:00
@lime-opensource
Copy link
Collaborator

🎉 This PR is included in version 38.30.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

released visual design Visual styling that may or may not affect usability 🦄✨ yolo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants