Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v2): add syntax highlight to generated colors #2114

Merged
merged 1 commit into from
Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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