theme: Fix Ayu theme. (#1276)

<img width="1115" height="940" alt="image"
src="https://github.com/user-attachments/assets/cce54665-a9b5-446b-aaef-447ed7265c27"
/>
This commit is contained in:
Jason Lee 2025-09-23 11:16:26 +08:00 committed by GitHub
parent 9febc52387
commit d4f51f3135
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 354 additions and 172 deletions

View file

@ -1084,7 +1084,11 @@ impl Element for TextElement {
input_bounds.size.height, input_bounds.size.height,
), ),
}, },
cx.theme().background, cx.theme()
.highlight_theme
.style
.background
.unwrap_or(cx.theme().background),
)); ));
// Each item is the normal lines. // Each item is the normal lines.

View file

@ -239,7 +239,11 @@ impl RenderOnce for TextInput {
let bg = if state.disabled { let bg = if state.disabled {
cx.theme().muted cx.theme().muted
} else { } else {
cx.theme().background cx.theme()
.highlight_theme
.style
.background
.unwrap_or(cx.theme().background)
}; };
let prefix = self.prefix; let prefix = self.prefix;

View file

@ -1,18 +1,18 @@
{ {
"$schema": "https://github.com/longbridge/gpui-component/raw/refs/heads/main/.theme-schema.json", "$schema": "https://github.com/longbridge/gpui-component/raw/refs/heads/main/.theme-schema.json",
"name": "Ayu Light", "name": "Ayu Light",
"author": "ayu-theme", "author": "Zed Industries",
"url": "https://github.com/ayu-theme", "url": "https://github.com/zed-industries/zed/blob/e62dd2a0e584154886ff86cc1e9e3e060558b977/assets/themes/ayu",
"themes": [ "themes": [
{ {
"name": "Ayu Light", "name": "Ayu Light",
"mode": "light", "mode": "light",
"colors": { "colors": {
"accent.background": "#ECECED", "accent.background": "#DFE0E1",
"accent.foreground": "#5C6773", "accent.foreground": "#5C6773",
"background": "#fafafa", "background": "#fafafa",
"foreground": "#5C6773", "foreground": "#5c6166",
"border": "#E6E8EA", "border": "#cfd1d2ff",
"ring": "#FF9940", "ring": "#FF9940",
"input.border": "#D9DCE3", "input.border": "#D9DCE3",
"list.active.background": "#55B4D422", "list.active.background": "#55B4D422",
@ -23,14 +23,14 @@
"muted.background": "#F3F4F5", "muted.background": "#F3F4F5",
"muted.foreground": "#ABB0B6", "muted.foreground": "#ABB0B6",
"panel.background": "#F3F4F5", "panel.background": "#F3F4F5",
"popover.background": "#FAFAFA", "popover.background": "#ECECED",
"popover.foreground": "#5C6773", "popover.foreground": "#5C6773",
"primary.active.background": "#55B4D4", "primary.active.background": "#55B4D4",
"primary.background": "#55B4D4", "primary.background": "#55B4D4",
"primary.foreground": "#FAFAFA", "primary.foreground": "#FAFAFA",
"primary.hover.background": "#55B4D4", "primary.hover.background": "#55B4D4",
"scrollbar.background": "#FAFAFA00", "scrollbar.background": "#FAFAFA00",
"scrollbar.thumb.background": "#D9DCE3", "scrollbar.thumb.background": "#5c61664c",
"secondary.active.background": "#ECECED", "secondary.active.background": "#ECECED",
"secondary.background": "#F0F1F2", "secondary.background": "#F0F1F2",
"secondary.foreground": "#5C6773", "secondary.foreground": "#5C6773",
@ -40,7 +40,7 @@
"tab.background": "#ECECED00", "tab.background": "#ECECED00",
"tab.foreground": "#8d8986", "tab.foreground": "#8d8986",
"tab_bar.background": "#ECECED", "tab_bar.background": "#ECECED",
"title_bar.background": "#ECECED", "title_bar.background": "#dcddde",
"title_bar.border": "#CFD1D2", "title_bar.border": "#CFD1D2",
"base.yellow": "#e7c547", "base.yellow": "#e7c547",
"base.yellow.light": "#ffc94a", "base.yellow.light": "#ffc94a",
@ -61,94 +61,179 @@
"editor.active_line.background": "#ECECED", "editor.active_line.background": "#ECECED",
"editor.line_number": "#ABB0B6", "editor.line_number": "#ABB0B6",
"editor.active_line_number": "#5C6773", "editor.active_line_number": "#5C6773",
"conflict": "#FF9940", "conflict": "#f1ad49ff",
"created": "#86B300", "conflict.background": "#ffeedaff",
"deleted": "#F07171", "conflict.border": "#ffe1beff",
"error": "#F07171", "created": "#85b304ff",
"hidden": "#ABB0B6", "created.background": "#e9efd2ff",
"hint": "#55B4D4", "created.border": "#d7e3aeff",
"ignored": "#D9DCE3", "deleted": "#ef7271ff",
"info": "#55B4D4", "deleted.background": "#ffe3e1ff",
"modified": "#FF9940", "deleted.border": "#ffcdcaff",
"predictive": "#5C6773", "error": "#ef7271ff",
"renamed": "#86B300", "error.background": "#ffe3e1ff",
"success": "#86B300", "error.border": "#ffcdcaff",
"unreachable": "#ABB0B6", "hidden": "#a9acaeff",
"warning": "#FF9940", "hidden.background": "#dcdddeff",
"hidden.border": "#d5d6d8ff",
"hint": "#8ca7c2ff",
"hint.background": "#deebfaff",
"hint.border": "#c4daf6ff",
"ignored": "#a9acaeff",
"ignored.background": "#dcdddeff",
"ignored.border": "#cfd1d2ff",
"info": "#3b9ee5ff",
"info.background": "#deebfaff",
"info.border": "#c4daf6ff",
"modified": "#f1ad49ff",
"modified.background": "#ffeedaff",
"modified.border": "#ffe1beff",
"predictive": "#9eb9d3ff",
"predictive.background": "#e9efd2ff",
"predictive.border": "#d7e3aeff",
"renamed": "#3b9ee5ff",
"renamed.background": "#deebfaff",
"renamed.border": "#c4daf6ff",
"success": "#85b304ff",
"success.background": "#e9efd2ff",
"success.border": "#d7e3aeff",
"unreachable": "#8b8e92ff",
"unreachable.background": "#dcdddeff",
"unreachable.border": "#cfd1d2ff",
"warning": "#f1ad49ff",
"warning.background": "#ffeedaff",
"warning.border": "#ffe1beff",
"syntax": { "syntax": {
"attribute": { "attribute": {
"color": "#86B300" "color": "#3b9ee5ff"
}, },
"boolean": { "boolean": {
"color": "#FF9940" "color": "#a37accff"
}, },
"comment": { "comment": {
"color": "#ABB0B6", "color": "#787b8099"
"font_style": "italic"
}, },
"comment.doc": { "comment.doc": {
"color": "#ABB0B6", "color": "#898d90ff"
"font_style": "italic"
}, },
"constant": { "constant": {
"color": "#F07171" "color": "#a37accff"
}, },
"constructor": { "constructor": {
"color": "#55B4D4" "color": "#3b9ee5ff"
}, },
"embedded": { "embedded": {
"color": "#5C6773" "color": "#5c6166ff"
},
"emphasis": {
"color": "#3b9ee5ff"
},
"emphasis.strong": {
"color": "#3b9ee5ff",
"font_weight": 700
},
"enum": {
"color": "#f98d3fff"
}, },
"function": { "function": {
"color": "#55B4D4" "color": "#f2ad48ff"
},
"hint": {
"color": "#8ca7c2ff",
"font_weight": 700
}, },
"keyword": { "keyword": {
"color": "#FF9940" "color": "#fa8d3eff"
},
"label": {
"color": "#3b9ee5ff"
}, },
"link_text": { "link_text": {
"color": "#55B4D4", "color": "#f98d3fff",
"font_style": "underline"
},
"link_uri": {
"color": "#5C6773",
"font_style": "italic" "font_style": "italic"
}, },
"link_uri": {
"color": "#85b304ff"
},
"namespace": {
"color": "#5c6166ff"
},
"number": { "number": {
"color": "#F07171" "color": "#a37accff"
}, },
"string": { "operator": {
"color": "#86B300" "color": "#ed9365ff"
}, },
"string.escape": { "predictive": {
"color": "#FF9940" "color": "#9eb9d3ff",
"font_style": "italic"
}, },
"string.regex": { "preproc": {
"color": "#86B300" "color": "#5c6166ff"
}, },
"string.special": { "primary": {
"color": "#55B4D4" "color": "#5c6166ff"
},
"string.special.symbol": {
"color": "#55B4D4"
},
"tag": {
"color": "#FF9940"
},
"text.literal": {
"color": "#5C6773"
},
"title": {
"color": "#55B4D4",
"font_weight": 600
},
"type": {
"color": "#55B4D4"
}, },
"property": { "property": {
"color": "#5C6773" "color": "#3b9ee5ff"
}, },
"variable.special": { "punctuation": {
"color": "#FF9940" "color": "#73777bff"
},
"punctuation.bracket": {
"color": "#73777bff"
},
"punctuation.delimiter": {
"color": "#73777bff"
},
"punctuation.list_marker": {
"color": "#73777bff"
},
"punctuation.markup": {
"color": "#73777bff"
},
"punctuation.special": {
"color": "#a37accff"
},
"selector": {
"color": "#a37accff"
},
"selector.pseudo": {
"color": "#3b9ee5ff"
},
"string": {
"color": "#86b300ff"
},
"string.escape": {
"color": "#898d90ff"
},
"string.regex": {
"color": "#4bbf98ff"
},
"string.special": {
"color": "#e6ba7eff"
},
"string.special.symbol": {
"color": "#f98d3fff"
},
"tag": {
"color": "#3b9ee5ff"
},
"text.literal": {
"color": "#f98d3fff"
},
"title": {
"color": "#5c6166ff",
"font_weight": 700
},
"type": {
"color": "#389ee6ff"
},
"variable": {
"color": "#5c6166ff"
},
"variant": {
"color": "#3b9ee5ff"
} }
} }
} }
@ -157,133 +242,222 @@
"name": "Ayu Dark", "name": "Ayu Dark",
"mode": "dark", "mode": "dark",
"colors": { "colors": {
"accent.background": "#191F2A", "accent.background": "#2D2F34",
"accent.foreground": "#B3B1AD", "accent.foreground": "#B3B1AD",
"background": "#0F1419", "background": "#1F2127",
"border": "#444444", "border": "#3f4043",
"ring": "#FFB454", "ring": "#FFB454",
"danger.background": "#F07178",
"foreground": "#B3B1AD", "foreground": "#B3B1AD",
"input.border": "#444444", "input.border": "#444444",
"list.active.background": "#36A3D922", "list.active.background": "#36A3D922",
"list.active.border": "#36A3D9", "list.active.border": "#36A3D9",
"list.even.background": "#191F2A99", "list.even.background": "#191F2A99",
"muted.background": "#1F2430", "muted.background": "#1F2430",
"muted.foreground": "#707A8C", "muted.foreground": "#8a8986ff",
"panel.background": "#1F2126", "panel.background": "#1F2126",
"popover.background": "#0A0E14", "popover.background": "#1F2127",
"popover.foreground": "#B3B1AD", "popover.foreground": "#B3B1AD",
"primary.active.background": "#36A3D9", "primary.active.background": "#36A3D9",
"primary.background": "#36A3D9", "primary.background": "#5ac1fe",
"primary.foreground": "#FAFAFA", "primary.foreground": "#1F2430",
"primary.hover.background": "#3DAEE9", "primary.hover.background": "#3DAEE9",
"scrollbar.background": "#0A0E1400", "scrollbar.background": "#0A0E1400",
"scrollbar.thumb.background": "#444444", "scrollbar.thumb.background": "#bfbdb64c",
"secondary.active.background": "#191d24", "secondary.active.background": "#191d24",
"secondary.background": "#1F2430", "secondary.background": "#1f2127",
"secondary.foreground": "#B3B1AD", "secondary.foreground": "#B3B1AD",
"secondary.hover.background": "#191d2499", "secondary.hover.background": "#191d2499",
"tab.active.background": "#0F1419",
"tab.active.foreground": "#B3B1AD", "tab.active.foreground": "#B3B1AD",
"tab.background": "#13151A00", "tab.background": "#1F2127",
"tab.foreground": "#82807d", "tab.foreground": "#82807d",
"tab_bar.background": "#13151A", "tab_bar.background": "#1F2127",
"base.yellow": "#e7c547", "title_bar.background": "#1F2127",
"base.red": "#F07178", "base.yellow": "#feb454",
"base.red.light": "#F0717888", "base.red": "#ef7177",
"base.blue": "#36a3d9", "base.blue": "#5ac1fe",
"base.blue.light": "#68d5ff", "base.green": "#aad84c",
"base.green": "#b8cc52", "base.magenta": "#d2a6ff",
"base.green.light": "#eafe84", "base.cyan": "#5a728b"
"base.magenta": "#b283f8",
"base.magenta.light": "#b283f888",
"base.cyan": "#95e6cb",
"base.cyan.light": "#c7fffd"
}, },
"highlight": { "highlight": {
"editor.foreground": "#DDDDDD", "editor.foreground": "#bfbdb6",
"editor.background": "#000000", "editor.background": "#0d1016",
"editor.active_line.background": "#131313", "editor.active_line.background": "#1f2127bf",
"editor.line_number": "#8F8F8F", "editor.line_number": "#4b4c4e",
"editor.active_line_number": "#DDDDDD", "editor.active_line_number": "#DDDDDD",
"conflict": "#D2602D", "conflict": "#feb454ff",
"created": "#3f72e2", "conflict.background": "#572815ff",
"hidden": "#9E9E9E", "conflict.border": "#754221ff",
"hint": "#b283f8", "created": "#aad84cff",
"modified": "#B0A878", "created.background": "#294113ff",
"predictive": "#5D5945", "created.border": "#405c1cff",
"deleted": "#ef7177ff",
"deleted.background": "#48161bff",
"deleted.border": "#66272dff",
"error": "#ef7177ff",
"error.background": "#48161bff",
"error.border": "#66272dff",
"hidden": "#696a6aff",
"hidden.background": "#313337ff",
"hidden.border": "#383a3eff",
"hint": "#628b80ff",
"hint.background": "#0d2f4eff",
"hint.border": "#1b4a6eff",
"ignored": "#696a6aff",
"ignored.background": "#313337ff",
"ignored.border": "#3f4043ff",
"info": "#5ac1feff",
"info.background": "#0d2f4eff",
"info.border": "#1b4a6eff",
"modified": "#feb454ff",
"modified.background": "#572815ff",
"modified.border": "#754221ff",
"predictive": "#5a728bff",
"predictive.background": "#294113ff",
"predictive.border": "#405c1cff",
"renamed": "#5ac1feff",
"renamed.background": "#0d2f4eff",
"renamed.border": "#1b4a6eff",
"success": "#aad84cff",
"success.background": "#294113ff",
"success.border": "#405c1cff",
"unreachable": "#8a8986ff",
"unreachable.background": "#313337ff",
"unreachable.border": "#3f4043ff",
"warning": "#feb454ff",
"warning.background": "#572815ff",
"warning.border": "#754221ff",
"syntax": { "syntax": {
"attribute": { "attribute": {
"color": "#be9a52" "color": "#5ac1feff"
}, },
"boolean": { "boolean": {
"color": "#E1D797" "color": "#d2a6ffff"
}, },
"comment": { "comment": {
"color": "#9E9E9E" "color": "#abb5be8c"
}, },
"comment.doc": { "comment.doc": {
"color": "#9E9E9E" "color": "#8c8b88ff"
}, },
"constant": { "constant": {
"color": "#E1D797" "color": "#d2a6ffff"
}, },
"constructor": { "constructor": {
"color": "#b5af9a" "color": "#5ac1feff"
}, },
"embedded": { "embedded": {
"color": "#CACCCA" "color": "#bfbdb6ff"
},
"emphasis": {
"color": "#5ac1feff"
},
"emphasis.strong": {
"color": "#5ac1feff",
"font_weight": 700
},
"enum": {
"color": "#fe8f40ff"
}, },
"function": { "function": {
"color": "#E1D797" "color": "#ffb353ff"
},
"hint": {
"color": "#628b80ff",
"font_weight": 700
}, },
"keyword": { "keyword": {
"color": "#E19773" "color": "#ff8f3fff"
},
"label": {
"color": "#5ac1feff"
}, },
"link_text": { "link_text": {
"color": "#A86D3B", "color": "#fe8f40ff",
"font_style": "normal"
},
"link_uri": {
"color": "#6F6D66",
"font_style": "italic" "font_style": "italic"
}, },
"link_uri": {
"color": "#aad84cff"
},
"namespace": {
"color": "#bfbdb6ff"
},
"number": { "number": {
"color": "#E19773" "color": "#d2a6ffff"
}, },
"string": { "operator": {
"color": "#76BA53" "color": "#f29668ff"
}, },
"string.escape": { "predictive": {
"color": "#76BA53" "color": "#5a728bff",
"font_style": "italic"
}, },
"string.regex": { "preproc": {
"color": "#76BA53" "color": "#bfbdb6ff"
}, },
"string.special": { "primary": {
"color": "#E1D797" "color": "#bfbdb6ff"
},
"string.special.symbol": {
"color": "#E1D797"
},
"tag": {
"color": "#b5af9a"
},
"text.literal": {
"color": "#E1D797"
},
"title": {
"color": "#A76D3B",
"font_weight": 600
},
"type": {
"color": "#A86D3B"
}, },
"property": { "property": {
"color": "#CACCCA" "color": "#5ac1feff"
}, },
"variable.special": { "punctuation": {
"color": "#E19773" "color": "#a6a5a0ff"
},
"punctuation.bracket": {
"color": "#a6a5a0ff"
},
"punctuation.delimiter": {
"color": "#a6a5a0ff"
},
"punctuation.list_marker": {
"color": "#a6a5a0ff"
},
"punctuation.markup": {
"color": "#a6a5a0ff"
},
"punctuation.special": {
"color": "#d2a6ffff"
},
"selector": {
"color": "#d2a6ffff"
},
"selector.pseudo": {
"color": "#5ac1feff"
},
"string": {
"color": "#a9d94bff"
},
"string.escape": {
"color": "#8c8b88ff"
},
"string.regex": {
"color": "#95e6cbff"
},
"string.special": {
"color": "#e5b572ff"
},
"string.special.symbol": {
"color": "#fe8f40ff"
},
"tag": {
"color": "#5ac1feff"
},
"text.literal": {
"color": "#fe8f40ff"
},
"title": {
"color": "#bfbdb6ff",
"font_weight": 700
},
"type": {
"color": "#59c2ffff"
},
"variable": {
"color": "#bfbdb6ff"
},
"variant": {
"color": "#5ac1feff"
} }
} }
} }

View file

@ -441,8 +441,8 @@
}, },
"highlight": { "highlight": {
"editor.foreground": "#c6d0f5", "editor.foreground": "#c6d0f5",
"editor.background": "#303446", "editor.background": "#232634",
"editor.active_line.background": "#414559", "editor.active_line.background": "#41455977",
"editor.line_number": "#979db5", "editor.line_number": "#979db5",
"editor.active_line_number": "#c6d0f5", "editor.active_line_number": "#c6d0f5",
"conflict": "#e78284", "conflict": "#e78284",

View file

@ -203,7 +203,7 @@
"highlight": { "highlight": {
"editor.foreground": "#CACCCA", "editor.foreground": "#CACCCA",
"editor.background": "#131313", "editor.background": "#131313",
"editor.active_line.background": "#353436", "editor.active_line.background": "#35343666",
"editor.line_number": "#8F8F8F", "editor.line_number": "#8F8F8F",
"editor.active_line_number": "#DDDDDD", "editor.active_line_number": "#DDDDDD",
"conflict": "#D2602D", "conflict": "#D2602D",

View file

@ -56,8 +56,8 @@
}, },
"highlight": { "highlight": {
"editor.foreground": "#ebdbb2", "editor.foreground": "#ebdbb2",
"editor.background": "#282828", "editor.background": "#110D10",
"editor.active_line.background": "#3c3836", "editor.active_line.background": "#3c383655",
"editor.line_number": "#928374", "editor.line_number": "#928374",
"editor.active_line_number": "#ebdbb2", "editor.active_line_number": "#ebdbb2",
"conflict": "#cc241d", "conflict": "#cc241d",
@ -67,7 +67,7 @@
"hidden": "#928374", "hidden": "#928374",
"hint": "#83a598", "hint": "#83a598",
"ignored": "#928374", "ignored": "#928374",
"info": "#83a598", "info": "#324a8f",
"modified": "#b57614", "modified": "#b57614",
"predictive": "#928374", "predictive": "#928374",
"renamed": "#b57614", "renamed": "#b57614",
@ -76,78 +76,78 @@
"warning": "#d79921", "warning": "#d79921",
"syntax": { "syntax": {
"attribute": { "attribute": {
"color": "#d79921" "color": "#ebdbb2"
}, },
"boolean": { "boolean": {
"color": "#d79921" "color": "#d79921BB"
}, },
"comment": { "comment": {
"color": "#928374", "color": "#504945",
"font_style": "italic" "font_style": "italic"
}, },
"comment.doc": { "comment.doc": {
"color": "#928374", "color": "#504945",
"font_style": "italic" "font_style": "italic"
}, },
"constant": { "constant": {
"color": "#d79921" "color": "#522431BB"
}, },
"constructor": { "constructor": {
"color": "#b57614" "color": "#b57614BB"
}, },
"embedded": { "embedded": {
"color": "#ebdbb2" "color": "#ebdbb2"
}, },
"function": { "function": {
"color": "#d79921" "color": "#ebdbb299"
}, },
"keyword": { "keyword": {
"color": "#cc241d" "color": "#324a8f99"
}, },
"link_text": { "link_text": {
"color": "#83a598", "color": "#83a598",
"font_style": "normal" "font_style": "normal"
}, },
"link_uri": { "link_uri": {
"color": "#076678", "color": "#076678BB",
"font_style": "italic" "font_style": "italic"
}, },
"number": { "number": {
"color": "#cc241d" "color": "#9d0006BB"
}, },
"string": { "string": {
"color": "#7c6f64" "color": "#55743e"
}, },
"string.escape": { "string.escape": {
"color": "#7c6f64" "color": "#55743e"
}, },
"string.regex": { "string.regex": {
"color": "#7c6f64" "color": "#55743e"
}, },
"string.special": { "string.special": {
"color": "#d79921" "color": "#55743e"
}, },
"string.special.symbol": { "string.special.symbol": {
"color": "#d79921" "color": "#55743e"
}, },
"tag": { "tag": {
"color": "#b57614" "color": "#b57614BB"
}, },
"text.literal": { "text.literal": {
"color": "#d79921" "color": "#d79921BB"
}, },
"title": { "title": {
"color": "#b57614", "color": "#b57614BB",
"font_weight": 600 "font_weight": 600
}, },
"type": { "type": {
"color": "#b57614" "color": "#9d0006BB"
}, },
"property": { "property": {
"color": "#ebdbb2" "color": "#ebdbb2"
}, },
"variable.special": { "variable.special": {
"color": "#cc241d" "color": "#cc241dBB"
} }
} }
} }

View file

@ -202,7 +202,7 @@
"highlight": { "highlight": {
"editor.foreground": "#abb2bf", "editor.foreground": "#abb2bf",
"editor.background": "#1A1A1A", "editor.background": "#1A1A1A",
"editor.active_line.background": "#292929", "editor.active_line.background": "#29292977",
"editor.line_number": "#828997", "editor.line_number": "#828997",
"editor.active_line_number": "#abb2bf", "editor.active_line_number": "#abb2bf",
"conflict": "#e06c75", "conflict": "#e06c75",

View file

@ -188,7 +188,7 @@
}, },
"highlight": { "highlight": {
"editor.foreground": "#DDDDDD", "editor.foreground": "#DDDDDD",
"editor.background": "#000000", "editor.background": "#002B36",
"editor.active_line.background": "#073642", "editor.active_line.background": "#073642",
"editor.line_number": "#8F8F8F", "editor.line_number": "#8F8F8F",
"editor.active_line_number": "#DDDDDD", "editor.active_line_number": "#DDDDDD",