Skip to content

Commit 22d367a

Browse files
chore(style): migrate TextRotater component to tailwind css #8047 (#8091)
1 parent b7faa8b commit 22d367a

3 files changed

Lines changed: 15 additions & 51 deletions

File tree

src/components/TextRotater/TextRotater.jsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
import PropTypes from "prop-types";
33
import { Children, PureComponent, cloneElement } from "react";
44

5-
// Load Styling
6-
import "./TextRotater.scss";
7-
85
export default class TextRotater extends PureComponent {
96
static defaultProps = {
107
delay: 0,
@@ -39,9 +36,19 @@ export default class TextRotater extends PureComponent {
3936
);
4037

4138
return (
42-
<div className="text-rotater">
39+
<div
40+
className="
41+
relative inline-block overflow-hidden align-bottom px-[0.3em]
42+
before:content-[''] before:absolute before:left-0 before:w-full before:h-[3px]
43+
before:bottom-0 before:z-10
44+
before:bg-linear-to-t before:from-[#2b3a42] before:to-transparent
45+
after:content-[''] after:absolute after:left-0 after:w-full after:h-[3px]
46+
after:top-0
47+
after:bg-linear-to-b after:from-[#2b3a42] after:to-transparent
48+
"
49+
>
4350
<div
44-
className="text-rotater__wrap"
51+
className="inline-flex flex-col text-left"
4552
ref={(trw) => (this.textRotatorWrap = trw)}
4653
onTransitionEnd={this._handleTransitionEnd}
4754
style={{ height: contentHeight, width: maxWidth }}

src/components/TextRotater/TextRotater.scss

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

src/styles/tailwind.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
.DocSearch-Button .DocSearch-Search-Icon {
5151
@apply text-white! lg:text-gray-100!;
5252
}
53+
.text-rotater--slide-up {
54+
@apply transition-transform duration-[1000ms] ease-[cubic-bezier(0.7,0,0.3,1)] -translate-y-full;
55+
}
5356

5457
/* Reading Progress – keyframes for scroll-driven animation */
5558
@keyframes grow-progress {

0 commit comments

Comments
 (0)