You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50-37Lines changed: 50 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,21 @@
1
-
# json-diff-viewer
2
-
3
-
**Compare JSON side-by-side, visually**
4
-
5
-
A zero-dependency web component for visualizing JSON differences with synchronized scrolling, collapsible nodes, and syntax highlighting. Perfect for debugging, API comparisons, and configuration diffs
Customize the component by overriding CSS custom properties (design tokens) on the `json-diff-viewer` element. All tokens are defined on `:host` and can be overridden from outside the shadow DOM.
136
+
137
+
### Design Tokens
123
138
124
139
```css
125
140
json-diff-viewer {
126
141
/* Diff colors */
127
-
--added: #22c55e;
128
-
--removed: #ef4444;
129
-
--modified: #eab308;
130
-
--type-changed: #f97316;
131
-
--unchanged: #71717a;
142
+
--add: #22c55e; /* Added items */
143
+
--rem: #ef4444; /* Removed items */
144
+
--mod: #eab308; /* Modified items */
145
+
--typ: #f97316; /* Type changed items */
146
+
147
+
/* Backgrounds */
148
+
--bg: #18181b; /* Main background */
149
+
--bg2: #27272a; /* Panel background */
132
150
133
-
/* Background */
134
-
--bg: #18181b;
135
-
--bg-panel: #27272a;
136
-
--border: #3f3f46;
151
+
/* Borders */
152
+
--bdr: #3f3f46; /* Border color */
137
153
138
154
/* Text */
139
-
--text: #fafafa;
140
-
--text-dim: #a1a1aa;
141
-
142
-
/* Syntax */
143
-
--key: #38bdf8;
144
-
--string: #a78bfa;
145
-
--number: #34d399;
146
-
--boolean: #fb923c;
147
-
--null: #f472b6;
148
-
--bracket: #71717a;
149
-
150
-
/* Layout */
151
-
--radius: 12px;
152
-
--font: "JetBrains Mono", monospace;
155
+
--txt: #fafafa; /* Primary text */
156
+
--dim: #a1a1aa; /* Dimmed/secondary text */
157
+
158
+
/* Syntax highlighting */
159
+
--key: #38bdf8; /* Object keys */
160
+
--str: #a78bfa; /* String values */
161
+
--num: #34d399; /* Number values */
162
+
--bool: #fb923c; /* Boolean values */
163
+
--nul: #f472b6; /* Null values */
164
+
--br: #71717a; /* Brackets and braces */
153
165
}
154
166
```
155
167
156
-
### Light Theme
168
+
Create your own theme by overriding these tokens. For example, a light theme:
0 commit comments