Skip to content

Commit

Permalink
🐛 fix: Fix Snippet warp
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Jun 7, 2024
1 parent 22be1aa commit f65b4e3
Showing 1 changed file with 52 additions and 54 deletions.
106 changes: 52 additions & 54 deletions src/Snippet/style.ts
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;
}
`,
),
};
});

0 comments on commit f65b4e3

Please sign in to comment.