mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-21 04:57:05 +02:00
fix(v2): add syntax highlight to generated colors (#2114)
This commit is contained in:
parent
6db29897cf
commit
1f0eb37e19
3 changed files with 5 additions and 5 deletions
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
.codeBlock {
|
||||
border-radius: 0;
|
||||
margin-bottom: 0;
|
||||
overflow: hidden;
|
||||
overflow-wrap: break-word;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
.codeBlock {
|
||||
border-radius: 0;
|
||||
font-size: inherit;
|
||||
margin-bottom: 0;
|
||||
overflow: hidden;
|
||||
|
|
|
@ -9,6 +9,8 @@ import React, {useState} from 'react';
|
|||
|
||||
import Color from 'color';
|
||||
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
|
||||
import styles from './styles.module.css';
|
||||
|
||||
const COLOR_SHADES = {
|
||||
|
@ -154,12 +156,12 @@ function ColorGenerator({children, minHeight, url}) {
|
|||
Replace the variables in <code>src/css/custom.css</code> with these new
|
||||
variables.
|
||||
</p>
|
||||
<pre>
|
||||
<CodeBlock className="css">
|
||||
{adjustedColors
|
||||
.sort((a, b) => a.codeOrder - b.codeOrder)
|
||||
.map(value => `${value.variableName}: ${value.hex.toLowerCase()};`)
|
||||
.join('\n')}
|
||||
</pre>
|
||||
</CodeBlock>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue