Skip to content

Commit 22f2948

Browse files
committed
fix(amazonq): update chat color classes
1 parent 810c815 commit 22f2948

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/theme/AmazonQTheme.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ data class AmazonQTheme(
3737
val warning: Color,
3838
val error: Color,
3939

40-
val cardBackground: Color,
41-
4240
val editorFont: Font,
4341
val editorBackground: Color,
4442
val editorForeground: Color,
@@ -49,5 +47,5 @@ data class AmazonQTheme(
4947
val editorKeyword: Color,
5048
val editorString: Color,
5149
val editorProperty: Color,
52-
50+
val editorClassName: Color,
5351
)

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/theme/CssVariable.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ enum class CssVariable(
1313
FontFamily("--mynah-font-family"),
1414

1515
TextColorDefault("--mynah-color-text-default"),
16+
TextColorAlt("--mynah-color-text-alternate"),
1617
TextColorStrong("--mynah-color-text-strong"),
1718
TextColorWeak("--mynah-color-text-weak"),
1819
TextColorLink("--mynah-color-text-link"),
@@ -25,7 +26,7 @@ enum class CssVariable(
2526
ColorDeep("--mynah-color-deep"),
2627
ColorDeepReverse("--mynah-color-deep-reverse"),
2728
BorderDefault("--mynah-color-border-default"),
28-
InputBackground("--mynah-color-input-bg"),
29+
InputBackground("--mynah-input-bg"),
2930

3031
SyntaxBackground("--mynah-color-syntax-bg"),
3132
SyntaxVariable("--mynah-color-syntax-variable"),
@@ -36,6 +37,9 @@ enum class CssVariable(
3637
SyntaxProperty("--mynah-color-syntax-property"),
3738
SyntaxComment("--mynah-color-syntax-comment"),
3839
SyntaxCode("--mynah-color-syntax-code"),
40+
SyntaxKeyword("--mynah-color-syntax-keyword"),
41+
SyntaxString("--mynah-color-syntax-string"),
42+
SyntaxClassName("--mynah-color-syntax-class-name"),
3943
SyntaxCodeFontFamily("--mynah-syntax-code-font-family"),
4044
SyntaxCodeFontSize("--mynah-syntax-code-font-size"),
4145

@@ -50,10 +54,9 @@ enum class CssVariable(
5054
SecondaryButtonBackground("--mynah-color-alternate"),
5155
SecondaryButtonForeground("--mynah-color-alternate-reverse"),
5256

53-
CodeText("--mynah-color-code-text"),
54-
5557
MainBackground("--mynah-color-main"),
5658
MainForeground("--mynah-color-main-reverse"),
5759

5860
CardBackground("--mynah-card-bg"),
61+
CardBackgroundAlt("--mynah-card-bg-alternate"),
5962
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/theme/EditorThemeAdapter.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,17 @@ class EditorThemeAdapter {
113113
warning = themeColor("Component.warningFocusColor", default = 0xE2A53A),
114114
error = themeColor("ProgressBar.failedColor", default = 0xD64F4F, darkDefault = 0xE74848),
115115

116-
cardBackground = cardBackground,
117-
118116
editorFont = currentScheme.getFont(EditorFontType.PLAIN),
119-
editorBackground = chatBackground,
120-
editorForeground = text,
117+
editorBackground = currentScheme.defaultBackground,
118+
editorForeground = currentScheme.defaultForeground,
121119
editorVariable = currentScheme.foregroundColor(DefaultLanguageHighlighterColors.LOCAL_VARIABLE),
122120
editorOperator = currentScheme.foregroundColor(DefaultLanguageHighlighterColors.OPERATION_SIGN),
123121
editorFunction = currentScheme.foregroundColor(DefaultLanguageHighlighterColors.FUNCTION_DECLARATION),
124122
editorComment = currentScheme.foregroundColor(DefaultLanguageHighlighterColors.LINE_COMMENT),
125123
editorKeyword = currentScheme.foregroundColor(DefaultLanguageHighlighterColors.KEYWORD),
126124
editorString = currentScheme.foregroundColor(DefaultLanguageHighlighterColors.STRING),
127125
editorProperty = currentScheme.foregroundColor(DefaultLanguageHighlighterColors.INSTANCE_FIELD),
126+
editorClassName = currentScheme.foregroundColor(DefaultLanguageHighlighterColors.CLASS_NAME),
128127
)
129128
}
130129

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/theme/ThemeBrowserAdapter.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
package software.aws.toolkits.jetbrains.services.amazonq.webview.theme
55

6+
import com.intellij.openapi.editor.colors.EditorColorsManager
7+
import com.intellij.ui.JBColor
68
import kotlinx.coroutines.CompletableDeferred
79
import org.cef.browser.CefBrowser
810
import java.awt.Color
@@ -35,14 +37,16 @@ class ThemeBrowserAdapter {
3537
append(CssVariable.FontFamily, theme.font.toCssFontFamily())
3638

3739
append(CssVariable.TextColorDefault, theme.defaultText)
40+
append(CssVariable.TextColorAlt, theme.defaultText)
3841
append(CssVariable.TextColorStrong, theme.textFieldForeground)
3942
append(CssVariable.TextColorInput, theme.textFieldForeground)
4043
append(CssVariable.TextColorLink, theme.linkText)
4144
append(CssVariable.TextColorWeak, theme.inactiveText)
4245

4346
append(CssVariable.Background, theme.background)
4447
append(CssVariable.BackgroundAlt, theme.background)
45-
append(CssVariable.CardBackground, theme.cardBackground)
48+
append(CssVariable.CardBackground, theme.editorBackground)
49+
append(CssVariable.CardBackgroundAlt, theme.editorBackground)
4650
append(CssVariable.BorderDefault, theme.border)
4751
append(CssVariable.TabActive, theme.activeTab)
4852

@@ -63,6 +67,7 @@ class ThemeBrowserAdapter {
6367

6468
append(CssVariable.SyntaxCodeFontFamily, theme.editorFont.toCssFontFamily("monospace"))
6569
append(CssVariable.SyntaxCodeFontSize, theme.editorFont.toCssSize())
70+
append(CssVariable.SyntaxCode, theme.editorForeground)
6671
append(CssVariable.SyntaxBackground, theme.editorBackground)
6772
append(CssVariable.SyntaxVariable, theme.editorVariable)
6873
append(CssVariable.SyntaxOperator, theme.editorOperator)
@@ -71,7 +76,9 @@ class ThemeBrowserAdapter {
7176
append(CssVariable.SyntaxAttributeValue, theme.editorKeyword)
7277
append(CssVariable.SyntaxAttribute, theme.editorString)
7378
append(CssVariable.SyntaxProperty, theme.editorProperty)
74-
append(CssVariable.SyntaxCode, theme.editorForeground)
79+
append(CssVariable.SyntaxKeyword, theme.editorKeyword)
80+
append(CssVariable.SyntaxString, theme.editorString)
81+
append(CssVariable.SyntaxClassName, theme.editorClassName)
7582

7683
append(CssVariable.MainBackground, theme.buttonBackground)
7784
append(CssVariable.MainForeground, theme.buttonForeground)

0 commit comments

Comments
 (0)