Skip to content

Conversation

Kiarokh
Copy link
Contributor

@Kiarokh Kiarokh commented Jul 29, 2025

fix #3623

Summary by CodeRabbit

  • New Features

    • Added a comprehensive theming guide to help users customize fonts and accent colors for UI components.
  • Style

    • Updated all components to use new theme-based CSS variables for colors and font sizes, replacing hardcoded values and legacy theme variables.
    • Introduced a default font size variable for consistent typography across components.
    • Improved color customization by supporting accent color overrides and enhanced fallback mechanisms.
    • Removed unused and internal style files to streamline theming and reduce redundancy.
  • Documentation

    • Included detailed instructions and best practices for theming and accessibility in the new theming guide.

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

Copy link

coderabbitai bot commented Jul 29, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

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

This change removes all dependencies on internal MDC theming and variables, replacing them with new or updated CSS custom properties prefixed with --lime- or --limel-theme-. It introduces a new theming guide, updates component and utility styles to use the new variables, and removes obsolete SCSS files and imports.

Changes

Cohort / File(s) Change Summary
Theming Documentation
src/theming.md, guides.ts
Adds a comprehensive theming guide and includes it in the documentation navigation.
Removal of Internal Theme/Variables SCSS
src/style/internal/lime-theme.scss, src/style/internal/lime-typography.scss, src/style/internal/variables.scss, src/style/brand-colors.scss
Deletes obsolete SCSS files for theming, typography, variables, and brand colors.
Global & Theme Variables Update
src/global/core-styles.scss, src/style/_theme-color-variables.scss, src/style/mixins.scss, src/style/shadows.scss
Introduces/updates global CSS variables for theming, removes MDC fallbacks, and updates mixin defaults to new theme variables.
Component Styles: Remove Theme Imports & Update Variables
src/components/**/*.{scss,tsx} (multiple files)
Removes imports of internal theme/variables, replaces MDC CSS variables with --lime-/--limel-theme- variables, updates font sizes to use --limel-theme-default-font-size, and updates color fallbacks for accent and error states.
Component Examples & Design Guidelines
src/components/form/examples/map-component.scss, src/design-guidelines/action-buttons/examples/action-buttons.scss, src/examples/example-event-printer.scss
Updates font size usage to reference the new theme variable instead of hardcoded values.

Sequence Diagram(s)

sequenceDiagram
    participant ConsumerApp
    participant LimeElements
    Note over ConsumerApp: Sets <br> --lime-primary-color <br> --lime-on-primary-color <br> (optionally on :root or body)
    ConsumerApp->>LimeElements: Loads components
    LimeElements->>LimeElements: Components read CSS variables
    LimeElements->>LimeElements: Apply accent color and font size using new variables
    LimeElements-->>ConsumerApp: Render themed UI
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Assessment against linked issues

Objective Addressed Explanation
Allow consumers to use a global accent color for theming via CSS variables (--lime-primary-color, --lime-on-primary-color) (#3623)
Remove all MDC theming CSS custom variables and replace with new theme variables (#3623)
Provide documentation explaining available theming options and variables (#3623)
Ensure all components use new theme variables for colors and font sizes (#3623)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Possibly related PRs

Suggested labels

visual design, maintenance

Suggested reviewers

  • LucyChyzhova
  • adrianschmidt
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch theme-cleanup-v2

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

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

@Kiarokh Kiarokh force-pushed the theme-cleanup-v2 branch from 3624822 to 3f26ea1 Compare July 30, 2025 10:13
@Kiarokh Kiarokh force-pushed the theme-cleanup-v2 branch 5 times, most recently from 43f5499 to 0e52a2d Compare July 30, 2025 13:45
@Kiarokh Kiarokh marked this pull request as ready for review July 30, 2025 13:50
@Copilot Copilot AI review requested due to automatic review settings July 30, 2025 13:50
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses theming improvements by introducing standardized CSS custom properties and adding comprehensive theming documentation. The changes aim to provide better theming capabilities while maintaining backward compatibility.

  • Replaces legacy MDC theme variables with new standardized --limel-theme-* properties throughout the codebase
  • Adds a new theming documentation file explaining font customization and accent color configuration
  • Consolidates font size references to use a single --limel-theme-default-font-size variable

Reviewed Changes

Copilot reviewed 70 out of 70 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/theming.md New comprehensive theming documentation covering font family and accent color customization
src/style/_theme-color-variables.scss Updated theme color variables with new standardized naming convention
src/global/core-styles.scss Added default font size variable definition
Multiple component SCSS files Replaced legacy MDC theme variables with new standardized properties
guides.ts Added theming documentation to the navigation structure
Comments suppressed due to low confidence (2)

src/theming.md:57

  • Missing closing parenthesis in the rgb() function. Should be rgb(var(--color-gray-lighter)) instead of rgb(var(--color-gray-lighter).
    --lime-on-primary-color: rgb(var(--color-gray-lighter); /* Text/icons on primary color */

src/components/switch/switch.tsx:142

  • Extra semicolon inside the string value. The semicolon should be outside the string or removed. Should be color: 'var(--lime-primary-color, var(--limel-theme-primary-color))' without the semicolon inside the quotes.
                    color: 'var(--lime-primary-color, var(--limel-theme-primary-color));',

@Kiarokh Kiarokh force-pushed the theme-cleanup-v2 branch from 1a6249e to 415eb25 Compare July 30, 2025 13:53
@coderabbitai coderabbitai bot changed the title @coderabbitai Refactor theming system to use centralized Lime Elements CSS variables Jul 30, 2025
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: 40

🔭 Outside diff range comments (7)
src/components/breadcrumbs/breadcrumbs.scss (1)

12-14: Duplicate custom-property definition will shadow itself
--limel-breadcrumbs-gap is declared twice (Lines 12–13). One of them is redundant and risks confusion when inspecting computed styles.

-    --limel-breadcrumbs-gap: 0.75rem;
src/components/dialog/dialog.scss (1)

90-96: Mirror the fallback strategy used elsewhere

Same concern as in collapsible-section.scss: relying on a single CSS-variable with no default risks rendering content in the browser default colour. Add the old contrast-based fallback.

-        color: var(--limel-theme-on-surface-color);
+        color: var(--limel-theme-on-surface-color, rgb(var(--contrast-900)));
src/components/markdown/partial-styles/_tables.scss (1)

24-30: Guard table cell font size with a fallback

For consistency with _body-text.scss, safeguard the variable with the previous literal value.

-        font-size: var(--limel-theme-default-font-size); // 14px
+        font-size: var(--limel-theme-default-font-size, 0.875rem); // 14 px
src/components/switch/switch.tsx (1)

136-155: Return value should be wrapped in <Host> instead of a hard-coded array

Stencil recommends wrapping multiple top-level elements in its special <Host> component instead of returning an array literal.

src/components/form/row/row.scss (1)

72-85: Colour variables updated, but MDC typography variables remain

Lines 77 and 83 now use the new Lime theme colour tokens—great.
However, the adjacent font-size declarations still rely on deprecated MDC tokens (--mdc-typography-*). For complete removal of MDC dependencies (stated PR goal), consider migrating these as well, e.g.:

-        font-size: var(--mdc-typography-subtitle1-font-size, 0.875rem);
+        font-size: var(--limel-theme-default-font-size);
...
-        font-size: var(--mdc-typography-body2-font-size, 0.8125rem);
+        font-size: calc(var(--limel-theme-default-font-size) * 0.93);

(or another ratio that keeps the visual hierarchy).

This keeps the file fully aligned with the new theming strategy.

src/components/table/table.scss (1)

3-3: Tabulator SCSS import path is outdated

According to earlier work (PR #3478) Tabulator 6 exposes its SCSS at
node_modules/tabulator-tables/dist/scss/tabulator.scss, while the old src/scss/ path vanished.

Failing to update this will break CI for anyone on the new Tabulator version.

-@import '../../../node_modules/tabulator-tables/src/scss/tabulator.scss';
+@import '../../../node_modules/tabulator-tables/dist/scss/tabulator.scss';
src/components/tab-bar/tab-bar.scss (1)

147-162: Colour-variable naming is inconsistent with other components

Most components use --limel-theme-text-primary-on-background-color, but here the default label colour is --limel-theme-on-surface-color. Keeping one canonical name reduces cognitive load and doc noise. Please unify or add an alias.

♻️ Duplicate comments (2)
src/components/date-picker/flatpickr-adapter/flatpickr-adapter.scss (1)

289-294: Duplicate primary-colour chain here as well

Will be solved automatically if the earlier “single source of truth” refactor is applied.

src/style/_theme-color-variables.scss (1)

24-35: RGBA written with rgb() – duplicate of earlier remark

rgb(var(--contrast-1700), 0.38) (and the other two occurrences) is still invalid. Use either rgba() or the modern slash syntax rgb(<r g b> / <alpha>).
Same issue was flagged in previous review → not repeating details.

@Kiarokh Kiarokh force-pushed the theme-cleanup-v2 branch 2 times, most recently from 6fcd224 to 70163a8 Compare July 30, 2025 14:34
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: 8

♻️ Duplicate comments (22)
src/components/markdown/partial-styles/_headings.scss (1)

21-23: h6 still hard-coded – align with theme variable for full consistency
Same remark as in earlier review; please consider using var(--limel-theme-default-font-size) or introducing a dedicated size token.

src/examples/example-event-printer.scss (1)

12-12: Inline comment still misleading
The font size is now driven by --limel-theme-default-font-size, but the trailing comment implies a hard-coded 14 px value. Update or drop the comment to avoid confusion.

src/components/collapsible-section/collapsible-section.scss (1)

101-104: Consider component-level override or fallback
Using the global --limel-theme-on-surface-color directly means consumers must override that global token to tweak just the title color. A component-specific variable (e.g., --collapsible-section-title-color) cascading from the theme token would provide finer control.

src/components/chip-set/chip-set.scss (1)

157-161: Delimiter color hard-wired to global token
For finer theming control expose --chip-set-delimiter-color that falls back to --limel-theme-on-surface-color instead of hard-coding the global token.

src/components/banner/banner.scss (1)

8-10: Fixed min-height hard-codes size again – expose via custom property
A previous review already flagged this exact concern; the issue is still present after the refactor.

src/style/internal/codemirror-tooltip.scss (2)

7-11: Color fallback still differs from background fallback
Background‐color falls back to the public --lime-* token first, but color does not. If this was intentional, feel free to ignore; otherwise, mirror the same fallback pattern for consistency.


14-16: Font-size still lacks a hard fallback
Previous feedback suggested adding a pixel/rem fallback in case the theme variable is missing. Re-evaluate whether you want that safeguard or keep relying on the root guarantee.

src/components/notched-outline/notched-outline.scss (1)

180-186: Still missing public --lime-error-color / --lime-error-text-color fallbacks

Previous review already highlighted this. Other components use var(--lime-error-color, var(--limel-theme-error-color)) (and the same for *-text-color) so end-users can override the error colour.
Please mirror that pattern here to keep theming consistent.

Also applies to: 193-194

src/components/table/partial-styles/tabulator-paginator.scss (2)

40-42: Add public surface background fallback

background-color should first try --lime-surface-background-color then fall back to --limel-theme-surface-background-color, like the rest of the refactor.


85-86: Expose on-surface colour to consumers

Replace the single internal variable with
var(--lime-on-surface-color, var(--limel-theme-on-surface-color)) for both the arrow border (left-color) and background so users can theme the paginator.

Also applies to: 95-95

src/components/slider/slider.scss (1)

45-47: Use theme font-size variable instead of hard-coded 13 px

Same issue noted earlier: replace 0.8125rem with
var(--limel-theme-default-font-size) for consistency with the rest of the PR.

-    .mdc-slider__value-indicator-text {
-        font-size: 0.8125rem; //13px
-    }
+    .mdc-slider__value-indicator-text {
+        font-size: var(--limel-theme-default-font-size);
+    }
src/components/slider/partial-styles/_thumb.scss (1)

73-76: Add hard-coded fallback to prevent transparent thumb indicator

Both the value-indicator arrow (Line 73-76) and bubble (Line 91-94) rely solely on CSS variables. If neither --lime-primary-color nor --limel-theme-primary-color is defined, the indicator becomes transparent and unreadable. Re-add a static fallback (e.g. teal default) as proposed earlier.

 border-top-color: var(
     --lime-primary-color,
     var(--limel-theme-primary-color),
+    rgb(var(--color-teal-default))
 );
 ...
 background-color: var(
     --lime-primary-color,
     var(--limel-theme-primary-color),
+    rgb(var(--color-teal-default))
 );

Also applies to: 91-94

src/components/list/list.scss (1)

259-265: Selected row still lacks on-primary text colour

Background switches to the primary colour but text keeps the default table colour, causing illegibility on dark themes. Please add the corresponding text override.

 .mdc-deprecated-list-item.mdc-deprecated-list-item--selected {
     &:before {
         background-color: var(
             --lime-primary-color,
             var(--limel-theme-primary-color)
         );
         opacity: 0.15;
+    }
+
+    color: var(
+        --lime-on-primary-color,
+        var(--limel-theme-on-primary-color)
     );
 }
src/components/select/select.scss (2)

39-40: Provide pixel fallback for font size

If core-styles.scss fails to load, the text collapses to 0px. Keep a hard fallback just like other components.

-    font-size: var(--limel-theme-default-font-size);
+    font-size: var(--limel-theme-default-font-size, 0.875rem);

151-154: <limel-icon> needs fill, not only color, for error state

SVG icons ignore the color property. Add fill so the error hue is visible.

-        .invalid-icon {
-            color: var(--limel-theme-error-text-color);
-        }
+        .invalid-icon {
+            color: var(--limel-theme-error-text-color);
+            fill:  var(--limel-theme-error-text-color);
+        }
src/components/table/table.scss (1)

30-36: --table-arrow-color--active incompatible with downstream rgb() usage

The variable now resolves to a complete colour, but tabulator-arrow later wraps it in rgb(var(--table-arrow-color--active)), producing invalid CSS (rgb(var(--lime-primary-color))).
Either store a channel triplet or drop the rgb() wrapper at use-sites.

--table-arrow-color--active: var(
-    --lime-primary-color,
-    var(--limel-theme-primary-color)
+    var(--lime-primary-color, var(--limel-theme-primary-color))
);
src/components/date-picker/flatpickr-adapter/flatpickr-adapter.scss (2)

81-95: Define a single --flatpickr-primary variable instead of duplicating the fallback chain

The same primary colour chain appears in border-color, color, background, box-shadow, etc. Define it once at :host level and reference it to avoid divergence and save bytes.

:host(limel-flatpickr-adapter) {
+    --flatpickr-primary: var(
+        --lime-primary-color,
+        var(--limel-theme-primary-color)
+    );
+    --flatpickr-on-primary: var(
+        --lime-on-primary-color,
+        var(--limel-theme-on-primary-color)
+    );
 ...
-        border-color: var(--lime-primary-color, var(--limel-theme-primary-color));
-        color: var(--lime-on-primary-color, var(--limel-theme-on-primary-color));
-        background: var(--lime-primary-color, var(--limel-theme-primary-color));
+        border-color: var(--flatpickr-primary);
+        color: var(--flatpickr-on-primary);
+        background: var(--flatpickr-primary);

Also applies to: 98-104, 108-112


154-155: Add hard fallback for time-input colour

--limel-theme-on-surface-color may be missing in consumer CSS. Provide a static RGB fallback.

-        color: var(--limel-theme-on-surface-color);
+        color: var(--limel-theme-on-surface-color, rgb(var(--contrast-1100)));
src/components/switch/switch.scss (1)

58-73: Repeated primary-colour chain already noted earlier
Same observation as in the previous review: consider introducing a local --limel-primary-resolved to DRY this block.

src/components/form/form.scss (1)

181-186: Hard-coded typography constants previously discussed
Earlier feedback about introducing theme tokens instead of scattered magic numbers still applies.

Also applies to: 202-223, 236-269, 284-285

src/style/internal/shared_input-select-picker.scss (1)

244-246: Same nested-var() issue already flagged earlier
The box-shadow still contains var(--lime-primary-color, var(--limel-theme-primary-color)), which is invalid for the same reason as above. Please flatten it.

src/style/_theme-color-variables.scss (1)

24-35: rgb() used with 4 parameters – should be rgba()

rgb(var(--contrast-1700), 0.38) (and the similar 0.87 / 0.54 cases) is invalid CSS. Use rgba() when supplying an alpha channel, or keep it opaque.

---limel-theme-text-disabled-on-background-color: rgb(
-    var(--contrast-1700),
-    0.38
-);
+--limel-theme-text-disabled-on-background-color: rgba(
+    var(--contrast-1700),
+    0.38
+);

Same fix applies to the two other occurrences in this block.

Comment on lines 55 to 65
:host(limel-button[primary]) & {
&:not(:disabled) {
color: var(--mdc-theme-on-primary, rgb(var(--color-white)));
color: var(
--lime-on-primary-color,
var(--limel-theme-on-primary-color)
);
background-color: var(
--mdc-theme-primary,
rgb(var(--color-teal-default))
--lime-primary-color,
var(--limel-theme-primary-color)
);
}
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Factor-out the repeated primary color fallback chain

The same var(--lime-primary-color, var(--limel-theme-primary-color)) / --lime-on-primary-color fallback appears three times. Defining a resolved variable once on :host and re-using it would avoid copy-paste drift and keep future edits atomic.

:host {
+    /* Centralise resolved theme colours */
+    --limel-primary-resolved: var(--lime-primary-color, var(--limel-theme-primary-color));
+    --limel-on-primary-resolved: var(--lime-on-primary-color, var(--limel-theme-on-primary-color));
}
…
-            color: var(--lime-on-primary-color, var(--limel-theme-on-primary-color));
+            color: var(--limel-on-primary-resolved);-            background-color: var(--lime-primary-color, var(--limel-theme-primary-color));
+            background-color: var(--limel-primary-resolved);-            color: var(--lime-primary-color, var(--limel-theme-primary-color));
+            color: var(--limel-primary-resolved);-    border-color: var(--lime-primary-color, var(--limel-theme-primary-color));
+    border-color: var(--limel-primary-resolved);

Also applies to: 73-73, 147-147

🤖 Prompt for AI Agents
In src/components/button/button.scss around lines 55 to 65, the fallback color
variables for primary color and on-primary color are repeated multiple times. To
fix this, define CSS custom properties on the :host selector that resolve these
fallback chains once, then use these custom properties throughout the styles
instead of repeating the var() calls. Apply the same refactoring for the lines
73 and 147 as well to ensure consistency and easier maintenance.

Comment on lines 7 to 9
:host(.displays-percentage-colors[readonly]) {
--mdc-theme-on-surface: var(--mdc-theme-primary);
--mdc-theme-on-surface: var(--lime-primary-color);
}
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Still exporting the deprecated MDC variable – switch to the new theme token

The declaration is now feeding Lime’s primary color into --mdc-theme-on-surface, i.e.

--mdc-theme-on-surface: var(--lime-primary-color);

All other files in this PR delete the MDC namespace and use the new canonical variable --limel-theme-on-surface-color.
Keeping the MDC-prefixed name defeats the purpose of this refactor and leaks an alias that consumers are no longer supposed to rely on.

-    --mdc-theme-on-surface: var(--lime-primary-color);
+    --limel-theme-on-surface-color: var(--lime-primary-color);

🏁 Script executed:

#!/bin/bash
set -e

echo "=== Deprecated MDC variable usages ==="
rg -n -C2 "--mdc-theme-on-surface" --glob "*.scss" || echo "None found"

echo -e "\n=== New canonical theme variable usages ==="
rg -n -C2 "--limel-theme-on-surface-color" --glob "*.scss" || echo "None found"

echo -e "\n=== All CSS custom properties starting with --limel-theme- ==="
rg -o --no-filename "--limel-theme-[[:alnum:]-]*" --glob "*.scss" | sort -u

Length of output: 1877


#!/usr/bin/env bash
set -euo pipefail

echo "=== Deprecated MDC variable usages ==="
rg --glob '*.scss' -- '--mdc-theme-on-surface' -n -C2 || echo "None found"

echo -e "\n=== New canonical theme variable usages ==="
rg --glob '*.scss' -- '--limel-theme-on-surface-color' -n -C2 || echo "None found"

echo -e "\n=== All CSS custom properties starting with --limel-theme- ==="
rg --glob '*.scss' -o --no-filename -- '--limel-theme-[[:alnum:]-]*' | sort -u || echo "None found"

Switch to the new Lime Elements theme token

In this file we’re still defining the deprecated MDC property. To keep the codebase consistent and avoid leaking an unsupported alias, replace the old variable with the new canonical one.

Locations to update:

  • File: src/components/slider/partial-styles/percentage-color.scss
    Lines: 7–9

Suggested change:

-:host(.displays-percentage-colors[readonly]) {
-    --mdc-theme-on-surface: var(--lime-primary-color);
-}
+:host(.displays-percentage-colors[readonly]) {
+    --limel-theme-on-surface-color: var(--lime-primary-color);
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
:host(.displays-percentage-colors[readonly]) {
--mdc-theme-on-surface: var(--mdc-theme-primary);
--mdc-theme-on-surface: var(--lime-primary-color);
}
:host(.displays-percentage-colors[readonly]) {
--limel-theme-on-surface-color: var(--lime-primary-color);
}
🤖 Prompt for AI Agents
In src/components/slider/partial-styles/percentage-color.scss at lines 7 to 9,
replace the deprecated CSS variable --mdc-theme-on-surface with the new Lime
Elements theme token variable. Update the variable name to the current canonical
one used in the Lime Elements theme to maintain consistency and avoid using
unsupported aliases.

*/

@use '../brand-colors';
@use '../_theme-color-variables';
Copy link
Contributor

Choose a reason for hiding this comment

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

it affected limebb-navigation-button
now:
Screenshot 2025-08-04 at 14 10 12
before:

Screenshot 2025-08-04 at 14 10 23

Copy link
Contributor

@LucyChyzhova LucyChyzhova Aug 4, 2025

Choose a reason for hiding this comment

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

another miss of --mdc-theme-on-surface:
Screenshot 2025-08-04 at 14 36 19

Screenshot 2025-08-04 at 14 40 04

}

&.mdc-chip--selected {
background-color: var(--mdc-theme-surface);
Copy link
Contributor

Choose a reason for hiding this comment

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

some icon missing it now:
Screenshot 2025-08-04 at 14 25 28


:host(limel-button[primary]) & {
&:not(:disabled) {
color: var(--mdc-theme-on-primary, rgb(var(--color-white)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Screenshot 2025-08-04 at 14 25 34

Copy link
Contributor

Choose a reason for hiding this comment

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

and this behaviour we could fix on go:
(it's not related to this pr)

Screen.Recording.2025-08-04.at.14.25.05.mov

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for these 🙏 . I think I know why this happens. I'm gonna fix them soon

@@ -1,4 +1,3 @@
@use '../../style/internal/variables';
Copy link
Contributor

Choose a reason for hiding this comment

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

It can be a wrong reference, please just check here
Screenshot 2025-08-04 at 14 43 58
Screenshot 2025-08-04 at 14 45 14

&:disabled {
cursor: not-allowed;

color: var(--mdc-theme-text-disabled-on-background);
Copy link
Contributor

Choose a reason for hiding this comment

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

Screenshot 2025-08-04 at 15 15 41 Screenshot 2025-08-04 at 15 16 59

Copy link
Contributor

Choose a reason for hiding this comment

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

Screenshot 2025-08-04 at 15 57 16

Kiarokh added 3 commits August 5, 2025 11:05
This file included `@use '@material/theme'` which was
supposed to add some of our very old brand colors to
MDC components. However…
1. We're already overriding all MDC colors anyways.
2. There were some build errors related to this line, where
the build couldn't find the file to import.
The `_theme-color-variables.scss` file is used in two places:
1. `lime-theme.scss` (which is imported by MDC-using components)
2. `core-styles.scss` (which is imported globally)

Both files include the same `mixin` `theme-color-variables.theme-color-variables`
on the `:root` or `:host` level. `core-styles.scss` is imported globally and already
includes the theme variables at the `:root` level. While `lime-theme.scss` is
imported into some individual components that use MDC and
includes the same theme variables on the `:host` level.

Since the theme variables are already defined at the `:root` level in `core-styles.scss`,
they should be available throughout the entire application.
Therefore, including in all components. The duplication is unnecessary.
Kiarokh added 6 commits August 5, 2025 11:52
…y on MDC styles

Many of our components use MDC's custom CSS properties
such as `--mdc-theme-primary` to render their styles properly.
This is while we have had an undocumented property called
`--lime-primary-color` which was intended to be used for theming.
Due to our implementation and  some spaghetti code, our own props
worked inconsistently. So even we used MDC's props for styling
our components.
…ts styles

There doesn't seem to be anything that these components used from
the imported `lime-theme.scss` file. It seemed that the file only includes
some SASS variables (from us and from MDC), but none of them is used
in the actual files. Comparing the compiled version of a couple of component's
styles, I could see that the code was identical. Visual inspection also doesn't
show any difference, and there is no build problems. Therefore, I just removed
the imported file.
Since this file no longer defines or forwards any theme variables
and instead only imports and forwards a typography file,
we can rather only import the typography file where it is necessary.
And also remove the no-op `@use '@material/typography'`.
We didn't really have any use for this file, except in one location.
We handle typographic styles individually in components.
There was only one instance where something from
this file was actually used. That is now handled locally.
This file has otherwise nothing useful to offer.
@Kiarokh Kiarokh enabled auto-merge (rebase) August 5, 2025 09:55
Copy link
Contributor

@LucyChyzhova LucyChyzhova left a comment

Choose a reason for hiding this comment

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

Tested, beautiful now! 🤩

@Kiarokh Kiarokh merged commit 7a74c49 into main Aug 5, 2025
12 checks passed
@Kiarokh Kiarokh deleted the theme-cleanup-v2 branch August 5, 2025 12:17
@lime-opensource
Copy link
Collaborator

🎉 This PR is included in version 38.21.2 🎉

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure consumers can use a global accent color for theming, and get rid of MDC theming CSS custom variables

3 participants