Skip to content

test: back per-component theme CSS tests with faux themable elements - #25103

Draft
Artur- wants to merge 1 commit into
mainfrom
remove-real-component-theme-tests
Draft

test: back per-component theme CSS tests with faux themable elements#25103
Artur- wants to merge 1 commit into
mainfrom
remove-real-component-theme-tests

Conversation

@Artur-

@Artur- Artur- commented Jul 31, 2026

Copy link
Copy Markdown
Member

Flow's per-component theme CSS feature (theme/components/<tag>.css) generates an import of @vaadin/vaadin-themable-mixin/register-styles, and registerStyles only reaches a component's shadow DOM when the target element uses ThemableMixin. The theme ITs pulled in real @vaadin/text-field and @vaadin/horizontal-layout web components purely to exercise this machinery.

Replace those with faux ThemableMixin(LitElement) elements registered under the same tag names, so no real Vaadin components are needed and the existing theme CSS, @CssImport(themeFor=...) and ITs keep matching unchanged:

  • themable-input.js stands in for vaadin-text-field, reproducing the .vaadin-field-container > [part=input-field] shadow path the live-reload and vite ITs walk.
  • faux-horizontal-layout.js stands in for vaadin-horizontal-layout with a <slot> so the ::slotted(:nth-child) per-component CSS applies.

A plain custom element (as in #24440) never receives the registered styles, which is why that approach failed; mixing in ThemableMixin is what makes it work.

@vaadin/vaadin-themable-mixin is still required to resolve the generated register-styles import. It is declared centrally on flow-test-lumo — the shared dependency of every theme-test module — so those modules build without any real component. The now-unused real @vaadin/text-field is dropped from the vite-basics, vite-context-path and vite-production package.json files.

Supersedes #24440.

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Test Results

 1 373 files   -  76   1 374 suites   - 76   1h 43m 55s ⏱️ + 12m 30s
10 259 tests  - 133  10 183 ✅  - 142  63 💤  - 4  5 ❌ +5  8 🔥 +8 
10 631 runs   - 197  10 552 ✅  - 208  64 💤  - 4  7 ❌ +7  8 🔥 +8 

For more details on these failures and errors, see this check.

Results for commit 79c6a50. ± Comparison against base commit dcfc70e.

♻️ This comment has been updated with latest results.

Flow's per-component theme CSS (theme/components/<tag>.css) generates an
import of @vaadin/vaadin-themable-mixin/register-styles, and registerStyles
only reaches a shadow DOM when the target element uses ThemableMixin. The
theme ITs relied on real @vaadin/text-field and @vaadin/horizontal-layout
web components purely to exercise this machinery.

Replace those with faux ThemableMixin(LitElement) elements registered under
the same tags, so no real Vaadin components are pulled in:

- themable-input.js stands in for vaadin-text-field, reproducing the
  .vaadin-field-container > [part=input-field] shadow path the ITs walk.
- faux-horizontal-layout.js stands in for vaadin-horizontal-layout with a
  <slot> so the ::slotted(:nth-child) per-component CSS applies.

Keeping the real tag names means the existing theme/components CSS,
@CssImport(themeFor=...) and ITs keep matching unchanged.

@vaadin/vaadin-themable-mixin is still required to resolve the generated
register-styles import. Declare it centrally on flow-test-lumo, the shared
dependency of every theme-test module, so those modules build without any
real component. Drop the now-unused @vaadin/text-field from vite-basics.
@Artur-
Artur- force-pushed the remove-real-component-theme-tests branch from 496f6f4 to 79c6a50 Compare August 5, 2026 16:31
@totally-not-ai totally-not-ai Bot changed the title test: remove per-component theme CSS tests moved to platform test: back per-component theme CSS tests with faux themable elements Aug 5, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@Artur-
Artur- marked this pull request as draft August 6, 2026 05:10
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.

1 participant