@antv/dumi-theme-antv 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +9 -0
  2. package/es/antv/404/index.js +20 -0
  3. package/es/antv/Banner/Banner.module.less +412 -0
  4. package/es/antv/Banner/Notification.js +44 -0
  5. package/es/antv/Banner/Notification.module.less +108 -0
  6. package/es/antv/Banner/index.js +115 -0
  7. package/es/antv/Cases/Cases.js +124 -0
  8. package/es/antv/Cases/Cases.module.less +203 -0
  9. package/es/antv/Features/FeatureCard.js +25 -0
  10. package/es/antv/Features/FeatureCard.module.less +51 -0
  11. package/es/antv/Features/Features.module.less +169 -0
  12. package/es/antv/Features/index.js +102 -0
  13. package/es/antv/Footer/Footer.module.less +36 -0
  14. package/es/antv/Footer/index.js +232 -0
  15. package/es/antv/Header/Logo.js +130 -0
  16. package/es/antv/Products/Product.js +61 -0
  17. package/es/antv/Products/Product.module.less +146 -0
  18. package/es/antv/Products/getNewProducts.js +41 -0
  19. package/es/antv/Products/getProducts.js +466 -0
  20. package/es/antv/Products/index.js +81 -0
  21. package/es/antv/hooks.js +81 -0
  22. package/es/antv/mixins.less +21 -0
  23. package/es/antv/utils.js +49 -0
  24. package/es/builtins/API.js +37 -0
  25. package/es/builtins/Alert.js +9 -0
  26. package/es/builtins/Alert.less +62 -0
  27. package/es/builtins/Badge.js +9 -0
  28. package/es/builtins/Badge.less +31 -0
  29. package/es/builtins/Example.js +48 -0
  30. package/es/builtins/Example.less +47 -0
  31. package/es/builtins/Previewer.js +225 -0
  32. package/es/builtins/Previewer.less +406 -0
  33. package/es/builtins/SourceCode.js +72 -0
  34. package/es/builtins/SourceCode.less +103 -0
  35. package/es/builtins/Table.js +56 -0
  36. package/es/builtins/Table.less +43 -0
  37. package/es/builtins/Tree.js +219 -0
  38. package/es/builtins/Tree.less +159 -0
  39. package/es/components/Dark.js +125 -0
  40. package/es/components/Dark.less +121 -0
  41. package/es/components/LocaleSelect.js +53 -0
  42. package/es/components/LocaleSelect.less +59 -0
  43. package/es/components/Navbar.js +155 -0
  44. package/es/components/Navbar.less +180 -0
  45. package/es/components/SearchBar.js +83 -0
  46. package/es/components/SearchBar.less +165 -0
  47. package/es/components/SideMenu.js +99 -0
  48. package/es/components/SideMenu.less +379 -0
  49. package/es/components/SlugList.js +33 -0
  50. package/es/components/SlugList.less +18 -0
  51. package/es/layout.js +276 -0
  52. package/es/style/layout.less +402 -0
  53. package/es/style/markdown.less +240 -0
  54. package/es/style/variables.less +37 -0
  55. package/package.json +58 -0
  56. package/src/antv/404/index.tsx +25 -0
  57. package/src/antv/Banner/Banner.module.less +412 -0
  58. package/src/antv/Banner/Notification.module.less +108 -0
  59. package/src/antv/Banner/Notification.tsx +45 -0
  60. package/src/antv/Banner/index.tsx +121 -0
  61. package/src/antv/Cases/Cases.module.less +203 -0
  62. package/src/antv/Cases/Cases.tsx +116 -0
  63. package/src/antv/Features/FeatureCard.module.less +51 -0
  64. package/src/antv/Features/FeatureCard.tsx +24 -0
  65. package/src/antv/Features/Features.module.less +169 -0
  66. package/src/antv/Features/index.tsx +86 -0
  67. package/src/antv/Footer/Footer.module.less +36 -0
  68. package/src/antv/Footer/index.tsx +272 -0
  69. package/src/antv/Header/Logo.tsx +85 -0
  70. package/src/antv/Products/Product.module.less +146 -0
  71. package/src/antv/Products/Product.tsx +80 -0
  72. package/src/antv/Products/getNewProducts.tsx +53 -0
  73. package/src/antv/Products/getProducts.tsx +626 -0
  74. package/src/antv/Products/index.tsx +70 -0
  75. package/src/antv/hooks.ts +87 -0
  76. package/src/antv/mixins.less +21 -0
  77. package/src/antv/utils.ts +44 -0
  78. package/src/builtins/API.tsx +57 -0
  79. package/src/builtins/Alert.less +62 -0
  80. package/src/builtins/Alert.tsx +4 -0
  81. package/src/builtins/Badge.less +31 -0
  82. package/src/builtins/Badge.tsx +4 -0
  83. package/src/builtins/Example.less +47 -0
  84. package/src/builtins/Example.tsx +34 -0
  85. package/src/builtins/Previewer.less +406 -0
  86. package/src/builtins/Previewer.tsx +264 -0
  87. package/src/builtins/SourceCode.less +103 -0
  88. package/src/builtins/SourceCode.tsx +55 -0
  89. package/src/builtins/Table.less +43 -0
  90. package/src/builtins/Table.tsx +42 -0
  91. package/src/builtins/Tree.less +159 -0
  92. package/src/builtins/Tree.tsx +130 -0
  93. package/src/components/Dark.less +121 -0
  94. package/src/components/Dark.tsx +78 -0
  95. package/src/components/LocaleSelect.less +59 -0
  96. package/src/components/LocaleSelect.tsx +53 -0
  97. package/src/components/Navbar.less +180 -0
  98. package/src/components/Navbar.tsx +152 -0
  99. package/src/components/SearchBar.less +165 -0
  100. package/src/components/SearchBar.tsx +68 -0
  101. package/src/components/SideMenu.less +379 -0
  102. package/src/components/SideMenu.tsx +148 -0
  103. package/src/components/SlugList.less +18 -0
  104. package/src/components/SlugList.tsx +20 -0
  105. package/src/layout.tsx +225 -0
  106. package/src/style/layout.less +402 -0
  107. package/src/style/markdown.less +240 -0
  108. package/src/style/variables.less +37 -0
  109. package/src/test/SearchBar.test.ts +32 -0
  110. package/src/test/Table.test.tsx +41 -0
  111. package/src/test/index.test.tsx +377 -0
package/es/layout.js ADDED
@@ -0,0 +1,276 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+
5
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
+
7
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
+
9
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
+
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
13
+ import { context, Link } from 'dumi/theme';
14
+ import i18n from 'i18next';
15
+ import React, { useContext, useState } from 'react';
16
+ import { initReactI18next } from 'react-i18next';
17
+ import NotFoundPage from './antv/404';
18
+ import Banner from './antv/Banner/index';
19
+ import Cases from './antv/Cases/Cases';
20
+ import Ideas from './antv/Features';
21
+ import Footer from './antv/Footer';
22
+ import Navbar from './components/Navbar';
23
+ import SearchBar from './components/SearchBar';
24
+ import SideMenu from './components/SideMenu';
25
+ import SlugList from './components/SlugList';
26
+ import './style/layout.less';
27
+ i18n.use(initReactI18next) // passes i18n down to react-i18next
28
+ .init({
29
+ initImmediate: false,
30
+ fallbackLng: 'zh',
31
+ keySeparator: false,
32
+ react: {
33
+ useSuspense: false
34
+ }
35
+ });
36
+
37
+ var isEmpty = function isEmpty(obj) {
38
+ return Object.keys(obj).length === 0;
39
+ };
40
+
41
+ var processRedirect = function processRedirect(context, location) {
42
+ var pathname = location.pathname;
43
+ var meta = context.meta,
44
+ routes = context.routes;
45
+ var isEmptyMeta = isEmpty(meta);
46
+ var matchRoute = {
47
+ meta: {}
48
+ };
49
+ var needRedirectPath = ['/zh', '/zh/', '/zh-CN', '/zh-CN/', '/en', '/en/', '/en-US', '/en-US/'];
50
+ var isInclude = needRedirectPath.some(function (item) {
51
+ return item === pathname;
52
+ });
53
+
54
+ if (isEmptyMeta) {
55
+ if (isInclude) {
56
+ // 存在重定向需求
57
+ var isZh = pathname.slice(1, 3) === 'zh';
58
+ var isEn = pathname.slice(1, 3) === 'en';
59
+
60
+ if (isZh) {
61
+ matchRoute = routes.find(function (item) {
62
+ return item.path === '/';
63
+ });
64
+ }
65
+
66
+ if (isEn) {
67
+ matchRoute = routes.find(function (item) {
68
+ return item.path === '/en-US';
69
+ });
70
+ }
71
+ }
72
+ }
73
+
74
+ return {
75
+ meta: isEmptyMeta ? matchRoute.meta : meta,
76
+ isDirect: isInclude
77
+ };
78
+ };
79
+
80
+ var Hero = function Hero(hero) {
81
+ return /*#__PURE__*/React.createElement("div", {
82
+ className: "__dumi-default-layout-hero"
83
+ }, hero.image && /*#__PURE__*/React.createElement("img", {
84
+ src: hero.image,
85
+ alt: "banner"
86
+ }), /*#__PURE__*/React.createElement("h1", null, hero.title), /*#__PURE__*/React.createElement("div", {
87
+ dangerouslySetInnerHTML: {
88
+ __html: hero.desc
89
+ }
90
+ }), hero.actions && hero.actions.map(function (action) {
91
+ return /*#__PURE__*/React.createElement(Link, {
92
+ to: action.link,
93
+ key: action.text
94
+ }, /*#__PURE__*/React.createElement("button", {
95
+ type: "button"
96
+ }, action.text));
97
+ }));
98
+ };
99
+
100
+ var BannerPanel = function BannerPanel(banner) {
101
+ var image = banner.image,
102
+ title = banner.title,
103
+ desc = banner.desc,
104
+ actions = banner.actions,
105
+ notifications = banner.notifications;
106
+ var description = /*#__PURE__*/React.createElement("div", {
107
+ dangerouslySetInnerHTML: {
108
+ __html: desc
109
+ }
110
+ });
111
+ var coverImage = /*#__PURE__*/React.createElement("img", {
112
+ alt: "graphin",
113
+ style: {
114
+ width: '100%',
115
+ marginTop: '20%'
116
+ },
117
+ src: image
118
+ });
119
+ return /*#__PURE__*/React.createElement(Banner, {
120
+ coverImage: coverImage,
121
+ title: title // @ts-ignore
122
+ ,
123
+ description: description,
124
+ notifications: notifications,
125
+ buttons: actions,
126
+ className: "banner"
127
+ });
128
+ };
129
+
130
+ var Features = function Features(features) {
131
+ return /*#__PURE__*/React.createElement("div", {
132
+ className: "__dumi-default-layout-features"
133
+ }, features.map(function (feat) {
134
+ return /*#__PURE__*/React.createElement("dl", {
135
+ key: feat.title,
136
+ style: {
137
+ backgroundImage: feat.icon ? "url(".concat(feat.icon, ")") : undefined
138
+ }
139
+ }, feat.link ? /*#__PURE__*/React.createElement(Link, {
140
+ to: feat.link
141
+ }, /*#__PURE__*/React.createElement("dt", null, feat.title)) : /*#__PURE__*/React.createElement("dt", null, feat.title), /*#__PURE__*/React.createElement("dd", {
142
+ dangerouslySetInnerHTML: {
143
+ __html: feat.desc
144
+ }
145
+ }));
146
+ }));
147
+ };
148
+
149
+ var Layout = function Layout(_ref) {
150
+ var _meta$slugs, _match;
151
+
152
+ var children = _ref.children,
153
+ location = _ref.location;
154
+ var Context = useContext(context);
155
+ var _Context$config = Context.config,
156
+ mode = _Context$config.mode,
157
+ repository = _Context$config.repository,
158
+ locale = Context.locale;
159
+
160
+ var _processRedirect = processRedirect(Context, location),
161
+ meta = _processRedirect.meta,
162
+ isDirect = _processRedirect.isDirect;
163
+
164
+ console.log('Context', Context, 'calculate meta', meta);
165
+ var repoUrl = repository.url,
166
+ branch = repository.branch,
167
+ platform = repository.platform;
168
+
169
+ var _useState = useState(true),
170
+ _useState2 = _slicedToArray(_useState, 2),
171
+ menuCollapsed = _useState2[0],
172
+ setMenuCollapsed = _useState2[1];
173
+
174
+ var isSiteMode = mode === 'site';
175
+ var showHero = isSiteMode && meta.hero;
176
+ var showBanner = isSiteMode && meta.banner;
177
+ var showCases = isSiteMode && meta.cases;
178
+ var showFeatures = isSiteMode && meta.features;
179
+ var showIdeas = isSiteMode && meta.ideas;
180
+ var showSideMenu = meta.sidemenu !== false && !showHero && !showBanner && !showFeatures && !meta.gapless;
181
+ var showSlugs = !showHero && !showBanner && !showFeatures && Boolean((_meta$slugs = meta.slugs) === null || _meta$slugs === void 0 ? void 0 : _meta$slugs.length) && (meta.toc === 'content' || meta.toc === undefined) && !meta.gapless;
182
+ var isCN = /^zh|cn$/i.test(locale); // eslint-disable-next-line @typescript-eslint/no-explicit-any
183
+
184
+ var updatedTime = new Date(meta.updatedTime).toLocaleString([], {
185
+ hour12: false
186
+ });
187
+ var repoPlatform = {
188
+ github: 'GitHub',
189
+ gitlab: 'GitLab'
190
+ }[((_match = (repoUrl || '').match(/(github|gitlab)/)) === null || _match === void 0 ? void 0 : _match[1]) || 'nothing'] || platform; // 等dumi最新版发布后解决路由匹配问题
191
+
192
+ if (isEmpty(meta) && !isDirect) {
193
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
194
+ style: {
195
+ marginBottom: '60px'
196
+ },
197
+ className: "__dumi-default-layout home",
198
+ "data-route": location.pathname,
199
+ "data-show-sidemenu": false,
200
+ "data-show-slugs": false,
201
+ "data-site-mode": "site",
202
+ "data-gapless": String(!!meta.gapless),
203
+ onClick: function onClick() {
204
+ if (menuCollapsed) return;
205
+ setMenuCollapsed(true);
206
+ }
207
+ }, /*#__PURE__*/React.createElement("div", {
208
+ style: {
209
+ height: '60px'
210
+ }
211
+ }), /*#__PURE__*/React.createElement(Navbar, {
212
+ location: location,
213
+ navPrefix: /*#__PURE__*/React.createElement(SearchBar, null),
214
+ onMobileMenuClick: function onMobileMenuClick(ev) {
215
+ setMenuCollapsed(function (val) {
216
+ return !val;
217
+ });
218
+ ev.stopPropagation();
219
+ }
220
+ }), /*#__PURE__*/React.createElement(NotFoundPage, null), /*#__PURE__*/React.createElement(Footer, {
221
+ location: window.location,
222
+ githubUrl: repoUrl,
223
+ rootDomain: "https://antv.vision"
224
+ })));
225
+ }
226
+
227
+ return /*#__PURE__*/React.createElement("div", {
228
+ className: "__dumi-default-layout ".concat(showBanner ? 'home' : ''),
229
+ "data-route": location.pathname,
230
+ "data-show-sidemenu": String(showSideMenu),
231
+ "data-show-slugs": String(showSlugs),
232
+ "data-site-mode": isSiteMode,
233
+ "data-gapless": String(!!meta.gapless),
234
+ onClick: function onClick() {
235
+ if (menuCollapsed) return;
236
+ setMenuCollapsed(true);
237
+ }
238
+ }, /*#__PURE__*/React.createElement(Navbar, {
239
+ location: location,
240
+ navPrefix: /*#__PURE__*/React.createElement(SearchBar, null),
241
+ onMobileMenuClick: function onMobileMenuClick(ev) {
242
+ setMenuCollapsed(function (val) {
243
+ return !val;
244
+ });
245
+ ev.stopPropagation();
246
+ }
247
+ }), showSideMenu && /*#__PURE__*/React.createElement(SideMenu, {
248
+ mobileMenuCollapsed: menuCollapsed,
249
+ location: location
250
+ }), showSlugs && /*#__PURE__*/React.createElement(SlugList, {
251
+ slugs: meta.slugs,
252
+ className: "__dumi-default-layout-toc"
253
+ }), showBanner && BannerPanel(meta.banner), showHero && Hero(meta.hero), showFeatures && Features(meta.features), showIdeas && /*#__PURE__*/React.createElement(Ideas, {
254
+ features: meta.ideas,
255
+ style: {
256
+ width: '100%'
257
+ }
258
+ }), showCases && /*#__PURE__*/React.createElement(Cases, {
259
+ cases: meta.cases,
260
+ className: "graph-cases"
261
+ }), /*#__PURE__*/React.createElement("div", {
262
+ className: "__dumi-default-layout-content"
263
+ }, children, showSideMenu && /*#__PURE__*/React.createElement("div", {
264
+ className: "__dumi-default-layout-footer-meta"
265
+ }, repoPlatform && /*#__PURE__*/React.createElement(Link, {
266
+ to: "".concat(repoUrl, "/edit/").concat(branch, "/").concat(meta.filePath)
267
+ }, isCN ? "\u5728 ".concat(repoPlatform, " \u4E0A\u7F16\u8F91\u6B64\u9875") : "Edit this doc on ".concat(repoPlatform)), /*#__PURE__*/React.createElement("span", {
268
+ "data-updated-text": isCN ? '最后更新时间:' : 'Last update: '
269
+ }, updatedTime)), !showSideMenu && /*#__PURE__*/React.createElement(Footer, {
270
+ location: window.location,
271
+ githubUrl: repoUrl,
272
+ rootDomain: "https://antv.vision"
273
+ })));
274
+ };
275
+
276
+ export default Layout;
@@ -0,0 +1,402 @@
1
+ @import "./markdown.less";
2
+ @import "./variables.less";
3
+
4
+ @s-toc-width: 136px;
5
+
6
+ body {
7
+ margin: 0;
8
+ font-family: -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC,
9
+ Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial,
10
+ sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
11
+ font-variant: tabular-nums;
12
+ font-feature-settings: "tnum";
13
+ transition: background 0.2s cubic-bezier(0.075, 0.82, 0.165, 1),
14
+ color 0.2s cubic-bezier(0.075, 0.82, 0.165, 1);
15
+
16
+ [data-prefers-color="dark"] & {
17
+ color: @c-text-dark;
18
+ background-color: @c-bg-dark;
19
+ }
20
+ }
21
+
22
+ .@{prefix}-layout {
23
+ box-sizing: border-box;
24
+ min-height: 100vh;
25
+ padding: 16px (@s-content-margin + @s-toc-width) 50px @s-menu-width +
26
+ @s-content-margin;
27
+ &.home {
28
+ padding: 0px !important;
29
+ }
30
+ @media @mobile {
31
+ padding-top: 66px !important;
32
+ padding-left: 16px !important;
33
+ padding-right: 16px !important;
34
+ }
35
+
36
+ &[data-gapless="true"] {
37
+ padding-top: @s-nav-height !important;
38
+ padding-right: 0 !important;
39
+ padding-left: 0 !important;
40
+ padding-bottom: 0;
41
+
42
+ @media @mobile {
43
+ padding-top: @s-mobile-nav-height !important;
44
+ }
45
+ }
46
+
47
+ &[data-show-sidemenu="false"] {
48
+ padding-left: @s-content-margin;
49
+ }
50
+
51
+ &[data-show-slugs="false"] {
52
+ padding-right: @s-content-margin;
53
+ }
54
+
55
+ &[data-site-mode="true"] {
56
+ padding-top: @s-nav-height + 50px;
57
+
58
+ &[data-show-sidemenu="true"] {
59
+ padding-left: @s-site-menu-width + 50px;
60
+ }
61
+
62
+ &[data-show-slugs="true"] {
63
+ padding-right: @s-content-margin + @s-toc-width + 14;
64
+ }
65
+
66
+ .@{prefix}-layout-content > .markdown:first-child > *:first-child {
67
+ margin-top: 0;
68
+ }
69
+
70
+ .@{prefix}-layout-toc {
71
+ top: 114px;
72
+ max-height: calc(90vh - 144px);
73
+ }
74
+ }
75
+
76
+ &-hero {
77
+ margin: -50px -58px 0;
78
+ padding: 100px 0;
79
+ text-align: center;
80
+ background-color: #f5f6f8;
81
+
82
+ [data-prefers-color="dark"] & {
83
+ background-color: @c-light-bg-dark;
84
+ }
85
+
86
+ @media @mobile {
87
+ margin: -16px -16px 0;
88
+ padding: 48px 0;
89
+ }
90
+
91
+ img {
92
+ max-width: 100%;
93
+ max-height: 200px;
94
+ margin-bottom: 1rem;
95
+ }
96
+
97
+ h1 {
98
+ margin: 0 0 16px;
99
+ font-size: 48px;
100
+ font-weight: 600;
101
+ line-height: 56px;
102
+ color: #080e29;
103
+
104
+ [data-prefers-color="dark"] & {
105
+ color: @c-heading-dark;
106
+ }
107
+
108
+ + div {
109
+ margin: 16px 0 32px;
110
+ opacity: 0.78;
111
+
112
+ .markdown {
113
+ font-size: 16px;
114
+ }
115
+ }
116
+ }
117
+
118
+ button {
119
+ margin-right: 16px;
120
+ padding: 0 32px;
121
+ height: 44px;
122
+ color: @c-primary;
123
+ font-size: 16px;
124
+ background: transparent;
125
+ border: 1px solid @c-primary;
126
+ border-radius: 22px;
127
+ box-sizing: border-box;
128
+ cursor: pointer;
129
+ outline: none;
130
+ transition: all 0.3s;
131
+
132
+ &:hover {
133
+ opacity: 0.8;
134
+ }
135
+
136
+ &:active {
137
+ opacity: 0.9;
138
+ }
139
+ }
140
+
141
+ a:last-child button {
142
+ margin-right: 0;
143
+ color: #fff;
144
+ background: @c-primary;
145
+ }
146
+ }
147
+
148
+ &-features {
149
+ display: grid;
150
+ grid-template-columns: repeat(3, 1fr);
151
+ grid-column-gap: 96px;
152
+ grid-row-gap: 56px;
153
+ padding: 72px 0;
154
+
155
+ > dl {
156
+ flex: 1;
157
+ margin: 0;
158
+ text-align: center;
159
+ background: no-repeat center top / auto 48px;
160
+
161
+ &[style*="background-image"] {
162
+ padding-top: 64px;
163
+ }
164
+
165
+ dt {
166
+ margin-bottom: 12px;
167
+ font-size: 20px;
168
+ line-height: 1;
169
+ color: @c-heading;
170
+ [data-prefers-color="dark"] & {
171
+ color: @c-text-dark;
172
+ }
173
+ }
174
+
175
+ a {
176
+ transition-duration: none;
177
+ }
178
+
179
+ a dt {
180
+ color: @c-link;
181
+ transition: opacity 0.2s;
182
+ &:hover {
183
+ opacity: 0.7;
184
+ text-decoration: underline;
185
+ }
186
+
187
+ &:active {
188
+ opacity: 0.9;
189
+ }
190
+ }
191
+
192
+ dd {
193
+ margin: 0;
194
+
195
+ .markdown {
196
+ color: @c-secondary;
197
+ font-size: 14px;
198
+ line-height: 22px;
199
+
200
+ [data-prefers-color="dark"] & {
201
+ color: @c-secondary-dark;
202
+ }
203
+
204
+ > p:first-child {
205
+ margin-top: 0;
206
+ }
207
+
208
+ > p:last-child {
209
+ margin-bottom: 0;
210
+ }
211
+ }
212
+ }
213
+ }
214
+
215
+ @media @mobile {
216
+ display: block;
217
+ padding: 40px 0;
218
+
219
+ > dl {
220
+ text-align: left;
221
+ background-position: left top;
222
+
223
+ &[style*="background-image"] {
224
+ padding: 0 0 0 60px;
225
+ }
226
+
227
+ + dl {
228
+ margin-top: 32px;
229
+ }
230
+ }
231
+ }
232
+ }
233
+
234
+ &-features,
235
+ &-features + &-content,
236
+ &-hero + &-content {
237
+ margin-left: auto;
238
+ margin-right: auto;
239
+ max-width: 960px;
240
+ }
241
+
242
+ &-hero + &-content {
243
+ margin-top: 60px;
244
+ }
245
+
246
+ &-toc {
247
+ list-style: none;
248
+ position: fixed;
249
+ z-index: 10;
250
+ top: 50px;
251
+ right: 0;
252
+ width: @s-toc-width;
253
+ max-height: calc(90vh - 80px);
254
+ margin: 0;
255
+ padding: 0 24px 0 0;
256
+ background-color: #fff;
257
+ box-sizing: content-box;
258
+ overflow: auto;
259
+
260
+ [data-prefers-color="dark"] & {
261
+ background-color: @c-bg-dark;
262
+ }
263
+
264
+ @media @mobile {
265
+ display: none;
266
+ }
267
+
268
+ li {
269
+ position: relative;
270
+ margin: 0;
271
+ padding: 4px 0 4px 6px;
272
+ text-indent: 12px;
273
+ font-size: 13px;
274
+ line-height: 1.40625;
275
+ white-space: nowrap;
276
+ text-overflow: ellipsis;
277
+ overflow: hidden;
278
+
279
+ a {
280
+ color: @c-text;
281
+ text-decoration: none;
282
+
283
+ [data-prefers-color="dark"] & {
284
+ color: @c-text-dark;
285
+ }
286
+
287
+ &::before {
288
+ content: "";
289
+ position: absolute;
290
+ top: 0;
291
+ left: 0;
292
+ bottom: 0;
293
+ display: inline-block;
294
+ width: 2px;
295
+ background: @c-border;
296
+ }
297
+
298
+ &:hover {
299
+ color: lighten(@c-primary, 5%);
300
+
301
+ [data-prefers-color="dark"] & {
302
+ color: lighten(@c-primary-dark, 5%);
303
+ }
304
+ }
305
+
306
+ &:active {
307
+ color: lighten(@c-primary, 3%);
308
+
309
+ [data-prefers-color="dark"] & {
310
+ color: lighten(@c-primary-dark, 3%);
311
+ }
312
+ }
313
+
314
+ &.active {
315
+ color: @c-primary;
316
+
317
+ [data-prefers-color="dark"] & {
318
+ color: @c-primary-dark;
319
+ }
320
+
321
+ &::before {
322
+ background: @c-primary;
323
+
324
+ [data-prefers-color="dark"] & {
325
+ background: @c-primary-dark;
326
+ }
327
+ }
328
+ }
329
+ }
330
+ }
331
+ }
332
+
333
+ &-footer-meta {
334
+ margin-top: 40px;
335
+ padding-top: 24px;
336
+ display: flex;
337
+ color: @c-secondary;
338
+ font-size: 14px;
339
+ justify-content: space-between;
340
+ border-top: 1px solid @c-border;
341
+
342
+ [data-prefers-color="dark"] & {
343
+ color: @c-secondary-dark;
344
+ border-color: @c-border-dark;
345
+ }
346
+
347
+ @media only screen and (max-width: 960px) {
348
+ display: block;
349
+ }
350
+
351
+ > a {
352
+ margin-bottom: 4px;
353
+ display: block;
354
+ color: @c-primary;
355
+ transition: opacity 0.2s;
356
+ text-decoration: none;
357
+
358
+ [data-prefers-color="dark"] & {
359
+ color: @c-primary-dark;
360
+ }
361
+
362
+ &:hover {
363
+ opacity: 0.7;
364
+ text-decoration: underline;
365
+ }
366
+
367
+ &:active {
368
+ opacity: 0.9;
369
+ }
370
+ }
371
+
372
+ > span:last-child {
373
+ &::before {
374
+ content: attr(data-updated-text);
375
+ color: @c-primary;
376
+
377
+ [data-prefers-color="dark"] & {
378
+ color: @c-primary-dark;
379
+ }
380
+ }
381
+ }
382
+ }
383
+ }
384
+
385
+ .__dumi-default-layout-footer {
386
+ margin: 72px 0 -32px;
387
+ padding-top: 24px;
388
+ border-top: 1px solid @c-border;
389
+ text-align: center;
390
+
391
+ [data-prefers-color="dark"] & {
392
+ border-color: @c-border-dark;
393
+ }
394
+
395
+ .markdown {
396
+ color: #b0b1ba;
397
+
398
+ [data-prefers-color="dark"] & {
399
+ color: rgba(255, 255, 255, 0.45);
400
+ }
401
+ }
402
+ }