From f8283c9b4809d103b2a7c86477d09388ccc093d6 Mon Sep 17 00:00:00 2001 From: Dan Grebb Date: Wed, 31 Jan 2024 19:11:00 -0500 Subject: [PATCH] refactor(front): use flexbox for syntax-highlighter (#1208) --- front/patches/svelte-highlight@7.4.8.patch | 65 +++++-- front/pnpm-lock.yaml | 6 +- .../src/lib/components/posts/Code/Code.svelte | 76 ++++---- front/src/lib/styles/base/typography.css | 1 - front/src/lib/styles/components/Code/Code.css | 175 +++++++----------- front/src/lib/styles/pages/cv.css | 2 +- front/src/lib/styles/pages/home.css | 2 +- front/src/lib/styles/pages/post.css | 2 +- 8 files changed, 169 insertions(+), 160 deletions(-) diff --git a/front/patches/svelte-highlight@7.4.8.patch b/front/patches/svelte-highlight@7.4.8.patch index 3da351a04..44f13311a 100644 --- a/front/patches/svelte-highlight@7.4.8.patch +++ b/front/patches/svelte-highlight@7.4.8.patch @@ -1,5 +1,5 @@ diff --git a/LineNumbers.svelte b/LineNumbers.svelte -index 704976d98f45c0a472355927aed541adc0934806..1483d231bf576f849644280a8b0e306aae9e7d0e 100644 +index 704976d98f45c0a472355927aed541adc0934806..e79aef99eff32c36b8589523f4049139727856b8 100644 --- a/LineNumbers.svelte +++ b/LineNumbers.svelte @@ -24,14 +24,32 @@ @@ -7,17 +7,17 @@ index 704976d98f45c0a472355927aed541adc0934806..1483d231bf576f849644280a8b0e306a $: len = len_digits - MIN_DIGITS < 1 ? MIN_DIGITS : len_digits; $: width = len * DIGIT_WIDTH; + -+function isHighlightStart(lines, n) { -+ const i = lines.indexOf(n); -+ const prev = lines[i - 1]; -+ return prev !== n - 1; -+} ++ function isHighlightStart(lines, n) { ++ const i = lines.indexOf(n); ++ const prev = lines[i - 1]; ++ return prev !== n - 1; ++ } + -+function isHighlightEnd(lines, n) { -+ const i = lines.indexOf(n); -+ const next = lines[i + 1]; -+ return next !== n + 1; -+} ++ function isHighlightEnd(lines, n) { ++ const i = lines.indexOf(n); ++ const next = lines[i + 1]; ++ return next !== n + 1; ++ } -
@@ -59,7 +59,48 @@ index 704976d98f45c0a472355927aed541adc0934806..1483d231bf576f849644280a8b0e306a {/each} -@@ -127,26 +133,4 @@ +@@ -67,16 +73,10 @@ +
+ +