Unify font sizes through qs.Commons.Style

Themes now drive typography the same way they drive colors: one [font]
base-size in shell.toml is the rem root, and every Style.font.<token>
(caption, bodySmall, body, subtitle, title, heading, display,
displayLarge, iconSmall, icon, iconLarge) derives from it via a fixed
multiplier. Themes can also pin individual tokens for stylistic
emphasis. base-size is clamped 11..13 until row-height tokens exist.

Bar dimensions move to the same singleton: [bar] size-horizontal /
size-vertical replace the hardcoded 26/28 in Bar.qml, exposed as
Style.bar.sizeHorizontal / sizeVertical.

Style.qml also resolves the fontconfig 'monospace' alias via fc-match
and exposes Style.font.resolvedFamily so panels can display the
concrete family. Watches ~/.config/fontconfig/fonts.conf so it tracks
'omarchy font set <name>'.

The qs.Ui kit (PillButton, Dropdown, Toggle, TextField, etc.) and
every first-party plugin (bar widgets, settings, menu, clipboard,
emoji, polkit, notifications, osd, image-picker, dev-gallery) now
bind to Style.font.* instead of pixel literals. Only three deliberate
display-scale outliers remain: the notification empty-state glyph and
the weather flyout's hero temperature pair, all commented.

Background plugin's applyTheme IPC fast-path also pushes shell.toml to
Style so theme swaps update typography and bar size without waiting
for inotify debounce.

Dev gallery (omarchy dev ui-preview) now ships a Typography section
that renders the full scale and theme tokens live, and its summon
command is fixed (omarchy-shell-ipc -> omarchy-shell).
This commit is contained in:
Ryan Hughes
2026-05-18 11:33:19 -04:00
parent c26cf49f7d
commit 648bc54db1
41 changed files with 762 additions and 285 deletions
+20 -19
View File
@@ -4,6 +4,7 @@ import Quickshell
import Quickshell.Io
import Quickshell.Services.Pipewire
import qs.Ui
import qs.Commons
Item {
id: root
@@ -356,7 +357,7 @@ Item {
anchors.fill: parent
bar: root.bar
text: root.outputIcon()
fontSize: 12
fontSize: Style.font.body
onPressed: function(b) {
if (b === Qt.RightButton) root.toggleOutputMute()
else if (b === Qt.MiddleButton) root.bar.run("omarchy-launch-audio")
@@ -428,7 +429,7 @@ Item {
text: "Output"
foreground: root.bar.foreground
fontFamily: root.bar.fontFamily
fontSize: 11
fontSize: Style.font.bodySmall
anchors.verticalCenter: parent.verticalCenter
}
@@ -436,7 +437,7 @@ Item {
text: root.sink ? "· " + root.nodeLabel(root.sink) : ""
color: Qt.darker(root.bar.foreground, 1.8)
font.family: root.bar.fontFamily
font.pixelSize: 11
font.pixelSize: Style.font.bodySmall
elide: Text.ElideRight
width: parent.width - 70
anchors.verticalCenter: parent.verticalCenter
@@ -467,7 +468,7 @@ Item {
text: root.outputIcon()
color: root.bar.foreground
font.family: root.bar.fontFamily
font.pixelSize: 16
font.pixelSize: Style.font.heading
width: 22
horizontalAlignment: Text.AlignHCenter
anchors.verticalCenter: parent.verticalCenter
@@ -500,7 +501,7 @@ Item {
text: Math.round((outputSlider.dragging ? outputSlider.liveValue : root.outputVolume) * 100) + "%"
color: root.bar.foreground
font.family: root.bar.fontFamily
font.pixelSize: 11
font.pixelSize: Style.font.bodySmall
width: 36
horizontalAlignment: Text.AlignRight
anchors.verticalCenter: parent.verticalCenter
@@ -547,7 +548,7 @@ Item {
text: "Input"
foreground: root.bar.foreground
fontFamily: root.bar.fontFamily
fontSize: 11
fontSize: Style.font.bodySmall
anchors.verticalCenter: parent.verticalCenter
}
@@ -555,7 +556,7 @@ Item {
text: root.source ? "· " + root.nodeLabel(root.source) : ""
color: Qt.darker(root.bar.foreground, 1.8)
font.family: root.bar.fontFamily
font.pixelSize: 11
font.pixelSize: Style.font.bodySmall
elide: Text.ElideRight
width: parent.width - 56
anchors.verticalCenter: parent.verticalCenter
@@ -584,7 +585,7 @@ Item {
text: root.inputIcon()
color: root.bar.foreground
font.family: root.bar.fontFamily
font.pixelSize: 16
font.pixelSize: Style.font.heading
width: 22
horizontalAlignment: Text.AlignHCenter
anchors.verticalCenter: parent.verticalCenter
@@ -617,7 +618,7 @@ Item {
text: Math.round((inputSlider.dragging ? inputSlider.liveValue : root.inputVolume) * 100) + "%"
color: root.bar.foreground
font.family: root.bar.fontFamily
font.pixelSize: 11
font.pixelSize: Style.font.bodySmall
width: 36
horizontalAlignment: Text.AlignRight
anchors.verticalCenter: parent.verticalCenter
@@ -660,7 +661,7 @@ Item {
text: "Playing"
foreground: root.bar.foreground
fontFamily: root.bar.fontFamily
fontSize: 11
fontSize: Style.font.bodySmall
}
Repeater {
@@ -712,7 +713,7 @@ Item {
text: root.sinkGlyph(sinkRow.node)
color: root.bar.foreground
font.family: root.bar.fontFamily
font.pixelSize: 14
font.pixelSize: Style.font.title
width: 22
horizontalAlignment: Text.AlignHCenter
anchors.verticalCenter: parent.verticalCenter
@@ -722,7 +723,7 @@ Item {
text: root.nodeLabel(sinkRow.node)
color: root.bar.foreground
font.family: root.bar.fontFamily
font.pixelSize: 12
font.pixelSize: Style.font.body
elide: Text.ElideRight
width: parent.width - 22 - 14 - 16
anchors.verticalCenter: parent.verticalCenter
@@ -732,7 +733,7 @@ Item {
text: sinkRow.isActive ? "󰄬" : ""
color: root.bar.foreground
font.family: root.bar.fontFamily
font.pixelSize: 13
font.pixelSize: Style.font.subtitle
width: 14
horizontalAlignment: Text.AlignRight
anchors.verticalCenter: parent.verticalCenter
@@ -779,7 +780,7 @@ Item {
text: root.sourceGlyph(sourceRow.node)
color: root.bar.foreground
font.family: root.bar.fontFamily
font.pixelSize: 14
font.pixelSize: Style.font.title
width: 22
horizontalAlignment: Text.AlignHCenter
anchors.verticalCenter: parent.verticalCenter
@@ -789,7 +790,7 @@ Item {
text: root.nodeLabel(sourceRow.node)
color: root.bar.foreground
font.family: root.bar.fontFamily
font.pixelSize: 12
font.pixelSize: Style.font.body
elide: Text.ElideRight
width: parent.width - 22 - 14 - 16
anchors.verticalCenter: parent.verticalCenter
@@ -799,7 +800,7 @@ Item {
text: sourceRow.isActive ? "󰄬" : ""
color: root.bar.foreground
font.family: root.bar.fontFamily
font.pixelSize: 13
font.pixelSize: Style.font.subtitle
width: 14
horizontalAlignment: Text.AlignRight
anchors.verticalCenter: parent.verticalCenter
@@ -855,7 +856,7 @@ Item {
text: streamRow.streamMuted ? "󰝟" : "󰕾"
color: root.bar.foreground
font.family: root.bar.fontFamily
font.pixelSize: 12
font.pixelSize: Style.font.body
width: 14
horizontalAlignment: Text.AlignHCenter
anchors.verticalCenter: parent.verticalCenter
@@ -875,7 +876,7 @@ Item {
text: root.streamLabel(streamRow.node)
color: root.bar.foreground
font.family: root.bar.fontFamily
font.pixelSize: 11
font.pixelSize: Style.font.bodySmall
elide: Text.ElideRight
width: parent.width - streamMuteIcon.width - streamPct.width - 12
anchors.verticalCenter: parent.verticalCenter
@@ -886,7 +887,7 @@ Item {
text: Math.round(streamRow.streamVolume * 100) + "%"
color: Qt.darker(root.bar.foreground, 1.5)
font.family: root.bar.fontFamily
font.pixelSize: 11
font.pixelSize: Style.font.bodySmall
width: 36
horizontalAlignment: Text.AlignRight
anchors.verticalCenter: parent.verticalCenter