-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
It is now possible to extend a parent theme. This means adding to theme.json the key "parent" with the value of the target theme and then this will be loaded before the application's own theme. Fixes #9587
- Loading branch information
Showing
20 changed files
with
475 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+392 KB
...st-application-theme/test-reusable-as-parent/frontend/themes/child-theme/bg.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions
30
...ests/test-application-theme/test-reusable-as-parent/frontend/themes/child-theme/child.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
@font-face { | ||
font-family: 'IBM Plex Mono'; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: url("./font/IBMPlexMono-Regular.otf") format("opentype"); | ||
|
||
} | ||
|
||
html, :host { | ||
--lumo-body-text-color: #008000; | ||
} | ||
|
||
body { | ||
background-image: url("./bg.jpg"); | ||
font-family: "IBM Plex Mono"; | ||
} | ||
|
||
#butterfly { | ||
background-image: url("./img/gobo.png"); | ||
width: 280px; | ||
height: 240px; | ||
} | ||
|
||
#octopuss { | ||
background-image: url('./img/viking.png'); | ||
width: 270px; | ||
height: 220px; | ||
} | ||
|
Binary file added
BIN
+60.9 KB
...on-theme/test-reusable-as-parent/frontend/themes/child-theme/font/IBMPlexMono-Regular.otf
Binary file not shown.
Binary file added
BIN
+1.59 KB
...lication-theme/test-reusable-as-parent/frontend/themes/child-theme/img/gobo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.47 KB
...cation-theme/test-reusable-as-parent/frontend/themes/child-theme/img/viking.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...sts/test-application-theme/test-reusable-as-parent/frontend/themes/child-theme/theme.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"parent": "reusable-theme" | ||
} |
100 changes: 100 additions & 0 deletions
100
flow-tests/test-application-theme/test-reusable-as-parent/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>test-application-theme</artifactId> | ||
<groupId>com.vaadin</groupId> | ||
<version>2.6-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>flow-test-use-reusable-as-parent</artifactId> | ||
<name>Test reusable application theme as parent</name> | ||
<packaging>war</packaging> | ||
<properties> | ||
<maven.deploy.skip>true</maven.deploy.skip> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>flow-test-common</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>flow-html-components-testbench</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>vaadin-lumo-theme</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>reusable-theme</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>flow-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>prepare-frontend</goal> | ||
<goal>build-frontend</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<productionMode>true</productionMode> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>local-run</id> | ||
<activation> | ||
<property> | ||
<name>!test.use.hub</name> | ||
</property> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.lazerycode.selenium</groupId> | ||
<artifactId>driver-binary-downloader-maven-plugin</artifactId> | ||
<version>${driver.binary.downloader.maven.plugin.version}</version> | ||
<configuration> | ||
<onlyGetDriversForHostOperatingSystem>true</onlyGetDriversForHostOperatingSystem> | ||
<rootStandaloneServerDirectory>${project.rootdir}/driver</rootStandaloneServerDirectory> | ||
<downloadedZipFileDirectory>${project.rootdir}/driver_zips</downloadedZipFileDirectory> | ||
<customRepositoryMap>${project.rootdir}/drivers.xml</customRepositoryMap> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>pre-integration-test</phase> | ||
<goals> | ||
<goal>selenium</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
</project> | ||
|
30 changes: 30 additions & 0 deletions
30
...eme/test-reusable-as-parent/src/main/java/com/vaadin/flow/servlets/WorkaroundServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright 2000-2021 Vaadin Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
package com.vaadin.flow.servlets; | ||
|
||
import javax.servlet.annotation.WebServlet; | ||
|
||
import com.vaadin.flow.server.VaadinServlet; | ||
|
||
/** | ||
* This is a temporary workaround until #5740 is fixed. | ||
* | ||
* @since 2.0 | ||
*/ | ||
@WebServlet("/*") | ||
public class WorkaroundServlet extends VaadinServlet { | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
...test-reusable-as-parent/src/main/java/com/vaadin/flow/uitest/ui/theme/MyPolymerField.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright 2000-2020 Vaadin Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
package com.vaadin.flow.uitest.ui.theme; | ||
|
||
import com.vaadin.flow.component.Component; | ||
import com.vaadin.flow.component.Tag; | ||
import com.vaadin.flow.component.dependency.JsModule; | ||
import com.vaadin.flow.component.dependency.NpmPackage; | ||
|
||
/** | ||
* Polymer version of vaadin text field for testing component theming. | ||
*/ | ||
@JsModule("@vaadin/vaadin-text-field/vaadin-text-field.js") | ||
@Tag("vaadin-text-field") | ||
@NpmPackage(value="@vaadin/vaadin-text-field", version = "2.7.1") | ||
public class MyPolymerField extends Component { | ||
|
||
/** | ||
* Set the component id. | ||
* | ||
* @param id | ||
* value to set | ||
* @return this component | ||
*/ | ||
public Component withId(String id) { | ||
setId(id); | ||
return this; | ||
} | ||
} |
Oops, something went wrong.