Skip to content

Commit 3ce6b72

Browse files
committed
refactor(demo): use separate stylesheet for StyledBadgesDemo
1 parent 36826e5 commit 3ce6b72

3 files changed

Lines changed: 35 additions & 9 deletions

File tree

src/test/java/com/flowingcode/vaadin/addons/badgelist/StyledBadgesDemo.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* #%L
33
* Badge List Add-on
44
* %%
5-
* Copyright (C) 2023 - 2024 Flowing Code
5+
* Copyright (C) 2023 - 2026 Flowing Code
66
* %%
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
2121

2222
import com.flowingcode.vaadin.addons.demo.DemoSource;
2323
import com.flowingcode.vaadin.addons.demo.SourceCodeViewer;
24+
import com.vaadin.flow.component.dependency.CssImport;
2425
import com.vaadin.flow.component.html.Div;
2526
import com.vaadin.flow.component.html.Span;
2627
import com.vaadin.flow.component.icon.Icon;
@@ -31,8 +32,13 @@
3132
import java.util.List;
3233

3334
@DemoSource
35+
//#if vaadin eq 0
36+
@DemoSource(value = "/src/test/resources/META-INF/resources/frontend/styles/styled-badges-demo.css",
37+
caption = "styled-badges-demo.css")
38+
//#endif
3439
@PageTitle("Styled Badges Demo")
3540
@SuppressWarnings("serial")
41+
@CssImport("./styles/styled-badges-demo.css")
3642
@Route(value = "badge-list/styled", layout = BadgeListDemoView.class)
3743
public class StyledBadgesDemo extends BaseBadgeListDemo {
3844

src/test/resources/META-INF/frontend/styles/badge-list-demo-styles.css

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* #%L
33
* Badge List Add-on
44
* %%
5-
* Copyright (C) 2023 - 2024 Flowing Code
5+
* Copyright (C) 2023 - 2026 Flowing Code
66
* %%
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
@@ -28,11 +28,4 @@
2828
font-weight: 600;
2929
display: block;
3030
padding: 5px 0 10px 0;
31-
}
32-
33-
fc-badge-list[class="styled-badges-second-example"]::part(overflow-badge), .custom-styled-badge {
34-
background-color: lightgreen;
35-
color: green;
36-
border: 1px green dashed;
37-
border-radius: 0;
3831
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*-
2+
* #%L
3+
* Badge List Add-on
4+
* %%
5+
* Copyright (C) 2023 - 2026 Flowing Code
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
21+
fc-badge-list.styled-badges-second-example::part(overflow-badge), .custom-styled-badge {
22+
background-color: lightgreen;
23+
color: green;
24+
border: 1px green dashed;
25+
border-radius: 0;
26+
}
27+

0 commit comments

Comments
 (0)