Sun Valley ttk theme
Make your Tkinter application look better than ever with just two lines of code!
Installation 
The theme is easily installable as a Python package
pip install sv-ttk
Usage 
For detailed documentation, visit the wiki page.
import tkinter
from tkinter import ttk
import sv_ttk
root = tkinter.Tk()
button = ttk.Button(root, text="Click me!")
button.pack()
# This is where the magic happens
sv_ttk.set_theme("dark")
root.mainloop()
Tips and tricks
Our intention is to keep the sv-ttk package as simple as possible, while making it easy to integrate with other libraries.
Set the theme to the system theme
You can use the darkdetect package to detect the system color scheme. Here's an example:
import darkdetect
sv_ttk.set_theme(darkdetect.theme())
It's only a matter of an extra import and passing the result of darkdetect.theme() to sv_ttk.set_theme(). It's that easy!
Dark mode title bar on Windows
The Sun Valley theme doesn't change the title bar color on Windows when the theme is set to dark. You can use pywinstyles to achieve this. Here's an example:
import pywinstyles, sys
def apply_theme_to_titlebar(root):
version = sys.getwindowsversion()
if version.major == 10 and version.build >= 22000:
# Set the title bar color to the background color on Windows 11 for better appearance
pywinstyles.change_header_color(root, "#1c1c1c" if sv_ttk.get_theme() == "dark" else "#fafafa")
elif version.major == 10:
pywinstyles.apply_style(root, "dark" if sv_ttk.get_theme() == "dark" else "normal")
# A hacky way to update the title bar's color on Windows 10 (it doesn't update instantly like on Windows 11)
root.wm_attributes("-alpha", 0.99)
root.wm_attributes("-alpha", 1)
# Example usage (replace `root` with the reference to your main/Toplevel window)
apply_theme_to_titlebar(root)
Note that on Windows 10, due to its limitations, you can only set the title bar's color to black for dark mode and white for light mode. On Windows 11 the title bar can be set to any color.
Here's how the windows look after calling set_title_bar_color():
Screenshots
Windows 10
Windows 11
Wanna see more?
Check out my other ttk themes!
- The Azure ttk theme
- The Forest ttk theme
Metadata
Release files for sv-ttk 2.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sv_ttk-2.6.1.tar.gz | 49.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sv_ttk-2.6.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 99.7 kB
Release files / sv_ttk-2.6.1.tar.gz
| Download URL | sv_ttk-2.6.1.tar.gz |
|---|---|
| Size | 49.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47589d5e20398cf404e8362f24f3ed48f3830cd0ace056d83354fa25d8e4fe48
|
|
BLAKE2b-256 checksum How to use checksums |
4eca9625914e7a7e58ce9f0d8d6a5eb29975bab077ce58a36cf86f863d188cd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / sv_ttk-2.6.1-py3-none-any.whl
| Download URL | sv_ttk-2.6.1-py3-none-any.whl |
|---|---|
| Size | 50.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8ca5944f95431a911986b00c54e7f44608f3f811382cd985fd14bb3e65f95d97
|
|
BLAKE2b-256 checksum How to use checksums |
5b3632629d8bab9bccd54a36716a960ba1148fca4c1fd453370dba0b42d712ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Security for sv-ttk 2.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.