@docusaurus/theme-classic 0.0.0-4842 → 0.0.0-4845

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.
@@ -176,6 +176,7 @@ declare module '@theme/DocCardList' {
176
176
 
177
177
  export interface Props {
178
178
  readonly items: PropSidebarItem[];
179
+ readonly className?: string;
179
180
  }
180
181
 
181
182
  export default function DocCardList(props: Props): JSX.Element;
@@ -29,6 +29,7 @@
29
29
 
30
30
  .sidebarItemLink {
31
31
  color: var(--ifm-font-color-base);
32
+ display: block;
32
33
  }
33
34
 
34
35
  .sidebarItemLink:hover {
@@ -5,9 +5,11 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React from 'react';
8
+ import clsx from 'clsx';
8
9
  import DocCard from '@theme/DocCard';
9
- import {findFirstCategoryLink} from '@docusaurus/theme-common'; // Filter categories that don't have a link.
10
+ import {findFirstCategoryLink} from '@docusaurus/theme-common';
10
11
 
12
+ // Filter categories that don't have a link.
11
13
  function filterItems(items) {
12
14
  return items.filter((item) => {
13
15
  if (item.type === 'category') {
@@ -18,9 +20,9 @@ function filterItems(items) {
18
20
  });
19
21
  }
20
22
 
21
- export default function DocCardList({items}) {
23
+ export default function DocCardList({items, className}) {
22
24
  return (
23
- <div className="row">
25
+ <div className={clsx('row', className)}>
24
26
  {filterItems(items).map((item, index) => (
25
27
  <article key={index} className="col col--6 margin-bottom--lg">
26
28
  <DocCard key={index} item={item} />
@@ -52,7 +52,7 @@ function DocCategoryGeneratedIndexPageContent({categoryGeneratedIndex}) {
52
52
  )}
53
53
  </header>
54
54
  <main className="margin-top--lg">
55
- <DocCardList items={category.items} />
55
+ <DocCardList items={category.items} className={styles.list} />
56
56
  </main>
57
57
  <footer className="margin-top--lg">
58
58
  <DocPaginator
@@ -16,3 +16,7 @@
16
16
  --ifm-h1-font-size: 3rem;
17
17
  margin-bottom: calc(1.25 * var(--ifm-leading));
18
18
  }
19
+
20
+ .list article:nth-last-child(-n + 2) {
21
+ margin-bottom: 0 !important;
22
+ }
@@ -20,3 +20,9 @@
20
20
  display: none;
21
21
  }
22
22
  }
23
+
24
+ @media print {
25
+ .tocMobile {
26
+ display: none;
27
+ }
28
+ }
@@ -10,6 +10,12 @@
10
10
  flex-grow: 1;
11
11
  padding: 0.5rem;
12
12
  }
13
+ @supports (scrollbar-gutter: stable) {
14
+ .menu {
15
+ padding: 0.5rem 0 0.5rem 0.5rem;
16
+ scrollbar-gutter: stable;
17
+ }
18
+ }
13
19
 
14
20
  .menuWithAnnouncementBar {
15
21
  margin-bottom: var(--docusaurus-announcement-bar-height);
@@ -51,7 +51,7 @@ export default function LocaleDropdownNavbarItem({
51
51
  label={
52
52
  <span>
53
53
  <IconLanguage className={styles.iconLanguage} />
54
- <span>{dropdownLabel}</span>
54
+ {dropdownLabel}
55
55
  </span>
56
56
  }
57
57
  items={items}
@@ -5,13 +5,15 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React from 'react';
8
+ import clsx from 'clsx';
9
+ import styles from './styles.module.css';
8
10
  export default function TabItem({children, hidden, className}) {
9
11
  return (
10
12
  <div
11
13
  role="tabpanel"
14
+ className={clsx(styles.tabItem, className)}
12
15
  {...{
13
16
  hidden,
14
- className,
15
17
  }}>
16
18
  {children}
17
19
  </div>
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ .tabItem > *:last-child {
9
+ margin-bottom: 0;
10
+ }
@@ -132,7 +132,7 @@ function TabsComponent(props) {
132
132
  };
133
133
 
134
134
  return (
135
- <div className="tabs-container">
135
+ <div className={clsx('tabs-container', styles.tabList)}>
136
136
  <ul
137
137
  role="tablist"
138
138
  aria-orientation="horizontal"
@@ -173,11 +173,11 @@ function TabsComponent(props) {
173
173
  (tabItem) => tabItem.props.value === selectedValue,
174
174
  )[0],
175
175
  {
176
- className: 'margin-vert--md',
176
+ className: 'margin-top--md',
177
177
  },
178
178
  )
179
179
  ) : (
180
- <div className="margin-vert--md">
180
+ <div className="margin-top--md">
181
181
  {children.map((tabItem, i) =>
182
182
  cloneElement(tabItem, {
183
183
  key: i,
@@ -5,6 +5,10 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ .tabList {
9
+ margin-bottom: var(--ifm-leading);
10
+ }
11
+
8
12
  .tabItem {
9
13
  margin-top: 0 !important;
10
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "0.0.0-4842",
3
+ "version": "0.0.0-4845",
4
4
  "description": "Classic theme for Docusaurus",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/theme-classic.d.ts",
@@ -21,15 +21,15 @@
21
21
  "format:lib-next": "prettier --config ../../.prettierrc --write \"lib-next/**/*.{js,ts,jsx,tsc}\""
22
22
  },
23
23
  "dependencies": {
24
- "@docusaurus/core": "0.0.0-4842",
25
- "@docusaurus/plugin-content-blog": "0.0.0-4842",
26
- "@docusaurus/plugin-content-docs": "0.0.0-4842",
27
- "@docusaurus/plugin-content-pages": "0.0.0-4842",
28
- "@docusaurus/theme-common": "0.0.0-4842",
29
- "@docusaurus/theme-translations": "0.0.0-4842",
30
- "@docusaurus/utils": "0.0.0-4842",
31
- "@docusaurus/utils-common": "0.0.0-4842",
32
- "@docusaurus/utils-validation": "0.0.0-4842",
24
+ "@docusaurus/core": "0.0.0-4845",
25
+ "@docusaurus/plugin-content-blog": "0.0.0-4845",
26
+ "@docusaurus/plugin-content-docs": "0.0.0-4845",
27
+ "@docusaurus/plugin-content-pages": "0.0.0-4845",
28
+ "@docusaurus/theme-common": "0.0.0-4845",
29
+ "@docusaurus/theme-translations": "0.0.0-4845",
30
+ "@docusaurus/utils": "0.0.0-4845",
31
+ "@docusaurus/utils-common": "0.0.0-4845",
32
+ "@docusaurus/utils-validation": "0.0.0-4845",
33
33
  "@mdx-js/react": "^1.6.22",
34
34
  "clsx": "^1.1.1",
35
35
  "copy-text-to-clipboard": "^3.0.1",
@@ -42,8 +42,8 @@
42
42
  "rtlcss": "^3.5.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@docusaurus/module-type-aliases": "0.0.0-4842",
46
- "@docusaurus/types": "0.0.0-4842",
45
+ "@docusaurus/module-type-aliases": "0.0.0-4845",
46
+ "@docusaurus/types": "0.0.0-4845",
47
47
  "@types/mdx-js__react": "^1.5.5",
48
48
  "@types/prismjs": "^1.26.0",
49
49
  "@types/rtlcss": "^3.1.3",
@@ -59,5 +59,5 @@
59
59
  "engines": {
60
60
  "node": ">=14"
61
61
  },
62
- "gitHead": "6bf15cea226810a6d8263f83eb2b6a56a5d0499b"
62
+ "gitHead": "5381d62303ebb8010c7de7dbe9b4c5d5be612fea"
63
63
  }
@@ -29,6 +29,7 @@
29
29
 
30
30
  .sidebarItemLink {
31
31
  color: var(--ifm-font-color-base);
32
+ display: block;
32
33
  }
33
34
 
34
35
  .sidebarItemLink:hover {
@@ -6,10 +6,12 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
+ import clsx from 'clsx';
9
10
 
10
11
  import DocCard from '@theme/DocCard';
11
12
  import type {PropSidebarItem} from '@docusaurus/plugin-content-docs';
12
13
  import {findFirstCategoryLink} from '@docusaurus/theme-common';
14
+ import type {Props} from '@theme/DocCardList';
13
15
 
14
16
  // Filter categories that don't have a link.
15
17
  function filterItems(items: PropSidebarItem[]): PropSidebarItem[] {
@@ -21,13 +23,9 @@ function filterItems(items: PropSidebarItem[]): PropSidebarItem[] {
21
23
  });
22
24
  }
23
25
 
24
- export default function DocCardList({
25
- items,
26
- }: {
27
- items: PropSidebarItem[];
28
- }): JSX.Element {
26
+ export default function DocCardList({items, className}: Props): JSX.Element {
29
27
  return (
30
- <div className="row">
28
+ <div className={clsx('row', className)}>
31
29
  {filterItems(items).map((item, index) => (
32
30
  <article key={index} className="col col--6 margin-bottom--lg">
33
31
  <DocCard key={index} item={item} />
@@ -61,7 +61,7 @@ function DocCategoryGeneratedIndexPageContent({
61
61
  )}
62
62
  </header>
63
63
  <main className="margin-top--lg">
64
- <DocCardList items={category.items} />
64
+ <DocCardList items={category.items} className={styles.list} />
65
65
  </main>
66
66
  <footer className="margin-top--lg">
67
67
  <DocPaginator
@@ -16,3 +16,7 @@
16
16
  --ifm-h1-font-size: 3rem;
17
17
  margin-bottom: calc(1.25 * var(--ifm-leading));
18
18
  }
19
+
20
+ .list article:nth-last-child(-n + 2) {
21
+ margin-bottom: 0 !important;
22
+ }
@@ -20,3 +20,9 @@
20
20
  display: none;
21
21
  }
22
22
  }
23
+
24
+ @media print {
25
+ .tocMobile {
26
+ display: none;
27
+ }
28
+ }
@@ -10,6 +10,12 @@
10
10
  flex-grow: 1;
11
11
  padding: 0.5rem;
12
12
  }
13
+ @supports (scrollbar-gutter: stable) {
14
+ .menu {
15
+ padding: 0.5rem 0 0.5rem 0.5rem;
16
+ scrollbar-gutter: stable;
17
+ }
18
+ }
13
19
 
14
20
  .menuWithAnnouncementBar {
15
21
  margin-bottom: var(--docusaurus-announcement-bar-height);
@@ -60,7 +60,7 @@ export default function LocaleDropdownNavbarItem({
60
60
  label={
61
61
  <span>
62
62
  <IconLanguage className={styles.iconLanguage} />
63
- <span>{dropdownLabel}</span>
63
+ {dropdownLabel}
64
64
  </span>
65
65
  }
66
66
  items={items}
@@ -7,6 +7,9 @@
7
7
 
8
8
  import React from 'react';
9
9
  import type {Props} from '@theme/TabItem';
10
+ import clsx from 'clsx';
11
+
12
+ import styles from './styles.module.css';
10
13
 
11
14
  export default function TabItem({
12
15
  children,
@@ -14,7 +17,10 @@ export default function TabItem({
14
17
  className,
15
18
  }: Props): JSX.Element {
16
19
  return (
17
- <div role="tabpanel" {...{hidden, className}}>
20
+ <div
21
+ role="tabpanel"
22
+ className={clsx(styles.tabItem, className)}
23
+ {...{hidden}}>
18
24
  {children}
19
25
  </div>
20
26
  );
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ .tabItem > *:last-child {
9
+ margin-bottom: 0;
10
+ }
@@ -141,7 +141,7 @@ function TabsComponent(props: Props): JSX.Element {
141
141
  };
142
142
 
143
143
  return (
144
- <div className="tabs-container">
144
+ <div className={clsx('tabs-container', styles.tabList)}>
145
145
  <ul
146
146
  role="tablist"
147
147
  aria-orientation="horizontal"
@@ -181,10 +181,10 @@ function TabsComponent(props: Props): JSX.Element {
181
181
  children.filter(
182
182
  (tabItem) => tabItem.props.value === selectedValue,
183
183
  )[0]!,
184
- {className: 'margin-vert--md'},
184
+ {className: 'margin-top--md'},
185
185
  )
186
186
  ) : (
187
- <div className="margin-vert--md">
187
+ <div className="margin-top--md">
188
188
  {children.map((tabItem, i) =>
189
189
  cloneElement(tabItem, {
190
190
  key: i,
@@ -5,6 +5,10 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ .tabList {
9
+ margin-bottom: var(--ifm-leading);
10
+ }
11
+
8
12
  .tabItem {
9
13
  margin-top: 0 !important;
10
14
  }
@@ -176,6 +176,7 @@ declare module '@theme/DocCardList' {
176
176
 
177
177
  export interface Props {
178
178
  readonly items: PropSidebarItem[];
179
+ readonly className?: string;
179
180
  }
180
181
 
181
182
  export default function DocCardList(props: Props): JSX.Element;