forked from lobehub/lobe-ui
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22be1aa
commit f65b4e3
Showing
1 changed file
with
52 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,61 @@ | ||
import { createStyles } from 'antd-style'; | ||
|
||
export const useStyles = createStyles( | ||
({ css, cx, token, prefixCls, stylish }, type: 'ghost' | 'block') => { | ||
const typeStylish = css` | ||
background-color: ${type === 'block' ? token.colorFillTertiary : 'transparent'}; | ||
border: 1px solid ${type === 'block' ? 'transparent' : token.colorBorder}; | ||
`; | ||
|
||
return { | ||
container: cx( | ||
typeStylish, | ||
css` | ||
position: relative; | ||
overflow: hidden; | ||
max-width: 100%; | ||
height: 38px; | ||
padding-block: 0; | ||
padding-inline: 12px 8px; | ||
border-radius: ${token.borderRadius}px; | ||
export const useStyles = createStyles(({ css, cx, token, prefixCls }, type: 'ghost' | 'block') => { | ||
const typeStylish = css` | ||
background-color: ${type === 'block' ? token.colorFillTertiary : 'transparent'}; | ||
border: 1px solid ${type === 'block' ? 'transparent' : token.colorBorder}; | ||
`; | ||
|
||
transition: background-color 100ms ${token.motionEaseOut}; | ||
return { | ||
container: cx( | ||
typeStylish, | ||
css` | ||
position: relative; | ||
&:hover { | ||
background-color: ${token.colorFillTertiary}; | ||
} | ||
overflow: hidden; | ||
.${prefixCls}-highlighter-shiki { | ||
position: relative; | ||
overflow: hidden; | ||
flex: 1; | ||
} | ||
max-width: 100%; | ||
height: 38px; | ||
padding-block: 0; | ||
padding-inline: 12px 8px; | ||
.prism-code { | ||
background: none !important; | ||
} | ||
border-radius: ${token.borderRadius}px; | ||
pre { | ||
${stylish.noScrollbar}; | ||
overflow: auto hidden !important; | ||
display: flex; | ||
align-items: center; | ||
transition: background-color 100ms ${token.motionEaseOut}; | ||
width: 100%; | ||
height: 36px !important; | ||
margin: 0 !important; | ||
&:hover { | ||
background-color: ${token.colorFillTertiary}; | ||
} | ||
line-height: 1; | ||
background: none !important; | ||
} | ||
code[class*='language-'] { | ||
background: none !important; | ||
} | ||
`, | ||
), | ||
}; | ||
}, | ||
); | ||
.${prefixCls}-highlighter-shiki { | ||
position: relative; | ||
overflow: hidden; | ||
flex: 1; | ||
} | ||
.prism-code { | ||
background: none !important; | ||
} | ||
pre { | ||
overflow: auto hidden !important; | ||
display: flex; | ||
align-items: center; | ||
width: 100%; | ||
height: 36px !important; | ||
margin: 0 !important; | ||
line-height: 1; | ||
text-wrap: nowrap !important; | ||
background: none !important; | ||
} | ||
code[class*='language-'] { | ||
background: none !important; | ||
} | ||
`, | ||
), | ||
}; | ||
}); |