Skip to content

Commit 6d0b64e

Browse files
committed
feat: add layout center
1 parent 1ef828b commit 6d0b64e

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"react-dom": "^18.2.0"
2222
},
2323
"devDependencies": {
24-
"@jswork/presets-tailwind": "^1.0.28",
24+
"@jswork/presets-tailwind": "^1.0.30",
2525
"@types/react": "^18.2.43",
2626
"@types/react-dom": "^18.2.17",
2727
"@typescript-eslint/eslint-plugin": "^6.14.0",

src/App.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import ChildVariant from './components/child-variant';
44
import TwSubChild from './components/tw-sub-child';
55
import FlexGap from './components/flex-gap';
66
import LayoutTrbla from './components/layout-trbla.tsx';
7+
import LayoutAbsCenter from './components/layout-abs-center.tsx';
8+
import LayoutTranslateCenter from './components/layout-translate-center.tsx';
79

810
function App() {
911
return (
@@ -37,6 +39,10 @@ function App() {
3739
<FlexGap />
3840
<hr />
3941
<LayoutTrbla />
42+
<hr />
43+
<LayoutAbsCenter />
44+
<hr />
45+
<LayoutTranslateCenter />
4046
</div>
4147
);
4248
}

src/components/layout-abs-center.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @email: aric.zheng@alo7.com
3+
* @description: A React page component.
4+
* @created_at: 2024-04-28 21:08:01
5+
*/
6+
7+
export default () => {
8+
return (
9+
<div className="debug-red relative block size-80">
10+
<h1>Layout Absolute Center</h1>
11+
<div className="layout-abs-center absolute size-12 rounded bg-amber-300"></div>
12+
</div>
13+
);
14+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* @email: aric.zheng@alo7.com
3+
* @description: A React page component.
4+
* @created_at: 2024-04-28 21:08:01
5+
*/
6+
7+
export default () => {
8+
return (
9+
<>
10+
<div className="debug-red relative block size-80">
11+
<h1>Dialog center</h1>
12+
<div className="layout-translate-center absolute size-16 rounded-xl bg-green-400"></div>
13+
</div>
14+
<div className="debug-red relative block size-80">
15+
<h1>Layout Translate Center</h1>
16+
<div className="layout-translate-center absolute size-16 rounded-xl bg-green-400"></div>
17+
<div className="layout-translate-center-xy absolute size-16 rounded-xl bg-amber-400"></div>
18+
<div className="layout-translate-center-y absolute size-16 rounded-full bg-blue-400"></div>
19+
<div className="layout-translate-center-x absolute top-0 size-16 rounded-3xl bg-red-400"></div>
20+
</div>
21+
</>
22+
);
23+
};

0 commit comments

Comments
 (0)