Skip to content

Commit

Permalink
fix(v2): add syntax highlight to generated colors (#2114)
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 authored and yangshun committed Dec 10, 2019
1 parent 6db2989 commit 1f0eb37
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

.codeBlock {
border-radius: 0;
margin-bottom: 0;
overflow: hidden;
overflow-wrap: break-word;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.codeBlock {
border-radius: 0;
font-size: inherit;
margin-bottom: 0;
overflow: hidden;
Expand Down
6 changes: 4 additions & 2 deletions website/src/components/ColorGenerator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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>
);
}
Expand Down

0 comments on commit 1f0eb37

Please sign in to comment.