Skip to content

Commit

Permalink
💄 style: Update Markdown style
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Mar 15, 2024
1 parent 5b8dccf commit e39802f
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 71 deletions.
6 changes: 3 additions & 3 deletions example/src/ActionIcon/demos/CustomSize.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ActionIcon, ActionIconProps, StroyBook, useControls, useCreateStore } from '@lobehub/ui';
import { ActionIcon, ActionIconProps, StoryBook, useControls, useCreateStore } from '@lobehub/ui';
import { Settings } from 'lucide-react';

export default () => {
Expand Down Expand Up @@ -34,8 +34,8 @@ export default () => {
);

return (
<StroyBook levaStore={store}>
<StoryBook levaStore={store}>
<ActionIcon active icon={Settings} size={size} />
</StroyBook>
</StoryBook>
);
};
6 changes: 3 additions & 3 deletions example/src/ActionIcon/demos/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ActionIcon, ActionIconProps, StroyBook, useControls, useCreateStore } from '@lobehub/ui';
import { ActionIcon, ActionIconProps, StoryBook, useControls, useCreateStore } from '@lobehub/ui';
import { folder } from 'leva';
import * as LucideIcon from 'lucide-react';

Expand Down Expand Up @@ -44,8 +44,8 @@ export default () => {
);

return (
<StroyBook levaStore={store}>
<StoryBook levaStore={store}>
<ActionIcon {...control} />
</StroyBook>
</StoryBook>
);
};
8 changes: 4 additions & 4 deletions src/components/NativeSelect/SelectItem/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ForwardedRef, forwardRef, memo } from 'react';
import { ForwardedRef, forwardRef } from 'react';

import { useStyles } from './style';

Expand All @@ -12,8 +12,8 @@ interface SelectItemProps {
value: any;
}

const SelectItem = memo<SelectItemProps>(
forwardRef(({ value, label, prefixCls, isSelected, isActive, disabled, ...props }, reference) => {
const SelectItem = forwardRef<any, SelectItemProps>(
({ value, label, prefixCls, isSelected, isActive, disabled, ...props }, reference) => {
const { styles, cx } = useStyles(prefixCls);

return (
Expand All @@ -34,7 +34,7 @@ const SelectItem = memo<SelectItemProps>(
{label}
</button>
);
}),
},
);

export default SelectItem;
6 changes: 1 addition & 5 deletions src/layouts/DocLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,7 @@ export default memo(() => {
<>
<Favicons />
<StoreUpdater />
<ThemeProvider
cache={extractStaticStyle.cache}
customToken={customToken}
themeMode={themeMode}
>
<ThemeProvider customToken={customToken} themeMode={themeMode}>
<GlobalStyle />
<DocumentLayout />
</ThemeProvider>
Expand Down
8 changes: 4 additions & 4 deletions src/slots/Content/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Skeleton, Typography } from 'antd';
import { Typography } from '@lobehub/ui';
import { Skeleton } from 'antd';
import { useResponsive } from 'antd-style';
import { memo } from 'react';
import { Flexbox } from 'react-layout-kit';
Expand All @@ -17,16 +18,15 @@ const Content = memo<DivProps>(({ children, ...props }) => {

return (
<Flexbox gap={mobile ? 0 : 24} width={'100%'} {...props}>
<Typography />
<div className={cx('dumi-antd-style-content', styles.content)}>
<Skeleton active loading={loading} paragraph />
<div
<Typography
style={{
display: loading ? 'none' : undefined,
}}
>
{children}
</div>
</Typography>
</div>
<ContentFooter />
</Flexbox>
Expand Down
60 changes: 11 additions & 49 deletions src/slots/Content/style.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { createStyles } from 'antd-style';

export const useStyles = createStyles(({ token, responsive, css, stylish }) => ({
export const useStyles = createStyles(({ token, responsive, css }) => ({
content: css`
flex: 1;
box-sizing: border-box;
width: 100%;
min-height: 400px;
margin-top: 24px;
padding: 24px 48px;
background-color: ${token.colorBgContainer};
Expand All @@ -22,57 +23,18 @@ export const useStyles = createStyles(({ token, responsive, css, stylish }) => (
}
.markdown {
${stylish.markdown};
h2,
h3 {
&[id^='version'] {
color: ${token.colorText};
}
}
h1,
h2,
h3,
h4,
h5,
h6 {
transition: all 400ms ${token.motionEaseOut};
> a[aria-hidden]:first-child {
float: left;
width: 20px;
margin-inline-start: -24px;
padding-inline-end: 4px;
summary kbd {
transform: unset;
font-size: inherit;
line-height: inherit;
color: ${token.colorText};
text-align: right;
padding: unset;
&:hover {
border: 0;
}
> .icon-link::before {
content: '#';
font-size: inherit;
color: ${token.colorTextTertiary};
}
}
&:hover {
color: ${token.colorText};
}
&:not(:hover) > a[aria-hidden]:first-child > .icon-link {
visibility: hidden;
}
}
font-size: inherit;
line-height: inherit;
color: inherit;
ol,
ul {
padding-inline-start: 18px;
background: unset;
border: unset;
box-shadow: unset;
}
}
`,
Expand Down
4 changes: 1 addition & 3 deletions src/slots/Features/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const Features = memo(() => {

if (!features?.length) return;

return (
<F contentMaxWidth={theme.contentMaxWidth} items={features} style={{ margin: '0 16px' }} />
);
return <F items={features} maxWidth={theme.contentMaxWidth} style={{ margin: '0 16px' }} />;
});

export default Features;

0 comments on commit e39802f

Please sign in to comment.