Skip to content

Commit 3e0c695

Browse files
committed
Content Placeholder dark theme
1 parent a6946a8 commit 3e0c695

File tree

7 files changed

+51
-0
lines changed

7 files changed

+51
-0
lines changed

src/main/java/gwt/material/design/incubator/client/dark/IncubatorDarkThemeLoader.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@
2020
package gwt.material.design.incubator.client.dark;
2121

2222
import gwt.material.design.client.theme.dark.DarkThemeLoader;
23+
import gwt.material.design.incubator.client.placeholder.PlaceholderDarkTheme;
2324
import gwt.material.design.incubator.client.progress.ProgressLineBarDarkTheme;
2425
import gwt.material.design.incubator.client.toggle.GroupToggleDarkTheme;
2526

2627
public class IncubatorDarkThemeLoader extends DarkThemeLoader {
2728

2829
public IncubatorDarkThemeLoader() {
2930
super(new GroupToggleDarkTheme(),
31+
new PlaceholderDarkTheme(),
3032
new ProgressLineBarDarkTheme());
3133
}
3234
}

src/main/java/gwt/material/design/incubator/client/placeholder/PlaceholderClientBundle.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ public interface PlaceholderClientBundle extends ClientBundle {
2828

2929
@Source("resources/css/content-placeholder.min.css")
3030
TextResource contentPlaceholderCss();
31+
32+
@Source("resources/css/content-placeholder-dark.min.css")
33+
TextResource contentPlaceholderDarkCss();
3134
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package gwt.material.design.incubator.client.placeholder;
2+
3+
import gwt.material.design.addins.client.dark.AddinsWidgetDarkTheme;
4+
import gwt.material.design.incubator.client.AddinsIncubator;
5+
import gwt.material.design.incubator.client.progress.ProgressLineBarClientBundle;
6+
import gwt.material.design.incubator.client.progress.ProgressLineBarDebugClientBundle;
7+
8+
public class PlaceholderDarkTheme extends AddinsWidgetDarkTheme {
9+
10+
public PlaceholderDarkTheme() {
11+
super(AddinsIncubator.isDebug() ? PlaceholderDebugClientBundle.INSTANCE.contentPlaceholderDarkCss() : PlaceholderClientBundle.INSTANCE.contentPlaceholderDarkCss());
12+
}
13+
}

src/main/java/gwt/material/design/incubator/client/placeholder/PlaceholderDebugClientBundle.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ public interface PlaceholderDebugClientBundle extends ClientBundle {
2828

2929
@Source("resources/css/content-placeholder.css")
3030
TextResource contentPlaceholder();
31+
32+
@Source("resources/css/content-placeholder-dark.css")
33+
TextResource contentPlaceholderDarkCss();
3134
}

src/main/java/gwt/material/design/incubator/client/placeholder/PlaceholderItem.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import gwt.material.design.incubator.client.AddinsIncubator;
2626
import gwt.material.design.incubator.client.base.IncubatorWidget;
2727
import gwt.material.design.incubator.client.base.constants.IncubatorCssName;
28+
import gwt.material.design.incubator.client.dark.IncubatorDarkThemeReloader;
2829
import gwt.material.design.incubator.client.loadingstate.LoadingStatePanel;
2930

3031
public class PlaceholderItem extends MaterialWidget {
@@ -41,4 +42,11 @@ public class PlaceholderItem extends MaterialWidget {
4142
public PlaceholderItem() {
4243
super(Document.get().createDivElement(), IncubatorCssName.CONTENT_PLACEHOLDER);
4344
}
45+
46+
@Override
47+
protected void onLoad() {
48+
super.onLoad();
49+
50+
IncubatorDarkThemeReloader.get().reload(PlaceholderDarkTheme.class);
51+
}
4452
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.content-placeholder {
2+
display: inline-block;
3+
width: 100%;
4+
-webkit-animation-duration: 1s;
5+
animation-duration: 1s;
6+
-webkit-animation-fill-mode: forwards;
7+
animation-fill-mode: forwards;
8+
-webkit-animation-iteration-count: infinite;
9+
animation-iteration-count: infinite;
10+
-webkit-animation-name: placeHolderShimmer;
11+
animation-name: placeHolderShimmer;
12+
-webkit-animation-timing-function: linear;
13+
animation-timing-function: linear;
14+
background: -webkit-gradient(linear, left top, right top, color-stop(8%, #454545), color-stop(18%, #555555), color-stop(33%, #444444));
15+
background: -webkit-linear-gradient(left, #454545 8%, #555555 18%, #444444 33%);
16+
background: linear-gradient(to right, #454545 8%, #555555 18%, #444444 33%);
17+
-webkit-background-size: 800px 104px;
18+
background-size: 800px 104px;
19+
height: inherit;
20+
position: relative;
21+
}

src/main/resources/gwt/material/design/incubator/client/placeholder/resources/css/content-placeholder-dark.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)