Skip to content

Commit

Permalink
💄 style(highlight): fix highlight select color and support wildcards
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Jul 5, 2023
1 parent 365b12f commit 34547c4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 17 deletions.
30 changes: 15 additions & 15 deletions javascript/main.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/modules/PromptHighlight/prompt.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
{
"match": "\\d+(\\.\\d+)?",
"name": "number"
},
{
"match": "__.*__",
"name": "wildcards"
}
],

Expand Down
8 changes: 8 additions & 0 deletions src/modules/PromptHighlight/promptTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const themeConfig: any = (isDarkMode: ThemeAppearance) => {
const type = isDarkMode ? 'dark' : 'light';

const colorTextTertiary = isDarkMode ? colorScales.gray[type][6] : colorScales.gray[type][7];
const colorYellow = isDarkMode ? colorScales.yellow[type][9] : colorScales.yellow[type][10];
const colorOrange = isDarkMode ? colorScales.gold[type][9] : colorScales.orange[type][9];
const colorGreen = isDarkMode ? colorScales.lime[type][9] : colorScales.green[type][10];
const colorBlue = isDarkMode ? colorScales.blue[type][9] : colorScales.geekblue[type][8];
Expand Down Expand Up @@ -66,6 +67,13 @@ export const themeConfig: any = (isDarkMode: ThemeAppearance) => {
foreground: colorPurple,
},
},
{
scope: 'wildcards',
settings: {
fontStyle: 'italic',
foreground: colorYellow,
},
},
],
type,
};
Expand Down
4 changes: 2 additions & 2 deletions src/modules/PromptHighlight/style.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createStyles } from 'antd-style';

export const useStyles = createStyles(({ css, token }) => ({
export const useStyles = createStyles(({ css, token, isDarkMode }) => ({
container: css``,
editor: css`
resize: vertical;
Expand Down Expand Up @@ -43,7 +43,7 @@ export const useStyles = createStyles(({ css, token }) => ({
&::selection {
color: #000;
background: ${token.yellow3A};
background: ${isDarkMode ? token.yellow3A : token.yellow6A};
}
&:focus {
Expand Down

0 comments on commit 34547c4

Please sign in to comment.