Skip to content

Commit 7ecd301

Browse files
authored
fix(NumericSideIndicator): fix alignment (#6064)
1 parent c2e2282 commit 7ecd301

File tree

2 files changed

+10
-35
lines changed

2 files changed

+10
-35
lines changed
Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
.numericSideIndicator {
2+
font-family: var(--sapFontFamily);
3+
font-size: var(--sapFontSmallSize);
4+
color: var(--sapTile_TextColor);
25
display: flex;
36
flex-direction: column;
47
align-items: flex-end;
@@ -7,61 +10,33 @@
710
}
811

912
.title {
10-
font-family: var(--sapFontFamily);
11-
font-size: var(--sapFontSmallSize);
12-
color: var(--sapTile_TextColor);
1313
text-align: end;
1414
text-overflow: ellipsis;
1515
overflow: hidden;
1616
padding-bottom: 0.25rem;
1717
max-width: 100%;
1818
}
1919

20-
.valueContainer {
21-
position: relative;
22-
}
23-
24-
.number,
25-
.unit {
26-
font-size: var(--sapFontSmallSize);
27-
color: var(--sapTile_TitleTextColor);
20+
.value {
21+
font-size: inherit;
22+
color: inherit;
2823
white-space: pre-line;
2924
word-wrap: break-word;
3025
word-break: break-word;
3126
}
3227

3328
.stateGood {
3429
color: var(--sapPositiveTextColor);
35-
36-
.number,
37-
.unit {
38-
color: var(--sapPositiveTextColor);
39-
}
4030
}
4131

4232
.stateError {
4333
color: var(--sapNegativeTextColor);
44-
45-
.number,
46-
.unit {
47-
color: var(--sapNegativeTextColor);
48-
}
4934
}
5035

5136
.stateCritical {
5237
color: var(--sapCriticalTextColor);
53-
54-
.number,
55-
.unit {
56-
color: var(--sapCriticalTextColor);
57-
}
5838
}
5939

6040
.stateNeutral {
6141
color: var(--sapNeutralTextColor);
62-
63-
.number,
64-
.unit {
65-
color: var(--sapNeutralTextColor);
66-
}
6742
}

packages/main/src/components/NumericSideIndicator/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ export const NumericSideIndicator = forwardRef<HTMLDivElement, NumericSideIndica
4040
return (
4141
<div ref={ref} className={clsx(classNames.numericSideIndicator, className)} {...rest}>
4242
<span className={classNames.title}>{titleText}</span>
43-
<div className={clsx(classNames.valueContainer, Reflect.get(classNames, `state${state}`))}>
44-
<Text className={classNames.number}>{number}</Text>
45-
<Text className={classNames.unit}>{unit}</Text>
46-
</div>
43+
<Text className={clsx(classNames.value, classNames[`state${state}`])}>
44+
{number}
45+
{unit}
46+
</Text>
4747
</div>
4848
);
4949
});

0 commit comments

Comments
 (0)