Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
@NotThreadSafe
public class ComponentThemeLiveReloadIT extends ChromeBrowserTest {

private static final String BORDER_RADIUS = "3px";
private static final String OTHER_BORDER_RADIUS = "6px";
private static final String PARENT_BORDER_RADIUS = "9px";
private static final String BORDER_RADIUS = "11px";
private static final String OTHER_BORDER_RADIUS = "17px";
private static final String PARENT_BORDER_RADIUS = "23px";

private static final String THEMES_FOLDER = FrontendUtils.DEFAULT_FRONTEND_DIR
+ "/themes/";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { css, html, LitElement } from 'lit';
import { customElement } from 'lit/decorators.js';
import { applyTheme } from './generated/theme';
import lumo from '@vaadin/vaadin-lumo-styles/lumo.css?inline';

@customElement('ts-component')
export class TsComponent extends LitElement {
Expand All @@ -11,7 +10,9 @@ export class TsComponent extends LitElement {
}
static get styles() {
return css`
${lumo}.toString()
[theme='badge'] {
background-color: rgba(51, 139, 255, 0.13);
}
`;
}
render() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class TSIT extends ChromeBrowserTest {

@Test
public void lumoBadgeIsRenderedCorrectly() {
public void inlineComponentStylesApplied() {
open();
checkLogsForErrors();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.openqa.selenium.WebElement;

import com.vaadin.flow.component.html.testbench.DivElement;
import com.vaadin.flow.component.html.testbench.H1Element;
import com.vaadin.flow.component.html.testbench.SpanElement;
import com.vaadin.flow.testutil.ChromeBrowserTest;
import com.vaadin.testbench.TestBenchElement;
Expand Down Expand Up @@ -215,30 +214,11 @@ public void multipleSameEmbedded_cssTargetingDocumentShouldOnlyAddElementsOneTim
2l, getCommandExecutor().executeScript(
"return document.head.querySelectorAll('link[rel=stylesheet][href^=\"https://fonts.googleapis.com\"]').length"));
Assert.assertEquals(
"Project contains 4 css injections to document and all should be hashed",
4l, getCommandExecutor().executeScript(
"Project contains 2 css injections to document and all should be hashed",
2l, getCommandExecutor().executeScript(
"return window.Vaadin.theme.injectedGlobalCss.length"));
}

@Test
public void lumoImports_doNotLeakEmbeddingPage() {
open();
checkLogsForErrors();

// Ensure embedded components are loaded before testing embedding page
validateEmbeddedComponent($("themed-component").id("first"), "first");
validateEmbeddedComponent($("themed-component").id("second"), "second");

final H1Element element = $(H1Element.class).waitForFirst();
Assert.assertFalse(
"Lumo styles (typography) should not have been applied to elements in embedding page",
element.getCssValue("font-family").contains("Roboto"));
Assert.assertEquals(
"Lumo styles (colors) should not have been applied to elements in embedding page",
"rgba(0, 0, 0, 1)", element.getCssValue("color"));

}

@Test
public void cssImportAnnotation_applyToEmbeddingPage() {
open();
Expand Down
78 changes: 36 additions & 42 deletions flow-tests/test-frontend/vite-basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,70 +14,75 @@
"@vaadin/testscope-all": "../vite-test-assets/packages/@vaadin/testscope-all",
"@vaadin/testscope-button": "../vite-test-assets/packages/@vaadin/testscope-button",
"@vaadin/testscope-map": "../vite-test-assets/packages/@vaadin/testscope-map",
"@vaadin/text-field": "25.0.5",
"@vaadin/vaadin-lumo-styles": "25.0.5",
"@vaadin/vaadin-themable-mixin": "25.0.5",
"copy-to-clipboard": "^3.3.1",
"lit": "3.3.2",
"react": "19.2.4",
"react-dom": "19.2.4",
"react-router": "7.13.1"
"lit": "3.3.3",
"react": "19.2.6",
"react-dom": "19.2.6",
"react-router": "7.15.1"
},
"devDependencies": {
"@babel/core": "7.29.0",
"@babel/plugin-transform-react-jsx-development": "7.27.1",
"@babel/preset-react": "7.28.5",
"@babel/types": "7.29.0",
"@preact/signals-react-transform": "0.8.1",
"@rolldown/plugin-babel": "0.2.1",
"@rolldown/plugin-babel": "0.2.3",
"@rollup/plugin-replace": "6.0.3",
"@rollup/pluginutils": "5.3.0",
"@types/node": "25.5.0",
"@types/react": "19.2.14",
"@types/node": "25.9.1",
"@types/react": "19.2.15",
"@types/react-dom": "19.2.3",
"@vitejs/plugin-react": "6.0.1",
"@vitejs/plugin-react": "6.0.2",
"magic-string": "0.30.21",
"rollup-plugin-brotli": "3.1.0",
"rollup-plugin-visualizer": "7.0.1",
"strip-css-comments": "5.0.0",
"transform-ast": "2.4.4",
"typescript": "6.0.2",
"vite": "8.0.5",
"vite-plugin-checker": "0.12.0",
"workbox-build": "7.4.0"
"typescript": "6.0.3",
"vite": "8.0.14",
"vite-plugin-checker": "0.13.0"
},
"vaadin": {
"dependencies": {
"@polymer/polymer": "3.5.2",
"@vaadin/common-frontend": "0.0.22",
"@vaadin/text-field": "25.0.5",
"@vaadin/vaadin-lumo-styles": "25.0.5",
"@vaadin/vaadin-themable-mixin": "25.0.5",
"lit": "3.3.2",
"react": "19.2.4",
"react-dom": "19.2.4",
"react-router": "7.13.1"
"lit": "3.3.3",
"react": "19.2.6",
"react-dom": "19.2.6",
"react-router": "7.15.1"
},
"devDependencies": {
"@babel/core": "7.29.0",
"@babel/plugin-transform-react-jsx-development": "7.27.1",
"@babel/preset-react": "7.28.5",
"@babel/types": "7.29.0",
"@preact/signals-react-transform": "0.8.1",
"@rolldown/plugin-babel": "0.2.1",
"@rolldown/plugin-babel": "0.2.3",
"@rollup/plugin-replace": "6.0.3",
"@rollup/pluginutils": "5.3.0",
"@types/node": "25.5.0",
"@types/react": "19.2.14",
"@types/node": "25.9.1",
"@types/react": "19.2.15",
"@types/react-dom": "19.2.3",
"@vitejs/plugin-react": "6.0.1",
"@vitejs/plugin-react": "6.0.2",
"magic-string": "0.30.21",
"rollup-plugin-brotli": "3.1.0",
"rollup-plugin-visualizer": "7.0.1",
"strip-css-comments": "5.0.0",
"transform-ast": "2.4.4",
"typescript": "6.0.2",
"vite": "8.0.5",
"vite-plugin-checker": "0.12.0",
"workbox-build": "7.4.0"
"typescript": "6.0.3",
"vite": "8.0.14",
"vite-plugin-checker": "0.13.0"
},
"hash": "a6f125d0065f8904488235d44e4e522f7db5afecb3e0404c63e74d2ac8591ac5"
"hash": "8327859d8510ad6a16456239ce5905db6b1622684b644b5748078763d46e0232",
"overrides": {
"@polymer/polymer": "$@polymer/polymer",
"@vaadin/common-frontend": "$@vaadin/common-frontend",
"copy-to-clipboard": "$copy-to-clipboard",
"lit": "$lit",
"react": "$react",
"react-dom": "$react-dom",
"react-router": "$react-router"
}
},
"pnpm": {
"overrides": {
Expand All @@ -87,21 +92,10 @@
"copy-to-clipboard": "$copy-to-clipboard",
"@vaadin/test-package-outside-npm": "$@vaadin/test-package-outside-npm",
"@vaadin/test-package2-outside-npm": "$@vaadin/test-package2-outside-npm",
"rollup-plugin-brotli": "$rollup-plugin-brotli",
"typescript": "$typescript",
"vite": "$vite",
"vite-plugin-checker": "$vite-plugin-checker",
"workbox-build": "$workbox-build",
"@rollup/plugin-replace": "$@rollup/plugin-replace",
"@polymer/polymer": "$@polymer/polymer",
"@vaadin/common-frontend": "$@vaadin/common-frontend",
"@vaadin/text-field": "$@vaadin/text-field",
"@vaadin/vaadin-lumo-styles": "$@vaadin/vaadin-lumo-styles",
"@vaadin/vaadin-themable-mixin": "$@vaadin/vaadin-themable-mixin",
"lit": "$lit",
"react-dom": "$react-dom",
"@types/react-dom": "$@types/react-dom",
"@types/react": "$@types/react",
"react": "$react",
"react-router": "$react-router"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@import '@vaadin/vaadin-lumo-styles/utility.css';
html,
:host {
--lumo-primary-text-color: #008000;
color: rgba(0, 0, 0, 1); /* black */
}

.text-primary {
color: rgba(0, 128, 0, 1); /* green */
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
*/
package com.vaadin.flow.uitest.ui.theme;

import com.vaadin.flow.component.dependency.NpmPackage;
import com.vaadin.flow.component.page.AppShellConfigurator;
import com.vaadin.flow.theme.Theme;
import com.vaadin.flow.uitest.ui.dependencies.TestVersion;

@Theme(value = "app-theme")
@NpmPackage(value = "@fortawesome/fontawesome-free", version = TestVersion.FONTAWESOME)
public class AppShell implements AppShellConfigurator {
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class UtilityClassNameIT extends ChromeBrowserTest {

@Test
public void lumoUtils_customStylesHaveBeenExpanded() {
public void utilityClass_themeCssIsAppliedToElement() {
open();
checkLogsForErrors();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,17 @@

import org.slf4j.LoggerFactory;

import com.vaadin.flow.component.dependency.CssImport;
import com.vaadin.flow.component.dependency.JsModule;
import com.vaadin.flow.component.dependency.NpmPackage;
import com.vaadin.flow.theme.AbstractTheme;
import com.vaadin.flow.uitest.ui.dependencies.TestVersion;

/**
* Lumo component theme class implementation. Used for testing theming features.
*
* @since 1.0
* Lumo theme stub used by tests that rely on Flow's classpath detection of
* {@code com.vaadin.flow.theme.lumo.Lumo} as the default theme (see
* {@code AbstractDependenciesScanner.LUMO}). Provides the {@code LIGHT} /
* {@code DARK} variants and the standard
* {@link com.vaadin.flow.theme.AbstractTheme} contract without pulling in any
* Vaadin Lumo npm packages — tests that need real Lumo styling must declare
* those deps themselves.
*/
@NpmPackage(value = "@vaadin/vaadin-themable-mixin", version = TestVersion.VAADIN)
@NpmPackage(value = "@vaadin/vaadin-lumo-styles", version = TestVersion.VAADIN)
@CssImport("@vaadin/vaadin-lumo-styles/lumo.css")
@JsModule("@vaadin/vaadin-lumo-styles/vaadin-iconset.js")
public class Lumo implements AbstractTheme {

public static final String LIGHT = "light";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@import '@vaadin/vaadin-lumo-styles/utility.css';
html,
:host {
--lumo-primary-text-color: #008000;
color: rgba(0, 0, 0, 1); /* black */
}

.text-primary {
color: rgba(0, 128, 0, 1); /* green */
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
*/
package com.vaadin.flow.uitest.ui.theme;

import com.vaadin.flow.component.dependency.NpmPackage;
import com.vaadin.flow.component.page.AppShellConfigurator;
import com.vaadin.flow.theme.Theme;
import com.vaadin.flow.uitest.ui.dependencies.TestVersion;

@Theme(value = "app-theme")
@NpmPackage(value = "@fortawesome/fontawesome-free", version = TestVersion.FONTAWESOME)
public class AppShell implements AppShellConfigurator {
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class UtilityClassNameIT extends ChromeBrowserTest {

@Test
public void lumoUtils_customStylesHaveBeenExpanded() {
public void utilityClass_themeCssIsAppliedToElement() {
open();
checkLogsForErrors();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
.cssimport {
background-color: orange;
}

/* This is the same rule that Lumo utilities define */
.bg-contrast-20 {
background-color: orange;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@
background: green;
}

/* This is the same rule that Lumo utilities define */
.bg-contrast-60 {
color: white;
background-color: green;
}

.bg-contrast {
color: white;
}

.container {
display: flex;
align-items: stretch;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"lumoImports": ["typography", "color", "spacing", "badge"],
"parent": "parent-theme",
"importCss": ["@fortawesome/fontawesome-free/css/all.css"],
"assets": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,3 @@ body.bg {
color: white;
background: blue;
}

/* This is the same rule that Lumo utilities define */
.bg-contrast-50 {
color: white;
background-color: blue;
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
{
"lumoImports": ["utility"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package com.vaadin.flow.uitest.ui.theme;

import com.vaadin.flow.component.dependency.CssImport;
import com.vaadin.flow.component.dependency.NpmPackage;
import com.vaadin.flow.component.dependency.StyleSheet;
import com.vaadin.flow.component.page.AppShellConfigurator;
Expand All @@ -33,6 +32,5 @@
// url(...) inside an @import-ed CSS file must still resolve correctly when
// the entry CSS is loaded.
@StyleSheet("context://relurl-test/styles.css")
@CssImport("@vaadin/vaadin-lumo-styles/utility.css")
public class AppShell implements AppShellConfigurator {
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ public Expected(String expectedColor) {
idToExpectedColor.put("stylesheetVsAddStylesheet", "purple");
idToExpectedColor.put("addStylesheetVsCssImport", "yellow");
idToExpectedColor.put("laterAddStylesheetVsCssImport", "darkgoldenrod");
idToExpectedColor.put("cssImportVsLumo", "orange");
idToExpectedColor.put("lumo", "hsl(214, 35%, 15%)");
}

public CssLoadingView() {
Expand Down Expand Up @@ -107,15 +105,6 @@ public CssLoadingView() {
add(wrap("laterAddStylesheetVsCssImport",
laterAddStylesheetVsCssImport));

Span cssImportVsLumo = new Span(
"CSSImport vs Lumo, should be orange from cssimport");
cssImportVsLumo.addClassNames("compare", "bg-contrast-20");
add(wrap("cssImportVsLumo", cssImportVsLumo));

Span lumo = new Span("Lumo, should be quite black");
lumo.addClassNames("compare", "bg-contrast");
add(wrap("lumo", lumo));

// Regression target for https://github.com/vaadin/flow/issues/24164:
// .relurl-test-target's background-image is defined in
// webapp/relurl-test/views/messages.css using a relative
Expand Down
Loading
Loading