Skip to content

Commit

Permalink
feat: ✨ 添加全局Paper样式
Browse files Browse the repository at this point in the history
  • Loading branch information
G committed Dec 18, 2023
1 parent 9727b16 commit 7c49824
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
2 changes: 2 additions & 0 deletions apps/admin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useGlobalStore } from 'store';
import cyanImg from '@/assets/images/cyan-blur.png';
import redImg from '@/assets/images/red-blur.png';
import router from '@/router';
import CustomGlobal from '@/styles/GlobalPager';

function App() {
const preset = useGlobalStore((state) => state.preset);
Expand All @@ -27,6 +28,7 @@ function App() {
paperCyanImg: cyanImg as string,
}}
>
<CustomGlobal />
<RouterProvider router={router} />
</ThemeProvider>
);
Expand Down
25 changes: 8 additions & 17 deletions apps/admin/src/styles/GlobalPager.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
import { createStyles } from 'antd-style';
import { createGlobalStyle } from 'antd-style';
// 定义全局类名样式
const CustomGlobal = createGlobalStyle`
.g-paper {
border-radius: ${(p) => p.theme.borderRadius * 2}px;
}
`;

const useStyles = createStyles(({ token, css, prefixCls }) => {
console.log(token);

return {
override: css`
&.${prefixCls}-drawer {
backdrop-filter: blur(20px);
background-color: rgba(255, 255, 255, 0.9);
background-size: 50% 50%;
background-repeat: no-repeat;
}
`,
};
});

export default useStyles;
export default CustomGlobal;
2 changes: 1 addition & 1 deletion apps/admin/src/views/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const HomePage: FC = () => {
<div className={styles['home-container']}>
<Row gutter={{ xs: 8, sm: 16, md: 24, lg: 32 }}>
<Col className='gutter-row' span={16}>
<div className='user-info'>
<div className='user-info g-paper'>
<Row
style={{
padding: '40px',
Expand Down

0 comments on commit 7c49824

Please sign in to comment.