Skip to content

Commit 81e910e

Browse files
committed
feat(PrismCode): react renderer * 11
1 parent d15083d commit 81e910e

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

src/components/GlobalStyles.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,16 @@ const GlobalStylesElement = createGlobalStyle<GlobalStylesElementProps>`
249249
white-space: normal;
250250
}
251251
252+
.token.inserted-sign {
253+
background-color: #e6ffed;
254+
color: #30A666;
255+
}
256+
257+
.token.deleted-sign {
258+
background-color: #ffeef0;
259+
color: (--danger-color);
260+
}
261+
252262
.token.comment,
253263
.token.prolog,
254264
.token.doctype,
@@ -277,16 +287,16 @@ const GlobalStylesElement = createGlobalStyle<GlobalStylesElementProps>`
277287
}
278288
279289
.token.entity,
280-
.token.number {
290+
.token.number,
291+
.token.inserted {
281292
color: #30A666;
282293
}
283294
284295
.token.selector,
285296
.token.attr-name,
286297
.token.string,
287298
.token.char,
288-
.token.builtin,
289-
.token.inserted {
299+
.token.builtin {
290300
color: var(--purple-text-color);
291301
}
292302
@@ -328,16 +338,6 @@ const GlobalStylesElement = createGlobalStyle<GlobalStylesElementProps>`
328338
.token.entity {
329339
cursor: help;
330340
}
331-
332-
.token.inserted-sign {
333-
background-color: #e6ffed;
334-
color: #30A666;
335-
}
336-
337-
.token.deleted-sign {
338-
background-color: #ffeef0;
339-
color: (--danger-color);
340-
}
341341
`;
342342

343343
export const GlobalStyles = (props: GlobalStylesProps) => {

src/components/content/PrismCode/PrismCode.stories.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ const Template = ({ ...args }) => <PrismCode {...args} />;
1616

1717
export const OneLine = Template.bind({});
1818
OneLine.args = {
19+
language: 'bash',
1920
code: '$ npm install -g cubejs-cli',
2021
};
2122

2223
export const MultiLine = Template.bind({});
2324
MultiLine.args = {
25+
language: 'bash',
2426
code: '$ npm install -g cubejs-cli\n$ cubejs deploy',
2527
};
2628

src/components/content/PrismCode/PrismCode.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ import {
1111

1212
import { Prism } from './prismSetup';
1313

14+
import 'prismjs/components/prism-javascript';
15+
import 'prismjs/components/prism-yaml';
16+
import 'prismjs/components/prism-bash';
17+
1418
const PreElement = tasty({
1519
as: 'pre',
1620
qa: 'CodeBlock',

0 commit comments

Comments
 (0)