Skip to content

Commit

Permalink
chore: tweak scrollbar color with theme
Browse files Browse the repository at this point in the history
  • Loading branch information
bluelovers committed Jul 7, 2024
1 parent 1da4907 commit 5a35329
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/ui_gradio_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def stylesheet(fn):
dark = resolve_var('background_fill_primary_dark')
head += f'<style>html {{ background-color: {light}; }} @media (prefers-color-scheme: dark) {{ html {{background-color: {dark}; }} }}</style>'

light_text = resolve_var('body_text_color')
dark_text = resolve_var('body_text_color_dark')
head += f'<style>html {{ --body-background-fill: {light}; --body-text-color: {light_text}; }} html:has(body.dark) {{ --body-background-fill: {dark}; --body-text-color: {dark_text}; }}</style>'

return head


Expand Down
10 changes: 10 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ div.gradio-image button[aria-label="Edit"] {

}


html {
scrollbar-color: var(--body-text-color) var(--body-background-fill)
}

body {
background: var(--body-background-fill);
color: var(--body-text-color);
}

.block.padded:not(.gradio-accordion) {
padding: 0 !important;
}
Expand Down

0 comments on commit 5a35329

Please sign in to comment.