Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/content/TextAnimations/Shuffle/Shuffle.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
}

.shuffle-char {
line-height: 1;
/* `normal` resolves to the font's own ascent + descent. The clip wrapper is
sized from this box, so a fixed 1 makes the mask shorter than the glyph
and clips descenders on every face that has them. Line spacing is still
controlled by .shuffle-parent. */
line-height: normal;
display: inline-block;
text-align: center;
}
5 changes: 4 additions & 1 deletion src/tailwind/TextAnimations/Shuffle/Shuffle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ const Shuffle = ({

splitRef.current = new GSAPSplitText(el, {
type: 'chars',
charsClass: 'shuffle-char',
// `leading-normal` overrides the parent's `leading-none` on the char
// itself: the clip wrapper is sized from this box, and a line-height
// of 1 makes the mask shorter than the glyph, clipping descenders.
charsClass: 'shuffle-char leading-normal',
wordsClass: 'shuffle-word',
linesClass: 'shuffle-line',
smartWrap: true,
Expand Down
6 changes: 5 additions & 1 deletion src/ts-default/TextAnimations/Shuffle/Shuffle.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
}

.shuffle-char {
line-height: 1;
/* `normal` resolves to the font's own ascent + descent. The clip wrapper is
sized from this box, so a fixed 1 makes the mask shorter than the glyph
and clips descenders on every face that has them. Line spacing is still
controlled by .shuffle-parent. */
line-height: normal;
display: inline-block;
text-align: center;
}
5 changes: 4 additions & 1 deletion src/ts-tailwind/TextAnimations/Shuffle/Shuffle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ const Shuffle: React.FC<ShuffleProps> = ({

splitRef.current = new GSAPSplitText(el, {
type: 'chars',
charsClass: 'shuffle-char',
// `leading-normal` overrides the parent's `leading-none` on the char
// itself: the clip wrapper is sized from this box, and a line-height
// of 1 makes the mask shorter than the glyph, clipping descenders.
charsClass: 'shuffle-char leading-normal',
wordsClass: 'shuffle-word',
linesClass: 'shuffle-line',
smartWrap: true,
Expand Down