UNPKG

@ant-design/x-markdown

Version:

placeholder for @ant-design/x-markdown

84 lines (83 loc) 2.61 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.prepareComponentToken = exports.default = void 0; var _cssinjsUtils = require("@ant-design/cssinjs-utils"); var _genStyleUtils = require("../../theme/genStyleUtils"); const genMermaidStyle = token => { const { componentCls } = token; return { [componentCls]: { '&-header': { display: 'flex', alignItems: 'center', justifyContent: 'space-between', background: token.colorBgTitle, color: token.colorTextTitle, padding: token.paddingSM, borderTopLeftRadius: token.borderRadius, borderTopRightRadius: token.borderRadius }, '&-graph': { display: 'flex', alignItems: 'center', justifyContent: 'center', border: `1px solid ${token.colorBgTitle}`, borderTop: 'none', padding: token.paddingSM, background: token.colorBgContainer, overflow: 'auto', borderBottomRightRadius: token.borderRadius, borderBottomLeftRadius: token.borderRadius }, '&-graph-hidden': { display: 'none' }, '&-graph svg': { maxWidth: '100%', height: 'auto' }, '&-code': { borderBottomRightRadius: token.borderRadius, borderBottomLeftRadius: token.borderRadius, borderBottom: `1px solid ${token.colorBgTitle}`, borderLeft: `1px solid ${token.colorBgTitle}`, borderRight: `1px solid ${token.colorBgTitle}`, background: token.colorBgContainer, paddingInline: token.paddingSM, paddingBlock: token.paddingSM, overflow: 'hidden', 'pre,code': { whiteSpace: 'pre', fontSize: token.fontSize, fontFamily: token.fontFamilyCode, lineHeight: 2, borderRadius: 0, border: 'none' }, "code[class*='language-'],pre[class*='language-']": { background: 'none' } }, [`&${componentCls}-rtl`]: { direction: 'rtl' } } }; }; const prepareComponentToken = token => { return { colorBgTitle: token.colorFillContent, colorBorderCode: token.colorBorderSecondary, colorBorderGraph: token.colorBorderSecondary, colorTextTitle: token.colorText }; }; exports.prepareComponentToken = prepareComponentToken; var _default = exports.default = (0, _genStyleUtils.genStyleHooks)('Mermaid', token => { const mermaidToken = (0, _cssinjsUtils.mergeToken)(token, {}); return [genMermaidStyle(mermaidToken)]; }, prepareComponentToken);