From f6e424df666a72102d4dff07fa8505ba477d6cf8 Mon Sep 17 00:00:00 2001 From: Michael Sweeney Date: Wed, 18 Dec 2024 02:40:58 -0800 Subject: [PATCH] fix(website): valtio.dev code display issue (#1022) * fixed homepage code example * added declaration files to get counter example to build * removed empty declaration files --- examples/counter/package.json | 2 ++ examples/counter/pnpm-lock.yaml | 35 +++++++++++++++++++++++++++++++++ website/styles/prism-theme.css | 13 ++++++------ 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/examples/counter/package.json b/examples/counter/package.json index dd120f12..60602f2b 100644 --- a/examples/counter/package.json +++ b/examples/counter/package.json @@ -10,7 +10,9 @@ "preview": "vite preview" }, "dependencies": { + "@types/lowlight": "^0.0.7", "highlight.js": "^11.11.0", + "lowlight": "^3.3.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-lowlight": "^3.0.1", diff --git a/examples/counter/pnpm-lock.yaml b/examples/counter/pnpm-lock.yaml index ec08d5ed..366234e5 100644 --- a/examples/counter/pnpm-lock.yaml +++ b/examples/counter/pnpm-lock.yaml @@ -5,9 +5,15 @@ settings: excludeLinksFromLockfile: false dependencies: + '@types/lowlight': + specifier: ^0.0.7 + version: 0.0.7 highlight.js: specifier: ^11.11.0 version: 11.11.0 + lowlight: + specifier: ^3.3.0 + version: 3.3.0 react: specifier: ^18.3.1 version: 18.3.1 @@ -647,6 +653,16 @@ packages: '@types/unist': 2.0.11 dev: false + /@types/hast@3.0.4: + resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + dependencies: + '@types/unist': 2.0.11 + dev: false + + /@types/lowlight@0.0.7: + resolution: {integrity: sha512-81Q0Vdv6JEI1y1TCDMveiBvIT/H//jnaZsOigZQkU31Os9s3Kpe0/0qTiLivpYf1rM7v4AFF3QXvJHULZDOn4w==} + dev: false + /@types/prop-types@15.7.14: resolution: {integrity: sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==} @@ -718,6 +734,17 @@ packages: ms: 2.1.3 dev: true + /dequal@2.0.3: + resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} + engines: {node: '>=6'} + dev: false + + /devlop@1.1.0: + resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} + dependencies: + dequal: 2.0.3 + dev: false + /electron-to-chromium@1.5.74: resolution: {integrity: sha512-ck3//9RC+6oss/1Bh9tiAVFy5vfSKbRHAFh7Z3/eTRkEqJeWgymloShB17Vg3Z4nmDNp35vAd1BZ6CMW4Wt6Iw==} dev: true @@ -827,6 +854,14 @@ packages: highlight.js: 11.8.0 dev: false + /lowlight@3.3.0: + resolution: {integrity: sha512-0JNhgFoPvP6U6lE/UdVsSq99tn6DhjjpAj5MxG49ewd2mOBVtwWYIT8ClyABhq198aXXODMU6Ox8DrGy/CpTZQ==} + dependencies: + '@types/hast': 3.0.4 + devlop: 1.1.0 + highlight.js: 11.11.0 + dev: false + /lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} dependencies: diff --git a/website/styles/prism-theme.css b/website/styles/prism-theme.css index cb53ed1a..8e3b6865 100644 --- a/website/styles/prism-theme.css +++ b/website/styles/prism-theme.css @@ -35,9 +35,14 @@ pre { } :not(pre) > code[class*="language-"], -code { +pre[class*="language-"] { + background: #2e3440; + padding: 1em; +} + +code:not([class*="language-"]) { + padding: 0.1em 0.3em; background: #2e3440; - padding: 0.1em; } code { @@ -164,7 +169,3 @@ blockquote { .important { border-left: 5px solid #a3be8c; } - -code { - -}