Skip to content

Commit 469936e

Browse files
committed
chore(webapp): drop server-changes note, tighten fade helper
Un-export the mask constant (only used inside the module) and fold the truncate check into the overflow argument.
1 parent b92fe12 commit 469936e

3 files changed

Lines changed: 2 additions & 9 deletions

File tree

.server-changes/side-menu-label-fade.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

apps/webapp/app/components/environments/EnvironmentLabel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export function EnvironmentLabel({
126126
environmentTextClassName(environment),
127127
className
128128
)}
129-
style={truncate ? undefined : labelOverflowFadeStyle(isTruncated)}
129+
style={labelOverflowFadeStyle(!truncate && isTruncated)}
130130
>
131131
{text}
132132
</span>

apps/webapp/app/components/primitives/labelOverflowFade.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* it only while the text actually overflows — masking a label that fits would fade its last
44
* characters for no reason.
55
*/
6-
export const LABEL_OVERFLOW_MASK =
7-
"linear-gradient(to right, black calc(100% - 1.5rem), transparent)";
6+
const LABEL_OVERFLOW_MASK = "linear-gradient(to right, black calc(100% - 1.5rem), transparent)";
87

98
/** Mask style for a clipping label, or nothing when the text fits. Spread into a `style` prop. */
109
export function labelOverflowFadeStyle(isOverflowing: boolean) {

0 commit comments

Comments
 (0)