Skip to content

Commit 960c681

Browse files
committed
Updates
1 parent 5f406a0 commit 960c681

1 file changed

Lines changed: 47 additions & 13 deletions

File tree

src/zed-theme.ts

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ function makeZedTheme(
289289
error: c.states.danger,
290290
"error.background": alpha(c.states.danger, 0.1),
291291
"error.border": alpha(c.states.danger, 0.3),
292-
warning: c.states.warn,
293-
"warning.background": alpha(c.states.warn, 0.1),
294-
"warning.border": alpha(c.states.warn, 0.3),
292+
warning: c.accent.primary,
293+
"warning.background": alpha(c.accent.primary, 0.1),
294+
"warning.border": alpha(c.accent.primary, 0.3),
295295
success: c.states.success,
296296
"success.background": alpha(c.states.success, 0.1),
297297
"success.border": alpha(c.states.success, 0.3),
@@ -318,9 +318,9 @@ function makeZedTheme(
318318
deleted: c.states.danger,
319319
"deleted.background": alpha(c.states.danger, 0.1),
320320
"deleted.border": alpha(c.states.danger, 0.3),
321-
conflict: c.states.warn,
322-
"conflict.background": alpha(c.states.warn, 0.1),
323-
"conflict.border": alpha(c.states.warn, 0.3),
321+
conflict: c.accent.primary,
322+
"conflict.background": alpha(c.accent.primary, 0.1),
323+
"conflict.border": alpha(c.accent.primary, 0.3),
324324
hidden: c.fg.fg4,
325325
"hidden.background": alpha(c.fg.fg4, 0.05),
326326
"hidden.border": alpha(c.fg.fg4, 0.1),
@@ -393,8 +393,8 @@ function makeZedTheme(
393393
// Syntax highlighting
394394
syntax: {
395395
// Comments
396-
comment: { color: c.syntax.comment, font_style: "italic" },
397-
"comment.doc": { color: c.syntax.comment, font_style: "italic" },
396+
comment: { color: c.syntax.comment },
397+
"comment.doc": { color: c.syntax.comment },
398398

399399
// Strings
400400
string: { color: c.syntax.string },
@@ -427,22 +427,22 @@ function makeZedTheme(
427427

428428
// Variables
429429
variable: { color: c.syntax.variable },
430-
"variable.builtin": { color: c.syntax.namespace },
430+
"variable.builtin": { color: c.syntax.namespace }, // this, self, super
431431
"variable.member": { color: c.syntax.variable },
432432
"variable.parameter": { color: c.syntax.parameter },
433433
"variable.special": { color: c.syntax.namespace },
434434

435-
// Properties - In Zed, `property` is used for CSS property names
436-
// Use blue/accent for better CSS appearance (matches VS Code's blue-ish property names)
437-
property: { color: c.accent.primary },
435+
// Properties - Used for JS object keys and property access
436+
// Keep as variable color (orange) for JS compatibility
437+
property: { color: c.syntax.variable },
438438

439439
// ========================================
440440
// CSS/SCSS SPECIFIC
441441
// ========================================
442442
// CSS property names (e.g., position, display, margin) - blue
443+
// These more specific scopes should override `property` for CSS
443444
"property.css": { color: c.accent.primary },
444445
"property.definition": { color: c.accent.primary },
445-
// Property name is the specific tree-sitter capture
446446
property_name: { color: c.accent.primary },
447447

448448
// CSS property values that are keywords (e.g., relative, flex, auto, solid)
@@ -493,6 +493,40 @@ function makeZedTheme(
493493
// END CSS/SCSS SPECIFIC
494494
// ========================================
495495

496+
// ========================================
497+
// JAVASCRIPT/TYPESCRIPT SPECIFIC
498+
// ========================================
499+
// `this`, `self`, `super` - namespace/yellow color
500+
"variable.language": { color: c.syntax.namespace },
501+
this: { color: c.syntax.namespace },
502+
self: { color: c.syntax.namespace },
503+
504+
// Class/Type names (Dropdown, BaseComponent, TypeError)
505+
"type.class": { color: c.syntax.type },
506+
// Note: class_name is defined in CSS section for CSS class selectors
507+
508+
// Object literal keys
509+
"property.object": { color: c.syntax.variable },
510+
property_identifier: { color: c.syntax.variable },
511+
shorthand_property_identifier: { color: c.syntax.variable },
512+
shorthand_property_identifier_pattern: { color: c.syntax.variable },
513+
514+
// Method definitions and calls
515+
method_definition: { color: c.syntax.func },
516+
"function.method.call": { color: c.syntax.func },
517+
518+
// Template literal interpolation
519+
"string.template": { color: c.syntax.string },
520+
template_string: { color: c.syntax.string },
521+
522+
// JSX
523+
"tag.jsx": { color: c.syntax.tag },
524+
"tag.component": { color: c.syntax.type },
525+
526+
// ========================================
527+
// END JAVASCRIPT/TYPESCRIPT SPECIFIC
528+
// ========================================
529+
496530
// Punctuation
497531
punctuation: { color: c.syntax.punctuation },
498532
"punctuation.bracket": { color: c.syntax.punctuation },

0 commit comments

Comments
 (0)