From 75aebd91563e5a1bcfbe9fbb4bce9c2972dc3da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20H=C3=B6lting?= <87192362+moritz-hoelting@users.noreply.github.com> Date: Thu, 15 Aug 2024 21:06:36 +0200 Subject: [PATCH] playground: better error display --- .github/workflows/deploy.yml | 2 +- src/components/playground/ErrorDisplay.tsx | 17 +++---------- src/styles/playground.scss | 29 +++++++++++++++++++++- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 278fe9a..70a0ee1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -23,7 +23,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - targets: wasm32-unknown-unknown + targets: wasm32-unknown-unknown - name: Install wasm-bindgen-cli uses: jetli/wasm-bindgen-action@v0.2.0 - name: Install, build, and upload your site output diff --git a/src/components/playground/ErrorDisplay.tsx b/src/components/playground/ErrorDisplay.tsx index 225610a..d366e24 100644 --- a/src/components/playground/ErrorDisplay.tsx +++ b/src/components/playground/ErrorDisplay.tsx @@ -18,25 +18,16 @@ export default function ErrorDisplay({ setError(null)}> {lang.title} -
+
- +
); diff --git a/src/styles/playground.scss b/src/styles/playground.scss index 33c72a0..cb593b4 100644 --- a/src/styles/playground.scss +++ b/src/styles/playground.scss @@ -42,4 +42,31 @@ > .editor { grid-area: editor; } -} \ No newline at end of file +} + +.error-terminal-display { + background-color: black; + padding: 15px; + border-radius: 15px; + font-size: 1.2em; + line-height: 0.8em; + + --red: #ff0000; + --cyan: #00d6d6; + + code { + white-space: break-spaces; + font-family: monospace; + } +} + +:root[data-theme="light"] { + .error-terminal-display { + background-color: lightgray; + + --red: #ff3f3f; + --cyan: #00a6a6; + --black: lightgray; + --white: #4f4f4f; + } +}