authorgravatar for kappaloris@gmail.comLoris Cro <kappaloris@gmail.com> 2023-09-03 17:11:54+02:00
committergravatar for kappaloris@gmail.comLoris Cro <kappaloris@gmail.com> 2023-09-03 17:12:52+02:00
logc0da41582bb04db318c9698a1a9ea51247610b36
treec0cd8716ff1968b9361cf775aa65741c2eb6f32d
parentc3a8f1fe9268b2b24ae49a2d3490210a3a221dac

autodoc: better light mode colors

fix #15799

2 files changed, 14 insertions(+), 6 deletions(-)

lib/docs/index.html+9-3
...@@ -818,7 +818,8 @@...@@ -818,7 +818,8 @@
818 pre {818 pre {
819 --zig-keyword: #333;819 --zig-keyword: #333;
820 --zig-builtin: #0086b3;820 --zig-builtin: #0086b3;
821 --zig-identifier: 'black';821 --zig-identifier: black;
822 --zig-decl-identifier: #0086b3;
822 --zig-string-literal: #d14;823 --zig-string-literal: #d14;
823 --zig-type: #458;824 --zig-type: #458;
824 --zig-fn: #900;825 --zig-fn: #900;
...@@ -828,13 +829,13 @@...@@ -828,13 +829,13 @@
828 pre {829 pre {
829 --zig-keyword: #eee;830 --zig-keyword: #eee;
830 --zig-builtin: #ff894c;831 --zig-builtin: #ff894c;
831 --zig-identifier: 'purple';832 --zig-identifier: #bbbbbb;
833 --zig-decl-identifier: lightblue;
832 --zig-string-literal: #2e5;834 --zig-string-literal: #2e5;
833 --zig-type: #68f;835 --zig-type: #68f;
834 --zig-fn: #e33;836 --zig-fn: #e33;
835 }837 }
836 }838 }
837
838839
839 .zig_keyword_addrspace,840 .zig_keyword_addrspace,
840 .zig_keyword_align,841 .zig_keyword_align,
...@@ -914,6 +915,11 @@...@@ -914,6 +915,11 @@
914 color: var(--zig-identifier);915 color: var(--zig-identifier);
915 font-weight: bold;916 font-weight: bold;
916 }917 }
918
919 .zig_decl_identifier {
920 color: var(--zig-decl-identifier);
921 font-weight: bold;
922 }
917923
918 .zig_number_literal,924 .zig_number_literal,
919 .zig_special {925 .zig_special {
lib/docs/main.js+5-3
...@@ -1269,12 +1269,14 @@ Happy writing!...@@ -1269,12 +1269,14 @@ Happy writing!
1269 result = `<span class="zig_special">${src}</span>`;1269 result = `<span class="zig_special">${src}</span>`;
1270 } else if (t.tag == Tag.identifier && t.fnDecl) {1270 } else if (t.tag == Tag.identifier && t.fnDecl) {
1271 result = `<span class="zig_fn">${src}</span>`;1271 result = `<span class="zig_fn">${src}</span>`;
1272 } else if (t.tag == Tag.identifier && t.isDecl) {
1273 result = `<span class="zig_decl_identifier">${src}</span>`;
1272 } else {1274 } else {
1273 result = `<span class="zig_${t.tag}">${src}</span>`;1275 result = `<span class="zig_${t.tag}">${src}</span>`;
1274 }1276 }
12751277
1276 if (t.link) {1278 if (t.link) {
1277 result = `<a href="${t.link}">` + result + "</a>";1279 result = `<a class="zighref="${t.link}">` + result + "</a>";
1278 }1280 }
12791281
1280 return result;1282 return result;
...@@ -1316,9 +1318,9 @@ Happy writing!...@@ -1316,9 +1318,9 @@ Happy writing!
1316 const name = getDecl(expr.declRef).name;1318 const name = getDecl(expr.declRef).name;
1317 const link = declLinkOrSrcLink(expr.declRef);1319 const link = declLinkOrSrcLink(expr.declRef);
1318 if (link) {1320 if (link) {
1319 yield { src: name, tag: Tag.identifier, link };1321 yield { src: name, tag: Tag.identifier, isDecl: true, link };
1320 } else {1322 } else {
1321 yield { src: name, tag: Tag.identifier };1323 yield { src: name, tag: Tag.identifier, isDecl: true };
1322 }1324 }
1323 return;1325 return;
1324 }1326 }