Skip to content

Commit 39668f8

Browse files
committed
Tweak ScaledText style to prevent the font descender from getting cropped out
1 parent 2603c70 commit 39668f8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

js/src/components/paid-ads/campaign-preview/campaign-preview.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,15 @@ $gla-campaign-preview-height: 270px;
9494

9595
// Display smaller font sizes than browsers' limitations.
9696
&__scaled-text {
97+
height: 1em;
9798
transform: scale(0.5);
9899
transform-origin: top left;
99100
margin-right: -100%; // Inner shrinkage for offsetting the outer horizontal gap caused by 0.5 times scaling.
100101
margin-bottom: -0.5em; // Inner shrinkage for offsetting the outer vertical gap caused by 0.5 times scaling.
101102
white-space: nowrap;
102103
overflow: hidden;
103104
text-overflow: ellipsis;
104-
line-height: 1;
105+
line-height: 0.9; // With 1em height, it prevents the font descender from getting cropped out.
105106
font-size: 20px;
106107

107108
&--smaller {
@@ -125,6 +126,10 @@ $gla-campaign-preview-height: 270px;
125126
}
126127

127128
&--ad-badge {
129+
// Reset height and line-height because ad badge holds enough height for font descender.
130+
height: auto;
131+
line-height: 1;
132+
128133
// The same vertical inner shrinkage as above.
129134
// A: Height of badge = &--ad-badge font-size + vertical padding
130135
// B: Height of text after badge = &--smaller font-size

0 commit comments

Comments
 (0)