@docusaurus/theme-classic 0.0.0-4888 → 0.0.0-4892

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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "0.0.0-4888",
3
+ "version": "0.0.0-4892",
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-4888",
25
- "@docusaurus/plugin-content-blog": "0.0.0-4888",
26
- "@docusaurus/plugin-content-docs": "0.0.0-4888",
27
- "@docusaurus/plugin-content-pages": "0.0.0-4888",
28
- "@docusaurus/theme-common": "0.0.0-4888",
29
- "@docusaurus/theme-translations": "0.0.0-4888",
30
- "@docusaurus/utils": "0.0.0-4888",
31
- "@docusaurus/utils-common": "0.0.0-4888",
32
- "@docusaurus/utils-validation": "0.0.0-4888",
24
+ "@docusaurus/core": "0.0.0-4892",
25
+ "@docusaurus/plugin-content-blog": "0.0.0-4892",
26
+ "@docusaurus/plugin-content-docs": "0.0.0-4892",
27
+ "@docusaurus/plugin-content-pages": "0.0.0-4892",
28
+ "@docusaurus/theme-common": "0.0.0-4892",
29
+ "@docusaurus/theme-translations": "0.0.0-4892",
30
+ "@docusaurus/utils": "0.0.0-4892",
31
+ "@docusaurus/utils-common": "0.0.0-4892",
32
+ "@docusaurus/utils-validation": "0.0.0-4892",
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-4888",
49
- "@docusaurus/types": "0.0.0-4888",
48
+ "@docusaurus/module-type-aliases": "0.0.0-4892",
49
+ "@docusaurus/types": "0.0.0-4892",
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": "a02d37417f43c2ab8d73dd1b8bdec1450f7cc00e"
65
+ "gitHead": "babc1ac385126474eafcddd5ce6aecb602ab45db"
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