From 12f1c657fcb27555531c7cba8ba610d93b59c348 Mon Sep 17 00:00:00 2001 From: Ken <54569460+KenKout@users.noreply.github.com> Date: Mon, 1 Jul 2024 21:52:58 +0700 Subject: [PATCH 1/2] Fix dark mode Fix when user changes their system mode into dark, the background is not updated --- src/streamlit_paste_button/frontend/main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/streamlit_paste_button/frontend/main.js b/src/streamlit_paste_button/frontend/main.js index 8b7880a..ff03e18 100644 --- a/src/streamlit_paste_button/frontend/main.js +++ b/src/streamlit_paste_button/frontend/main.js @@ -58,6 +58,11 @@ function onRender(event) { // Set the button's text font pasteButton.style.fontFamily = event.detail.theme.font; + + if (data.theme) { + // Change the body's background color to match the theme's background color + document.body.style.backgroundColor = data.theme.backgroundColor; + } // pasteButton.onclick = event => { // parseClipboardData(); From 18a36d8a2a6d1f6980d7d31070bea6572edc4dbc Mon Sep 17 00:00:00 2001 From: Ken <54569460+KenKout@users.noreply.github.com> Date: Mon, 1 Jul 2024 21:55:36 +0700 Subject: [PATCH 2/2] Fix button display Fix space before button: "_[button]" -> "[button]" --- src/streamlit_paste_button/frontend/style.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/streamlit_paste_button/frontend/style.css b/src/streamlit_paste_button/frontend/style.css index 63a9519..5a39db4 100644 --- a/src/streamlit_paste_button/frontend/style.css +++ b/src/streamlit_paste_button/frontend/style.css @@ -30,3 +30,17 @@ button:not(:disabled) { } +body { + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, + "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", + "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + font-size: 1rem; + font-weight: 400; + line-height: 1.5; + color: #212529; + text-align: left; + background-color: #fff; +} + +