You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rust-course/theme/markdown-render.ts

76 lines
2.2 KiB

4 years ago
import { mode } from "@chakra-ui/theme-tools"
import userCustomTheme from "./user-custom"
export default function markdownRender(props) {
4 years ago
console.log(props)
4 years ago
return {
'.markdown-render': {
4 years ago
wordBreak: 'break-word',
4 years ago
'.hljs' : {
padding: '1rem',
borderRadius: '8px'
},
'ul,ol' : {
paddingLeft: '1rem',
margin: '1.2rem 0',
li: {
margin: '.8rem 0'
}
},
'h1': {
fontSize: '2rem',
fontWeight: 'bold',
marginBottom: '0.8rem'
},
'h2': {
fontSize: '1.8rem',
fontWeight: 'bold',
marginBottom: '0.6rem'
},
'h3': {
fontSize: '1.6em',
fontWeight: '600',
marginBottom: '0.4rem'
},
'h4': {
fontSize: '1.4em',
fontWeight: '600'
},
'h5,h6': {
fontSize: '1.2em',
fontWeight: 'normal'
},
p: {
margin: '1.2rem 0',
},
blockquote: {
lineHeight: '2rem',
margin: '1.5rem 0',
p :{
paddingLeft: '1rem',
fontWeight: '500',
fontStyle: 'italic',
borderLeftWidth: '.25rem',
borderLeftColor: '#e5e7eb',
color: mode("inherit", "'rgb(189, 189, 189)'")(props),
fontSize: '1.2rem',
}
},
pre: {
4 years ago
margin: '1.6rem 0',
fontSize: '.95rem'
4 years ago
},
a: {
textDecoration: 'underline !important'
4 years ago
},
'.at-user-link': {
textDecoration: 'none !important',
borderBottom: '2px dashed rgb(158, 158, 158)',
margin:'0 3px',
color: mode(props.theme.colors.teal[600], props.theme.colors.teal[200])(props),
fontWeight: '550',
paddingBottom: '2px'
4 years ago
}
}
}
}