UNPKG

2.23 kBJavaScriptView Raw
1var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5 return c > 3 && r && Object.defineProperty(target, key, r), r;
6};
7import { adoptedStyle, customElement } from '@mantou/gem/lib/decorators';
8import { GemElement } from '@mantou/gem/lib/element';
9import { createCSSSheet, css } from '@mantou/gem/lib/utils';
10import { theme } from '../lib/theme';
11const style = createCSSSheet(css `
12 :where(dy-paragraph:not([hidden])) {
13 display: block;
14 margin-block-end: 0.75em;
15 line-height: 1.5;
16 }
17 :where(dy-paragraph):where(:lang(zh), :lang(ja), :lang(kr)) {
18 line-height: 1.7;
19 }
20 :where(gem-link, dy-link):where(:not([hidden])) {
21 display: inline-block;
22 color: ${theme.primaryColor};
23 text-decoration: underline;
24 }
25 :where(gem-link, dy-link):where(:lang(zh), :lang(ja), :lang(kr)) {
26 text-underline-offset: 0.125em;
27 }
28 ul,
29 ol {
30 margin-block: 0 1em;
31 padding: 0;
32 list-style-position: inside;
33 }
34 li {
35 padding-inline-start: 0.5em;
36 }
37 code,
38 kbd {
39 font-family: ${theme.codeFont};
40 margin-inline: 0.2em;
41 padding: 0.15em 0.4em 0.1em;
42 font-size: 0.9em;
43 border: 1px solid ${theme.borderColor};
44 border-radius: ${theme.smallRound};
45 }
46 code {
47 background: ${theme.hoverBackgroundColor};
48 }
49 kbd {
50 background: ${theme.lightBackgroundColor};
51 border-bottom-width: 2px;
52 }
53`);
54/**
55 * @customElement dy-paragraph
56 */
57let DuoyunParagraphElement = class DuoyunParagraphElement extends GemElement {
58 constructor() {
59 super({ isLight: true });
60 this.internals.role = 'paragraph';
61 }
62};
63DuoyunParagraphElement = __decorate([
64 customElement('dy-paragraph'),
65 adoptedStyle(style)
66], DuoyunParagraphElement);
67export { DuoyunParagraphElement };
68//# sourceMappingURL=paragraph.js.map
\No newline at end of file