@rspress/core 1.2.1 → 1.3.1

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 (158) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +56 -43
  3. package/dist/index.js.map +1 -1
  4. package/dist/loader.d.ts +1 -1
  5. package/dist/loader.js.map +1 -1
  6. package/dist/runtime/App.js +8 -4
  7. package/dist/runtime/clientEntry.js +7 -4
  8. package/dist/runtime/ssrEntry.js +2 -2
  9. package/package.json +19 -15
  10. package/runtime.ts +1 -1
  11. package/src/runtime/App.tsx +8 -4
  12. package/src/runtime/clientEntry.tsx +7 -4
  13. package/src/runtime/ssrEntry.tsx +2 -2
  14. package/theme.ts +2 -2
  15. package/dist/runtime/Content.d.ts +0 -6
  16. package/dist/runtime/Content.js +0 -33
  17. package/dist/runtime/NoSSR.d.ts +0 -4
  18. package/dist/runtime/NoSSR.js +0 -17
  19. package/dist/runtime/hooks.d.ts +0 -39
  20. package/dist/runtime/hooks.js +0 -54
  21. package/dist/runtime/index.d.ts +0 -6
  22. package/dist/runtime/index.js +0 -34
  23. package/dist/runtime/utils.d.ts +0 -8
  24. package/dist/runtime/utils.js +0 -45
  25. package/dist/theme/bundle.css +0 -2691
  26. package/dist/theme/bundle.d.ts +0 -176
  27. package/dist/theme/bundle.js +0 -4433
  28. package/dist/theme/bundle.js.map +0 -1
  29. package/dist/theme/index.js +0 -6
  30. package/src/runtime/Content.tsx +0 -43
  31. package/src/runtime/NoSSR.tsx +0 -16
  32. package/src/runtime/hooks.ts +0 -110
  33. package/src/runtime/index.ts +0 -17
  34. package/src/runtime/utils.ts +0 -46
  35. package/src/theme-default/assets/arrow-down.svg +0 -1
  36. package/src/theme-default/assets/arrow-right.svg +0 -1
  37. package/src/theme-default/assets/copy.svg +0 -1
  38. package/src/theme-default/assets/down.svg +0 -1
  39. package/src/theme-default/assets/github.svg +0 -1
  40. package/src/theme-default/assets/loading.svg +0 -1
  41. package/src/theme-default/assets/menu.svg +0 -1
  42. package/src/theme-default/assets/moon.svg +0 -3
  43. package/src/theme-default/assets/right.svg +0 -1
  44. package/src/theme-default/assets/small-menu.svg +0 -1
  45. package/src/theme-default/assets/success.svg +0 -1
  46. package/src/theme-default/assets/sun.svg +0 -11
  47. package/src/theme-default/assets/translator.svg +0 -1
  48. package/src/theme-default/components/Aside/index.css +0 -22
  49. package/src/theme-default/components/Aside/index.tsx +0 -75
  50. package/src/theme-default/components/BackDrop/index.module.scss +0 -14
  51. package/src/theme-default/components/BackDrop/index.tsx +0 -13
  52. package/src/theme-default/components/Button/index.module.scss +0 -68
  53. package/src/theme-default/components/Button/index.tsx +0 -40
  54. package/src/theme-default/components/DocFooter/index.module.scss +0 -60
  55. package/src/theme-default/components/DocFooter/index.tsx +0 -66
  56. package/src/theme-default/components/EditLink/index.module.scss +0 -11
  57. package/src/theme-default/components/EditLink/index.tsx +0 -18
  58. package/src/theme-default/components/HomeFeatures/index.module.scss +0 -50
  59. package/src/theme-default/components/HomeFeatures/index.tsx +0 -65
  60. package/src/theme-default/components/HomeFooter/index.tsx +0 -15
  61. package/src/theme-default/components/HomeHero/index.module.scss +0 -42
  62. package/src/theme-default/components/HomeHero/index.tsx +0 -75
  63. package/src/theme-default/components/Link/index.module.scss +0 -9
  64. package/src/theme-default/components/Link/index.tsx +0 -90
  65. package/src/theme-default/components/LocalSideBar/index.scss +0 -40
  66. package/src/theme-default/components/LocalSideBar/index.tsx +0 -39
  67. package/src/theme-default/components/Nav/NavBarTitle.tsx +0 -43
  68. package/src/theme-default/components/Nav/NavMenuGroup.tsx +0 -156
  69. package/src/theme-default/components/Nav/NavMenuSingleItem.tsx +0 -40
  70. package/src/theme-default/components/Nav/NavTranslations.tsx +0 -16
  71. package/src/theme-default/components/Nav/NavVersions.tsx +0 -16
  72. package/src/theme-default/components/Nav/index.module.scss +0 -115
  73. package/src/theme-default/components/Nav/index.tsx +0 -150
  74. package/src/theme-default/components/Nav/menuDataHooks.tsx +0 -75
  75. package/src/theme-default/components/NavHambmger/index.module.scss +0 -81
  76. package/src/theme-default/components/NavHambmger/index.tsx +0 -39
  77. package/src/theme-default/components/NavScreen/NavScreenMenuGroup.tsx +0 -95
  78. package/src/theme-default/components/NavScreen/index.module.scss +0 -88
  79. package/src/theme-default/components/NavScreen/index.tsx +0 -123
  80. package/src/theme-default/components/Overview/index.module.scss +0 -154
  81. package/src/theme-default/components/Overview/index.tsx +0 -136
  82. package/src/theme-default/components/PackageManagerTabs/icons/Bun.tsx +0 -101
  83. package/src/theme-default/components/PackageManagerTabs/icons/Npm.tsx +0 -16
  84. package/src/theme-default/components/PackageManagerTabs/icons/Pnpm.tsx +0 -22
  85. package/src/theme-default/components/PackageManagerTabs/icons/Yarn.tsx +0 -18
  86. package/src/theme-default/components/PackageManagerTabs/index.scss +0 -5
  87. package/src/theme-default/components/PackageManagerTabs/index.tsx +0 -110
  88. package/src/theme-default/components/Search/NoSearchResult.tsx +0 -13
  89. package/src/theme-default/components/Search/SearchPanel.tsx +0 -340
  90. package/src/theme-default/components/Search/SuggestItem.tsx +0 -135
  91. package/src/theme-default/components/Search/assets/close.svg +0 -1
  92. package/src/theme-default/components/Search/assets/file.svg +0 -1
  93. package/src/theme-default/components/Search/assets/header.svg +0 -1
  94. package/src/theme-default/components/Search/assets/jump.svg +0 -1
  95. package/src/theme-default/components/Search/assets/loading.svg +0 -1
  96. package/src/theme-default/components/Search/assets/search.svg +0 -1
  97. package/src/theme-default/components/Search/assets/title.svg +0 -1
  98. package/src/theme-default/components/Search/empty.svg +0 -4
  99. package/src/theme-default/components/Search/index.module.scss +0 -236
  100. package/src/theme-default/components/Search/index.tsx +0 -39
  101. package/src/theme-default/components/Search/logic/Provider.ts +0 -35
  102. package/src/theme-default/components/Search/logic/providers/LocalProvider.ts +0 -102
  103. package/src/theme-default/components/Search/logic/providers/RemoteProvider.ts +0 -40
  104. package/src/theme-default/components/Search/logic/search.ts +0 -341
  105. package/src/theme-default/components/Search/logic/util.test.ts +0 -21
  106. package/src/theme-default/components/Search/logic/util.ts +0 -127
  107. package/src/theme-default/components/Sidebar/SidebarGroup.tsx +0 -180
  108. package/src/theme-default/components/Sidebar/SidebarItem.tsx +0 -61
  109. package/src/theme-default/components/Sidebar/index.module.scss +0 -142
  110. package/src/theme-default/components/Sidebar/index.tsx +0 -156
  111. package/src/theme-default/components/SocialLinks/HiddenLinks.tsx +0 -30
  112. package/src/theme-default/components/SocialLinks/LinkContent.tsx +0 -90
  113. package/src/theme-default/components/SocialLinks/ShownLinks.tsx +0 -32
  114. package/src/theme-default/components/SocialLinks/index.module.scss +0 -18
  115. package/src/theme-default/components/SocialLinks/index.tsx +0 -36
  116. package/src/theme-default/components/SocialLinks/presetIcons.tsx +0 -165
  117. package/src/theme-default/components/SwitchAppearance/index.module.scss +0 -15
  118. package/src/theme-default/components/SwitchAppearance/index.tsx +0 -35
  119. package/src/theme-default/components/Tabs/index.module.scss +0 -46
  120. package/src/theme-default/components/Tabs/index.tsx +0 -123
  121. package/src/theme-default/components/Tag/index.tsx +0 -18
  122. package/src/theme-default/components/Toc/index.css +0 -18
  123. package/src/theme-default/components/Toc/index.tsx +0 -42
  124. package/src/theme-default/index.ts +0 -26
  125. package/src/theme-default/layout/DocLayout/docComponents/code.tsx +0 -112
  126. package/src/theme-default/layout/DocLayout/docComponents/hr.tsx +0 -10
  127. package/src/theme-default/layout/DocLayout/docComponents/index.module.scss +0 -69
  128. package/src/theme-default/layout/DocLayout/docComponents/index.tsx +0 -33
  129. package/src/theme-default/layout/DocLayout/docComponents/link.tsx +0 -22
  130. package/src/theme-default/layout/DocLayout/docComponents/list.tsx +0 -13
  131. package/src/theme-default/layout/DocLayout/docComponents/paragraph.tsx +0 -19
  132. package/src/theme-default/layout/DocLayout/docComponents/pre.tsx +0 -37
  133. package/src/theme-default/layout/DocLayout/docComponents/prisim-theme.ts +0 -73
  134. package/src/theme-default/layout/DocLayout/docComponents/table.tsx +0 -37
  135. package/src/theme-default/layout/DocLayout/docComponents/title.tsx +0 -40
  136. package/src/theme-default/layout/DocLayout/index.module.scss +0 -138
  137. package/src/theme-default/layout/DocLayout/index.tsx +0 -125
  138. package/src/theme-default/layout/HomeLayout/index.css +0 -18
  139. package/src/theme-default/layout/HomeLayout/index.tsx +0 -39
  140. package/src/theme-default/layout/Layout/index.tsx +0 -176
  141. package/src/theme-default/layout/NotFountLayout/index.tsx +0 -40
  142. package/src/theme-default/logic/TabDataContext.ts +0 -14
  143. package/src/theme-default/logic/index.ts +0 -8
  144. package/src/theme-default/logic/sideEffects.ts +0 -174
  145. package/src/theme-default/logic/useAppearance.ts +0 -57
  146. package/src/theme-default/logic/useEditLink.ts +0 -33
  147. package/src/theme-default/logic/useHiddenNav.ts +0 -58
  148. package/src/theme-default/logic/useLocaleSiteData.ts +0 -26
  149. package/src/theme-default/logic/useNav.ts +0 -36
  150. package/src/theme-default/logic/usePathUtils.ts +0 -73
  151. package/src/theme-default/logic/usePrevNextPage.ts +0 -40
  152. package/src/theme-default/logic/useSidebarData.ts +0 -73
  153. package/src/theme-default/logic/utils.ts +0 -38
  154. package/src/theme-default/styles/base.css +0 -102
  155. package/src/theme-default/styles/code.css +0 -177
  156. package/src/theme-default/styles/index.ts +0 -7
  157. package/src/theme-default/styles/scrollbar.css +0 -28
  158. package/src/theme-default/styles/vars.css +0 -81
@@ -1,73 +0,0 @@
1
- import { isExternalUrl } from '@rspress/shared';
2
- import {
3
- removeBase,
4
- useLang,
5
- usePageData,
6
- normalizeHrefInRuntime as normalizeHref,
7
- useVersion,
8
- withBase,
9
- } from '@/runtime';
10
-
11
- export function usePathUtils() {
12
- const currentLang = useLang();
13
- const currentVersion = useVersion();
14
- const pageData = usePageData();
15
- const defaultLang = pageData.siteData.lang;
16
- const defaultVersion = pageData.siteData.multiVersion.default;
17
-
18
- const normalizeLinkHref = (rawHref: string) => {
19
- let href = rawHref;
20
- if (
21
- (defaultLang || defaultVersion) &&
22
- !isExternalUrl(href) &&
23
- !href.startsWith('#')
24
- ) {
25
- href = removeBase(href);
26
- const linkParts = href.split('/').filter(Boolean);
27
- let versionPart = '';
28
- let langPart = '';
29
- let purePathPart = '';
30
-
31
- // When add the version prefix, the situation is as follows:
32
- // - current version is not default version
33
- // - current link does not start with currrent version
34
- if (defaultVersion) {
35
- if (currentVersion !== defaultVersion) {
36
- versionPart = currentVersion;
37
-
38
- if (linkParts[0] === currentVersion) {
39
- linkParts.shift();
40
- }
41
- } else if (linkParts[0] === defaultVersion) {
42
- linkParts.shift();
43
- }
44
- }
45
-
46
- if (defaultLang) {
47
- if (currentLang !== defaultLang) {
48
- langPart = currentLang;
49
-
50
- if (linkParts[0] === currentLang) {
51
- linkParts.shift();
52
- }
53
- } else if (linkParts[0] === defaultLang) {
54
- linkParts.shift();
55
- }
56
- }
57
-
58
- purePathPart = linkParts.join('/');
59
-
60
- return normalizeHref(
61
- withBase(
62
- [versionPart, langPart, purePathPart].filter(Boolean).join('/'),
63
- ),
64
- );
65
- } else {
66
- return href;
67
- }
68
- };
69
-
70
- return {
71
- normalizeLinkHref,
72
- };
73
- }
@@ -1,40 +0,0 @@
1
- import { NormalizedSidebarGroup, SidebarItem } from '@rspress/shared';
2
- import { useLocation } from 'react-router-dom';
3
- import { useSidebarData } from './useSidebarData';
4
- import { withBase, isEqualPath } from '@/runtime';
5
-
6
- export function usePrevNextPage() {
7
- const { pathname } = useLocation();
8
- const { items } = useSidebarData();
9
- const flattenTitles: SidebarItem[] = [];
10
-
11
- const walk = (sidebarItem: NormalizedSidebarGroup | SidebarItem) => {
12
- if ('items' in sidebarItem) {
13
- if (sidebarItem.link) {
14
- flattenTitles.push({
15
- text: sidebarItem.text,
16
- link: sidebarItem.link,
17
- });
18
- }
19
- sidebarItem.items.forEach(item => {
20
- walk(item);
21
- });
22
- } else {
23
- flattenTitles.push(sidebarItem);
24
- }
25
- };
26
-
27
- items.forEach(item => walk(item));
28
-
29
- const pageIndex = flattenTitles.findIndex(item =>
30
- isEqualPath(withBase(item.link), pathname),
31
- );
32
-
33
- const prevPage = flattenTitles[pageIndex - 1] || null;
34
- const nextPage = flattenTitles[pageIndex + 1] || null;
35
-
36
- return {
37
- prevPage,
38
- nextPage,
39
- };
40
- }
@@ -1,73 +0,0 @@
1
- import {
2
- NormalizedSidebarGroup,
3
- SidebarItem,
4
- NormalizedSidebar,
5
- } from '@rspress/shared';
6
- import { useEffect, useState } from 'react';
7
- import { useLocaleSiteData } from './useLocaleSiteData';
8
- import { useLocation, withBase, isEqualPath } from '@/runtime';
9
-
10
- interface SidebarData {
11
- // The group name for the sidebar
12
- group: string;
13
- items: (NormalizedSidebarGroup | SidebarItem)[];
14
- }
15
-
16
- export const getSidebarGroupData = (
17
- sidebar: NormalizedSidebar,
18
- currentPathname: string,
19
- ) => {
20
- for (const name of Object.keys(sidebar)) {
21
- // Such as `/api/`,it will return all the sidebar group
22
- if (isEqualPath(withBase(name), currentPathname)) {
23
- return {
24
- group: 'Documentation',
25
- items: sidebar[name],
26
- };
27
- }
28
- // Such as `/guide/getting-started`, it will return the guide groups and the group name `Introduction`
29
- const result = sidebar[name].find(group => {
30
- const match = (item: NormalizedSidebarGroup | SidebarItem): boolean => {
31
- const equalFunc = () =>
32
- isEqualPath(withBase(item.link), currentPathname);
33
- if ('items' in item) {
34
- // If the current path is the same as the group link, return true
35
- if (equalFunc()) {
36
- return true;
37
- }
38
- return item.items.some(i => match(i));
39
- } else {
40
- return equalFunc();
41
- }
42
- };
43
- return match(group);
44
- });
45
-
46
- if (result) {
47
- const sidebarGroup = sidebar[name];
48
- return {
49
- group: result.text || '',
50
- items: sidebarGroup,
51
- };
52
- }
53
- }
54
- return {
55
- group: 'Documentation',
56
- items: [],
57
- };
58
- };
59
- export function useSidebarData(): SidebarData {
60
- const localeData = useLocaleSiteData();
61
- const sidebar = localeData.sidebar ?? {};
62
- const { pathname: rawPathname } = useLocation();
63
- const pathname = decodeURIComponent(rawPathname);
64
- const [sidebarData, setSidebarData] = useState<SidebarData>(
65
- getSidebarGroupData(sidebar, pathname),
66
- );
67
- useEffect(() => {
68
- const newSidebarData = getSidebarGroupData(sidebar, pathname);
69
- setSidebarData(newSidebarData);
70
- }, [pathname, localeData.lang]);
71
-
72
- return sidebarData;
73
- }
@@ -1,38 +0,0 @@
1
- import { isEqualPath } from '@/runtime';
2
-
3
- export function isActive(
4
- currentPath: string,
5
- targetLink?: string,
6
- strict = false,
7
- ) {
8
- if (!targetLink) {
9
- return false;
10
- }
11
- if (strict) {
12
- return isEqualPath(currentPath, targetLink);
13
- } else {
14
- return (
15
- isEqualPath(currentPath, targetLink) || currentPath.startsWith(targetLink)
16
- );
17
- }
18
- }
19
-
20
- export function isExternalHref(href: string) {
21
- return /^https?:\/\//.test(href);
22
- }
23
-
24
- export function getLogoUrl(
25
- rawLogo: string | { dark: string; light: string },
26
- theme: 'dark' | 'light',
27
- ) {
28
- // If logo is a string, use it directly
29
- if (typeof rawLogo === 'string') {
30
- return rawLogo;
31
- }
32
- // If logo is an object, use dark/light mode logo
33
- return theme === 'dark' ? rawLogo.dark : rawLogo.light;
34
- }
35
-
36
- export function isMobileDevice() {
37
- return window.innerWidth < 768;
38
- }
@@ -1,102 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
-
5
- *,
6
- ::before,
7
- ::after {
8
- box-sizing: border-box;
9
- }
10
-
11
- html {
12
- line-height: 1.7;
13
- font-size: 16px;
14
- -webkit-text-size-adjust: 100%;
15
- }
16
-
17
- html.dark {
18
- color-scheme: dark;
19
- }
20
-
21
- body {
22
- margin: 0;
23
- width: 100%;
24
- min-width: 320px;
25
- font-family: var(--rp-font-family-base);
26
- font-size: 16px;
27
- font-weight: 400;
28
- color: var(--rp-c-text-1);
29
- background-color: var(--rp-c-bg);
30
- direction: ltr;
31
- font-synthesis: none;
32
- text-rendering: optimizeLegibility;
33
- -webkit-font-smoothing: antialiased;
34
- -moz-osx-font-smoothing: grayscale;
35
- }
36
-
37
- button:focus,
38
- button:focus-visible {
39
- outline: none;
40
- }
41
-
42
- .visually-hidden {
43
- visibility: hidden;
44
- }
45
-
46
- .flex-center {
47
- @apply flex items-center justify-center;
48
- }
49
-
50
- .menu {
51
- @apply flex justify-around items-center text-sm font-bold;
52
- }
53
-
54
- #nprogress .bar {
55
- background: var(--rp-c-brand);
56
- position: fixed;
57
- top: 0;
58
- left: 0;
59
- width: 100%;
60
- height: 2px;
61
- }
62
-
63
- :root {
64
- --code-color-text: #414141;
65
- --code-color-background: transparent;
66
- --code-token-constant: #f59403;
67
- --code-token-string: #31a94d;
68
- --code-token-comment: rgb(182, 180, 180);
69
- --code-token-keyword: #cf2727;
70
- --code-token-parameter: #1976d2;
71
- --code-token-function: #7041c8;
72
- --code-token-string-expression: #218438;
73
- --code-token-punctuation: #242323;
74
- --code-token-link: #22863a;
75
- --code-token-variable: #1976d2;
76
- --code-token-symbol: #f59403;
77
- }
78
-
79
- .dark {
80
- --code-color-text: #cac7c7;
81
- --code-token-constant: #6fb0fa;
82
- --code-token-string: #f9a86e;
83
- --code-token-comment: #6a727b;
84
- --code-token-keyword: #f47481;
85
- --code-token-parameter: #ff9800;
86
- --code-token-function: #ae8eeb;
87
- --code-token-string-expression: #4fb74d;
88
- --code-token-punctuation: #bbbbbb;
89
- --code-token-link: #f9a76d;
90
- --code-token-variable: #6fb0fa;
91
- --code-token-symbol: #f9a86e;
92
- }
93
-
94
- /**
95
- * Custom font family
96
- */
97
- :root {
98
- --rp-font-family-base: 'Inter var experimental', 'Inter var', -apple-system,
99
- BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
100
- 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
101
- --rp-font-family-mono: Menlo, Monaco, Consolas, 'Courier New', monospace;
102
- }
@@ -1,177 +0,0 @@
1
- /** Define code style */
2
- :root {
3
- --rp-code-font-size: 14px;
4
- --rp-code-block-color: rgb(46, 52, 64);
5
- --rp-code-title-bg: rgba(0, 99, 199, 0.05);
6
- --rp-code-block-bg: #f6f8fa;
7
-
8
- --rp-code-line-highlight-color: rgba(0, 99, 199, 0.1);
9
- --rp-code-line-number-color: rgba(235, 235, 235, 0.38);
10
-
11
- --rp-code-copy-code-hover-bg: rgba(255, 255, 255, 0.05);
12
- --rp-code-copy-code-active-text: rgba(235, 235, 235, 0.6);
13
- }
14
-
15
- .dark {
16
- --rp-code-block-color: rgb(229, 231, 235);
17
- --rp-code-block-bg: #242424;
18
- --rp-code-title-bg: rgba(255, 255, 255, 0.04);
19
- --rp-code-line-highlight-color: rgba(255, 255, 255, 0.1);
20
- --rp-code-line-number-color: rgba(60, 60, 60, 0.33);
21
- }
22
-
23
- :root {
24
- --rp-icon-copy: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z' fill='%23cccccc'/%3E%3Cpath d='M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z' fill='%23cccccc'/%3E%3C/svg%3E");
25
- --rp-icon-copied: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m13 24l-9-9l1.41-1.41L13 21.17L26.59 7.59L28 9L13 24z' fill='%2360c054'/%3E%3C/svg%3E");
26
- }
27
-
28
- .rspress-doc :not(pre, h1, h2, h3, h4, h5, h6) > code {
29
- font-size: var(--rp-code-font-size);
30
- }
31
-
32
- .rspress-doc :not(pre, div, a) > code {
33
- border-radius: 20px;
34
- padding: 4px 8px;
35
- color: var(--rp-c-text-code);
36
- background-color: var(--rp-c-bg-mute);
37
- }
38
-
39
- .rspress-doc h1 > code,
40
- .rspress-doc h2 > code,
41
- .rspress-doc h3 > code {
42
- font-size: 0.9em;
43
- }
44
-
45
- .rspress-doc a > code {
46
- color: var(--rp-c-brand);
47
- transition: color 0.25s;
48
- border: none;
49
- }
50
-
51
- .rspress-doc a:hover > code {
52
- color: var(--rp-c-brand-dark);
53
- }
54
-
55
- .rspress-doc div[class*='language-'] {
56
- position: relative;
57
- margin: 16px 0;
58
- background-color: var(--rp-code-block-bg);
59
- overflow-x: auto;
60
- transition: none;
61
- }
62
-
63
- .rspress-doc .rspress-code-title {
64
- padding: 12px 16px;
65
- font-size: var(--rp-code-font-size);
66
- background-color: var(--rp-code-title-bg);
67
- transition: background-color 0.5s;
68
- }
69
-
70
- @media (min-width: 640px) {
71
- .rspress-doc div[class*='language-'] {
72
- border-radius: 16px;
73
- margin: 24px 0;
74
- /* box-shadow: 0px 0.8px 2px rgba(0, 0, 0, 0.032), */
75
- /* 0px 2.7px 6.7px rgba(0, 0, 0, 0.048), 0px 12px 30px rgba(0, 0, 0, 0.08); */
76
- contain: content;
77
- }
78
- }
79
-
80
- @media (max-width: 640px) {
81
- .rspress-doc li div[class*='language-'] {
82
- border-radius: 8px 0 0 8px;
83
- }
84
- }
85
-
86
- .rspress-doc [class*='language-'] pre,
87
- .rspress-doc [class*='language-'] code {
88
- text-align: left;
89
- white-space: pre;
90
- word-spacing: normal;
91
- word-break: normal;
92
- word-wrap: normal;
93
- -moz-tab-size: 4;
94
- -o-tab-size: 4;
95
- tab-size: 4;
96
- -webkit-hyphens: none;
97
- -moz-hyphens: none;
98
- -ms-hyphens: none;
99
- hyphens: none;
100
- }
101
-
102
- .rspress-doc [class*='language-'] pre {
103
- position: relative;
104
- z-index: 1;
105
- margin: 0;
106
- background: transparent;
107
- overflow-x: auto;
108
- }
109
-
110
- .rspress-doc [class*='language-'] code {
111
- display: block;
112
- padding: 16px 0;
113
- width: fit-content;
114
- min-width: 100%;
115
- line-height: 1.7;
116
- font-size: var(--rp-code-font-size);
117
- color: var(--rp-code-block-color);
118
- background-color: var(--rp-code-block-bg);
119
- transition: color 0.5s;
120
- }
121
-
122
- .rspress-doc [class*='language-'] .rspress-code-content {
123
- position: relative;
124
- }
125
-
126
- .rspress-doc [class*='language-'] .rspress-code-content button.copy {
127
- position: absolute;
128
- top: 12px;
129
- right: 12px;
130
- z-index: 3;
131
- display: block;
132
- justify-content: center;
133
- align-items: center;
134
- border-radius: 4px;
135
- width: 20px;
136
- height: 20px;
137
- opacity: 0;
138
- cursor: pointer;
139
- background-image: var(--rp-icon-copy);
140
- background-position: 50%;
141
- background-size: 20px;
142
- background-repeat: no-repeat;
143
- background-color: var(--rp-code-copy-code-hover-bg);
144
- }
145
-
146
- .rspress-doc [class*='language-']:hover .rspress-code-content button.copy,
147
- .rspress-doc [class*='language-'] .rspress-code-content button.copy:focus {
148
- opacity: 1;
149
- }
150
-
151
- .rspress-doc [class*='language-'] .rspress-code-content button.copy:hover {
152
- transform: scale(1.15);
153
- }
154
-
155
- .rspress-doc [class*='language-'] .rspress-code-content button.copy.copied,
156
- .rspress-doc
157
- [class*='language-']
158
- .rspress-code-content
159
- button.copy:hover.copied {
160
- border-radius: 0 4px 4px 0;
161
- background-image: var(--rp-icon-copied);
162
- transform: scale(1);
163
- opacity: 1;
164
- }
165
-
166
- .rspress-doc [class*='language-'] .rspress-code-content span.highlighted {
167
- background-color: var(--rp-code-line-highlight-color);
168
- position: absolute;
169
- display: block;
170
- left: 0;
171
- right: 0;
172
- padding-left: 20px;
173
- }
174
-
175
- .rspress-doc [class*='language-'] .rspress-code-content > code {
176
- padding: 16px 20px;
177
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * The theme code will be bundled by Modern.js Module Tools, but it will ignore the `@import` in css file. So we need to import the css file in js/ts file to make sure the css file will be bundled.
3
- */
4
- import './vars.css';
5
- import './base.css';
6
- import './code.css';
7
- import './scrollbar.css';
@@ -1,28 +0,0 @@
1
- .rspress-scrollbar {
2
- scrollbar-gutter: stable;
3
- /* The size of scroll bar */
4
- &::-webkit-scrollbar {
5
- width: 12px;
6
- height: 8px;
7
- transition: all 0.3s;
8
- }
9
- /* The track of scrooll bar */
10
- &::-webkit-scrollbar-track {
11
- background: transparent;
12
- }
13
-
14
- /* The thumb of scroll bar */
15
- &::-webkit-scrollbar-thumb {
16
- border-radius: 10px;
17
- }
18
-
19
- &:hover::-webkit-scrollbar-thumb {
20
- border: 3px solid transparent;
21
- background-color: var(--rp-c-text-4);
22
- background-clip: content-box;
23
- }
24
-
25
- &::-webkit-scrollbar-corner {
26
- background: transparent;
27
- }
28
- }
@@ -1,81 +0,0 @@
1
- /**
2
- * Some common css theme variables and they will be used in the tailwind theme as well.
3
- */
4
- :root {
5
- --rp-layout-max-width: 1440px;
6
- --rp-nav-height: 72px;
7
- --rp-sidebar-width: 320px;
8
- --rp-aside-width: 368px;
9
- }
10
-
11
- :root {
12
- --rp-c-bg: #ffffff;
13
- --rp-c-bg-soft: #f9f9f9;
14
- --rp-c-bg-mute: #f1f1f1;
15
-
16
- --rp-c-divider: rgba(60, 60, 60, 0.29);
17
- --rp-c-divider-light: rgba(60, 60, 60, 0.12);
18
-
19
- --rp-c-text-1: #213547;
20
- --rp-c-text-2: rgba(60, 60, 60, 0.66);
21
- --rp-c-text-3: rgba(60, 60, 60, 0.33);
22
- --rp-c-text-4: rgba(60, 60, 60, 0.18);
23
-
24
- --rp-c-text-code: #476573;
25
-
26
- --rp-c-brand: #0095ff;
27
- --rp-c-brand-light: #00aaff;
28
- --rp-c-brand-lighter: #ecf4ff;
29
- --rp-c-brand-dark: #0077ff;
30
- --rp-c-brand-darker: #3367af;
31
- --rp-c-brand-tint: rgba(127, 163, 255, 0.16);
32
-
33
- --rp-c-gray: #8e8e8e;
34
- --rp-c-gray-light-1: #aeaeae;
35
- --rp-c-gray-light-2: #c7c7c7;
36
- --rp-c-gray-light-3: #d1d1d1;
37
- --rp-c-gray-light-4: #e5e5e5;
38
- --rp-c-gray-light-5: #f2f2f2;
39
-
40
- --rp-c-dark: #000000;
41
- --rp-c-dark-light-1: #2f2f2f;
42
- --rp-c-dark-light-2: #3a3a3a;
43
- --rp-c-dark-light-3: #4a4a4a;
44
- --rp-c-dark-light-4: #5c5c5c;
45
- --rp-c-dark-light-5: #6b6b6b;
46
- }
47
-
48
- .dark {
49
- --rp-c-bg: #000;
50
- --rp-c-bg-soft: #2f2f2f;
51
- --rp-c-bg-mute: #3a3a3a;
52
- --rp-c-bg-alt: #000;
53
-
54
- --rp-c-divider: rgba(84, 84, 84, 0.65);
55
- --rp-c-divider-light: rgba(84, 84, 84, 0.48);
56
-
57
- --rp-c-text-1: rgba(255, 255, 255, 0.87);
58
- --rp-c-text-2: rgba(235, 235, 235, 0.56);
59
- --rp-c-text-3: rgba(235, 235, 235, 0.38);
60
- --rp-c-text-4: rgba(235, 235, 235, 0.18);
61
-
62
- /* Will be used in overview page */
63
- --rp-c-text-code: #c9def1;
64
- }
65
-
66
- :root {
67
- --rp-z-index-local-nav: 10;
68
- --rp-z-index-nav: 20;
69
- --rp-z-index-layout-top: 30;
70
- --rp-z-index-backdrop: 40;
71
- --rp-z-index-sidebar: 50;
72
- --rp-z-index-footer: 60;
73
- }
74
-
75
- :root {
76
- --rp-shadow-1: 0 1px 4px rgba(0, 0, 0, 0.02), 0 1px 0 rgba(0, 0, 0, 0.06);
77
- --rp-shadow-2: 0 3px 12px rgba(0, 0, 0, 0.07), 0 1px 4px rgba(0, 0, 0, 0.07);
78
- --rp-shadow-3: 0 12px 32px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.08);
79
- --rp-shadow-4: 0 14px 44px rgba(0, 0, 0, 0.12), 0 3px 9px rgba(0, 0, 0, 0.12);
80
- --rp-shadow-5: 0 18px 56px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.16);
81
- }