Skip to content

Commit 216c645

Browse files
committed
fix: invisible rows background
1 parent e2b654e commit 216c645

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

src/components/SqlHighlighter/SqlHighlighter.tsx

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,41 @@
11
import {useThemeValue} from '@gravity-ui/uikit';
22
import {PrismLight as SyntaxHighlighter} from 'react-syntax-highlighter';
3-
import sql from 'react-syntax-highlighter/dist/esm/languages/prism/sql';
3+
import plsql from 'react-syntax-highlighter/dist/esm/languages/prism/plsql';
44
import {
5-
vscDarkPlus as dark,
6-
materialLight as light,
5+
vscDarkPlus as darkTheme,
6+
materialLight as lightTheme,
77
} from 'react-syntax-highlighter/dist/esm/styles/prism';
88

9+
// Create custom themes with transparent backgrounds
10+
const light = {
11+
...lightTheme,
12+
'pre[class*="language-"]': {
13+
...lightTheme['pre[class*="language-"]'],
14+
background: 'transparent',
15+
},
16+
'code[class*="language-"]': {
17+
...lightTheme['code[class*="language-"]'],
18+
background: 'transparent',
19+
},
20+
};
21+
22+
const dark = {
23+
...darkTheme,
24+
'pre[class*="language-"]': {
25+
...darkTheme['pre[class*="language-"]'],
26+
background: 'transparent',
27+
},
28+
'code[class*="language-"]': {
29+
...darkTheme['code[class*="language-"]'],
30+
background: 'transparent',
31+
},
32+
};
33+
934
import {cn} from '../../utils/cn';
1035

1136
import './SqlHighlighter.scss';
1237

13-
SyntaxHighlighter.registerLanguage('sql', sql);
38+
SyntaxHighlighter.registerLanguage('plsql', plsql);
1439

1540
const b = cn('sql-highlighter');
1641

0 commit comments

Comments
 (0)