THEME GUIDE
Master sCSS to customize Snekbooru's appearance
THE sCSS STYLING SYSTEM
Snekbooru's appearance is controlled by sCSS, a powerful styling language that gives you deep control over the look and feel of the application. This guide will walk you through how to create your own themes.
CUSTOM FONTS
You can add your own fonts to use in custom themes. Place your font files (.ttf or .otf) into the following directory and restart the application:
After restarting, you can use the font's family name in your stylesheet:
GLOBAL STYLES & BASIC PROPERTIES
The * selector applies styles to all elements. sWidget targets the base style for all widgets unless overridden.
Common properties include: background-color, color, border, border-radius, padding, margin, font-size, font-family, font-weight, min-width, max-width, min-height, max-height, text-align.
sWIDGET TYPE SELECTORS
To style a specific type of widget, use its s-prefixed class name.
PSEUDO-STATES
Apply styles based on a widget's state:
:hover — Mouse cursor is over the widget:pressed — Widget is being clicked:disabled — Widget is inactive:checked — For checkable widgets:selected — For items in lists/tablesSUB-CONTROLS & PARTS
Many complex widgets are composed of sub-controls that can be styled individually using :: (double colon):
sTabWidget::pane — The content areasTabBar::tab — An individual tabsGroupBox::title — The title textsProgressBar::chunk — The filled portionsComboBox::drop-down — Dropdown arrowsScrollBar::handle — The draggable partSTYLING BY ID (objectName)
Elements have unique IDs (objectName in Qt) for highly specific styling, prefixed with #:
sWidget#main_windowMain window
sTabWidget#main_tabsMain tab widget
sWidget#home_tabHome tab
sWidget#browser_tabBrowser tab
sWidget#favorites_tabFavorites tab
sWidget#downloads_tabDownloads tab
sWidget#minigames_tabMinigames tab
sWidget#ai_tabAI tab
sFrame#video_frameVideo frame
sLabel#titleMain title
sLabel#app_logo_miniLogo
sLabel#total_posts_labelPosts counter
sPlainTextEdit#post_inspector_infoPost info
sTextBrowser#ai_chat_history_browserChat history
sPlainTextEdit#ai_chat_input_areaChat input
sGroupBox#danger_zoneDanger Zone
sPushButton#reset_buttonReset button
ADVANCED PROPERTIES
Gradients
Use qlineargradient or qradialgradient for backgrounds:
Images
Use url("path/to/image.png") for background images. Paths can be absolute or relative:
FINAL NOTES
- The sCSS system is powerful, but not all web CSS properties are available.
- Layout is primarily handled by the application's structure, not stylesheets.
- Experimentation is encouraged!