Skip to content

Commit

Permalink
Add note about empty Theme annotation.
Browse files Browse the repository at this point in the history
Apply suggestions from code review
  • Loading branch information
caalador committed Mar 1, 2021
1 parent 5060f48 commit 7e233a0
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static class TranslatedImports extends Component {
}

@Route
@Theme(value =Lumo.class, variant = Lumo.DARK)
@Theme(value = Lumo.class, variant = Lumo.DARK)
public static class MainView extends Component {
ButtonComponent buttonComponent;
IconComponent iconComponent;
Expand Down
3 changes: 3 additions & 0 deletions flow-server/src/main/java/com/vaadin/flow/theme/Theme.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
* <p>
* By default {@code com.vaadin.flow.theme.lumo.Lumo} theme is used if it's in
* the classpath. You may disable theming with {@link NoTheme} annotation.
* Adding an empty {@link Theme} is equal to not having a {@link Theme}
* annotation and will default to {@code com.vaadin.flow.theme.lumo.Lumo} if
* available.
* <p>
* {@link Theme} annotation should be added to your root navigation level,
* {@link RouterLayout} or to the top level @{@link Route}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static class TranslatedImports extends Component {
}

@JsModule("./common-js-file.js")
@Theme(value =LumoTest.class, variant = LumoTest.DARK)
@Theme(value = LumoTest.class, variant = LumoTest.DARK)
@Route
public static class MainLayout implements RouterLayout {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public String getThemeUrl() {

}

@Theme(value =FakeLumoTheme.class)
@Theme(value = FakeLumoTheme.class)
public static class ThemedComponent extends Component {

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static abstract class GeneratedComponent extends Component {
}


@Theme(value =Theme1.class, variant = Theme0.DARK)
@Theme(value = Theme1.class, variant = Theme0.DARK)
@JsModule("./router-layout-1.js")
public class RouterLayout1 implements RouterLayout {
@Override
Expand All @@ -117,7 +117,7 @@ public Element getElement() {
}
}

@Theme(value =Theme1.class, variant = Theme0.DARK)
@Theme(value = Theme1.class, variant = Theme0.DARK)
@JsModule("./router-layout-2.js")
public class RouterLayout2 extends RouterLayout1 {
}
Expand All @@ -127,7 +127,7 @@ public static abstract class View0 extends Component {
}

@Route(value = "")
@Theme(value =Theme4.class)
@Theme(value = Theme4.class)
public static class RootViewWithTheme extends Component {
}

Expand All @@ -151,7 +151,7 @@ public static class RootView2WithLayoutTheme {
}

@Route(value = "", layout = RouterLayout2.class)
@Theme(value =Theme2.class, variant = Theme2.FOO)
@Theme(value = Theme2.class, variant = Theme2.FOO)
@JsModule("./view-2.js")
public static class RootViewWithMultipleTheme extends Component {

Expand Down Expand Up @@ -233,7 +233,7 @@ public void configureInstance(WebComponent<RootViewWithTheme> webComponent, Root
}
}

@Theme(value =Theme2.class)
@Theme(value = Theme2.class)
public static class ThemeExporter extends WebComponentExporter<RootViewWithTheme> {
public ThemeExporter() {
super("root-view");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.vaadin.flow.theme.Theme;

@JsModule("foo.js")
@Theme(value =CustomTheme.class)
@Theme(value = CustomTheme.class)
public class RouteLayoutComponent implements RouterLayout {
@Override
public Element getElement() {
Expand Down

0 comments on commit 7e233a0

Please sign in to comment.