Skip to content

Commit 4024648

Browse files
committed
Badge resolves issue with fixed !important size - allow developers to set fontsize without restriction.
1 parent fe61a68 commit 4024648

File tree

5 files changed

+16
-17
lines changed

5 files changed

+16
-17
lines changed

gwt-material/src/main/java/gwt/material/design/client/constants/CssName.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
public interface CssName {
2828

2929
String BADGE = "badge";
30-
String SIDEBAR_BADGE = "sideBarBadge";
3130
String BREADCRUMB = "breadcrumb";
3231
String CARD = "card";
3332
String CARD_ACTION = "card-action";

gwt-material/src/main/java/gwt/material/design/client/ui/MaterialBadge.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class MaterialBadge extends Span {
4646
* Collection, DropDown, SideNav and any other Material components.
4747
*/
4848
public MaterialBadge() {
49-
super(Document.get().createSpanElement(), CssName.BADGE, CssName.SIDEBAR_BADGE);
49+
super(Document.get().createSpanElement(), CssName.BADGE);
5050
}
5151

5252
/**

gwt-material/src/main/resources/gwt/material/design/public/css/materialize.css

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8786,35 +8786,35 @@ nav ul a span.badge {
87868786
float: right;
87878787
margin-top: 22px; }
87888788

8789-
.side-nav .badge {
8789+
.side-nav span.badge {
87908790
float: right;
8791-
top: 22px; }
8792-
8793-
.sideBarBadge {
8791+
top: 22px;
87948792
height: 20px !important;
87958793
line-height: 0 !important;
87968794
padding: 10px !important;
87978795
color: #fff !important;
87988796
border-radius: 3px !important;
87998797
font-size: 0.7em !important; }
88008798

8801-
.badge.circle {
8799+
span.badge.circle {
88028800
position: absolute;
8803-
min-width: 0 !important;
8804-
border-radius: 100% !important;
8805-
height: 24px !important;
8801+
min-width: 0;
8802+
border-radius: 100%;
8803+
height: 24px;
88068804
top: -12px;
88078805
width: 24px;
8808-
font-size: 0.6rem !important;
8806+
font-size: 0.6rem;
88098807
text-align: center;
8810-
padding: 0 !important;
8811-
padding-top: 12px !important;
8808+
padding: 12px 0 0;
88128809
right: 8px; }
88138810

8814-
.badge > div:first-child {
8811+
span.badge > div:first-child {
88158812
display: inline; }
88168813

8817-
.badge {
8814+
nav ul a span.badge:not(.circle) {
8815+
line-height: 22px; }
8816+
8817+
span.badge {
88188818
background: #42A5F5; }
88198819

88208820
/**

gwt-material/src/main/resources/gwt/material/design/public/css/materialize.min.css

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

gwt-material/src/test/java/gwt/material/design/client/ui/MaterialBadgeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ protected MaterialBadge createWidget() {
3737

3838
@Override
3939
public void testInitialClasses() {
40-
checkInitialClasses(CssName.BADGE, CssName.SIDEBAR_BADGE);
40+
checkInitialClasses(CssName.BADGE);
4141
}
4242
}

0 commit comments

Comments
 (0)