@docusaurus/theme-classic 0.0.0-4887 → 0.0.0-4891

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.
@@ -5,6 +5,7 @@
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 styles from './styles.module.css';
9
10
  export default function CodeBlockLine({
10
11
  line,
@@ -25,7 +26,11 @@ export default function CodeBlockLine({
25
26
  });
26
27
 
27
28
  if (highlight) {
28
- lineProps.className += ' docusaurus-highlight-code-line';
29
+ lineProps.className = clsx(
30
+ lineProps.className,
31
+ styles.highlightedCodeLine,
32
+ 'theme-code-block-highlighted-line',
33
+ );
29
34
  }
30
35
 
31
36
  const lineTokens = line.map((token, key) => (
@@ -5,6 +5,23 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ /* Intentionally has zero specificity, so that to be able to override
9
+ the background in custom CSS file due bug https://github.com/facebook/docusaurus/issues/3678 */
10
+ :where(:root) {
11
+ --docusaurus-highlighted-code-line-bg: rgb(72 77 91);
12
+ }
13
+
14
+ :where([data-theme='dark']) {
15
+ --docusaurus-highlighted-code-line-bg: rgb(100 100 100);
16
+ }
17
+
18
+ .highlightedCodeLine {
19
+ background-color: var(--docusaurus-highlighted-code-line-bg);
20
+ display: block;
21
+ margin: 0 calc(-1 * var(--ifm-pre-padding));
22
+ padding: 0 var(--ifm-pre-padding);
23
+ }
24
+
8
25
  .codeLine {
9
26
  display: table-row;
10
27
  counter-increment: line-count;
@@ -25,7 +42,7 @@
25
42
  opacity: 0.4;
26
43
  }
27
44
 
28
- :global(.docusaurus-highlight-code-line) .codeLineNumber::before {
45
+ .highlightedCodeLine .codeLineNumber::before {
29
46
  opacity: 0.8;
30
47
  }
31
48
 
@@ -12,6 +12,6 @@
12
12
 
13
13
  .icon {
14
14
  vertical-align: middle;
15
- height: 1rem;
16
- width: 1rem;
15
+ height: 1.1rem;
16
+ width: 1.1rem;
17
17
  }
@@ -5,15 +5,9 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React from 'react';
8
- export default function IconDarkMode(props) {
8
+ export default function IconHome(props) {
9
9
  return (
10
- <svg
11
- xmlns="http://www.w3.org/2000/svg"
12
- height="24"
13
- width="24"
14
- viewBox="0 0 24 24"
15
- {...props}>
16
- <path d="M0 0h24v24H0V0z" fill="none" />
10
+ <svg viewBox="0 0 24 24" {...props}>
17
11
  <path
18
12
  d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z"
19
13
  fill="currentColor"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "0.0.0-4887",
3
+ "version": "0.0.0-4891",
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-4887",
25
- "@docusaurus/plugin-content-blog": "0.0.0-4887",
26
- "@docusaurus/plugin-content-docs": "0.0.0-4887",
27
- "@docusaurus/plugin-content-pages": "0.0.0-4887",
28
- "@docusaurus/theme-common": "0.0.0-4887",
29
- "@docusaurus/theme-translations": "0.0.0-4887",
30
- "@docusaurus/utils": "0.0.0-4887",
31
- "@docusaurus/utils-common": "0.0.0-4887",
32
- "@docusaurus/utils-validation": "0.0.0-4887",
24
+ "@docusaurus/core": "0.0.0-4891",
25
+ "@docusaurus/plugin-content-blog": "0.0.0-4891",
26
+ "@docusaurus/plugin-content-docs": "0.0.0-4891",
27
+ "@docusaurus/plugin-content-pages": "0.0.0-4891",
28
+ "@docusaurus/theme-common": "0.0.0-4891",
29
+ "@docusaurus/theme-translations": "0.0.0-4891",
30
+ "@docusaurus/utils": "0.0.0-4891",
31
+ "@docusaurus/utils-common": "0.0.0-4891",
32
+ "@docusaurus/utils-validation": "0.0.0-4891",
33
33
  "@mdx-js/react": "^1.6.22",
34
34
  "clsx": "^1.1.1",
35
35
  "copy-text-to-clipboard": "^3.0.1",
@@ -45,8 +45,8 @@
45
45
  "@babel/cli": "^7.17.6",
46
46
  "@babel/core": "^7.17.9",
47
47
  "@babel/preset-typescript": "^7.16.7",
48
- "@docusaurus/module-type-aliases": "0.0.0-4887",
49
- "@docusaurus/types": "0.0.0-4887",
48
+ "@docusaurus/module-type-aliases": "0.0.0-4891",
49
+ "@docusaurus/types": "0.0.0-4891",
50
50
  "@types/mdx-js__react": "^1.5.5",
51
51
  "@types/prismjs": "^1.26.0",
52
52
  "@types/rtlcss": "^3.1.4",
@@ -62,5 +62,5 @@
62
62
  "engines": {
63
63
  "node": ">=14"
64
64
  },
65
- "gitHead": "87ce2a6c9491e474712d082a66491d46856f5d3f"
65
+ "gitHead": "a153f30a465e19bf4bb0956790ca98c9772492db"
66
66
  }
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
+ import clsx from 'clsx';
9
10
  import type {Props} from '@theme/CodeBlock/Line';
10
11
  import styles from './styles.module.css';
11
12
 
@@ -26,7 +27,11 @@ export default function CodeBlockLine({
26
27
  });
27
28
 
28
29
  if (highlight) {
29
- lineProps.className += ' docusaurus-highlight-code-line';
30
+ lineProps.className = clsx(
31
+ lineProps.className,
32
+ styles.highlightedCodeLine,
33
+ 'theme-code-block-highlighted-line',
34
+ );
30
35
  }
31
36
 
32
37
  const lineTokens = line.map((token, key) => (
@@ -5,6 +5,23 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ /* Intentionally has zero specificity, so that to be able to override
9
+ the background in custom CSS file due bug https://github.com/facebook/docusaurus/issues/3678 */
10
+ :where(:root) {
11
+ --docusaurus-highlighted-code-line-bg: rgb(72 77 91);
12
+ }
13
+
14
+ :where([data-theme='dark']) {
15
+ --docusaurus-highlighted-code-line-bg: rgb(100 100 100);
16
+ }
17
+
18
+ .highlightedCodeLine {
19
+ background-color: var(--docusaurus-highlighted-code-line-bg);
20
+ display: block;
21
+ margin: 0 calc(-1 * var(--ifm-pre-padding));
22
+ padding: 0 var(--ifm-pre-padding);
23
+ }
24
+
8
25
  .codeLine {
9
26
  display: table-row;
10
27
  counter-increment: line-count;
@@ -25,7 +42,7 @@
25
42
  opacity: 0.4;
26
43
  }
27
44
 
28
- :global(.docusaurus-highlight-code-line) .codeLineNumber::before {
45
+ .highlightedCodeLine .codeLineNumber::before {
29
46
  opacity: 0.8;
30
47
  }
31
48
 
@@ -12,6 +12,6 @@
12
12
 
13
13
  .icon {
14
14
  vertical-align: middle;
15
- height: 1rem;
16
- width: 1rem;
15
+ height: 1.1rem;
16
+ width: 1.1rem;
17
17
  }
@@ -8,15 +8,9 @@
8
8
  import React from 'react';
9
9
  import type {Props} from '@theme/IconHome';
10
10
 
11
- export default function IconDarkMode(props: Props): JSX.Element {
11
+ export default function IconHome(props: Props): JSX.Element {
12
12
  return (
13
- <svg
14
- xmlns="http://www.w3.org/2000/svg"
15
- height="24"
16
- width="24"
17
- viewBox="0 0 24 24"
18
- {...props}>
19
- <path d="M0 0h24v24H0V0z" fill="none" />
13
+ <svg viewBox="0 0 24 24" {...props}>
20
14
  <path
21
15
  d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z"
22
16
  fill="currentColor"