Styles

Styles are used to define various properties of styleable items in a CSS-like syntax.

Box model

Every styleable items item consists of different boxes, whereas each box includes the previous one. The size of a box is determined by the size required to include the previous one and a value for each side of the box: top, right, bottom, left (The values are ordered clockwise)

Here is a layout for better understanding:

                                     Top
     +-----------------------------------------------------------------+
     |                              Margin                             |
     |        +-----------------------------------------------+        |
     |        |                     Border                    |        |
     |        |        +-----------------------------+        |        |
     |        |        |           Padding           |        |        |
     |        |        |         +---------+         |        |        |
Left | Margin | Border | Padding | Content | Padding | Border | Margin | Right
     |        |        |         +---------+         |        |        |
     |        |        |           Padding           |        |        |
     |        |        +-----------------------------+        |        |
     |        |                    Border                     |        |
     |        +-----------------------------------------------+        |
     |                             Margin                              |
     +-----------------------------------------------------------------+
                                   Bottom

The various properties of a style have different meanings for each box:

Property Meaning
foreground Sets the foreground color of the content box
background Sets the background color of the content and the padding box
border Sets the background color of the border box (per side)

The margin box is always transparent.

Cascading

Like CSS syntax, styles in subtle support simple cascading. That means that properties set for All are inherited by other styleable items.

All

Defines properties for most of the styleable elements.

Supported properties: Foreground, Background, Margin, Border, Padding, Min_width, Icon

Example:

Numbers: on /off1 style :all do
2   padding     0, 0, 0, 0
3   border      "#303030", 0
4   foreground  "#fecf35" 
5   background  "#202020" 
6 end

2979

Substyles

Styles can contain nested styles, that inherit values from their parent. The default config uses this syntax to define styles for :focus, :occupied, :unoccupied and :urgent.

Sublets automatically check for a substyle matching to their name and otherwise fallback to the :sublets style.

Styleable items

Clients

Defines properties for active and inactive clients.

margin is the former :gap option

Supported properties: Margin, Active, Inactive, Width

Example:

Numbers: on /off1 style :clients do
2   active      "#303030", 2
3   inactive    "#202020", 2
4   margin      0
5   width       50
6 end

Separator

Defines properties for the panel separator.

Supported properties: Foreground, Background, Margin, Border, Padding, Min_width, Font, Separator

Inherits from: All

Example:

Numbers: on /off1 style :separator do
2   padding     0, 0, 0, 0
3   border      0
4   background  "#202020" 
5   foreground  "#757575" 
6 end

Sublets

Defines properties for sublets in the panel.

Supported properties: Foreground, Background, Margin, Border, Padding, Min_width, Font

Inherits from: All

Example:

Numbers: on /off1 style :sublets do
2   padding     0, 0, 0, 0
3   border      "#303030", 0
4   foreground  "#757575" 
5   background  "#202020" 
6 end

3097

Separator

Defines properties for the sublet separator.

Supported properties: Foreground, Background, Margin, Border, Padding, Min_width, Font, Separator

Inherits from: Sublets

Example:

Numbers: on /off1 style :separator do
2   padding     0, 0, 0, 0
3   border      0
4   background  "#202020" 
5   foreground  "#757575" 
6 end

Subtle

Defines properties for subtle.

padding is the former :strut option

Supported properties: Background, Padding, Panel, Stipple

Example:

Numbers: on /off1 style :subtle do
2   panel       "#202020" 
3   background  "#3d3d3d" 
4   stipple     "#757575" 
5 end

Title

Defines properties for the title of current client.

Supported properties: Foreground, Background, Margin, Border, Padding, Min_width, Font

Inherits from: All

Example:

Numbers: on /off1 style :title do
2   padding     0, 0, 0, 0
3   border      "#303030", 0
4   foreground  "#fecf35" 
5   background  "#202020" 
6 end

Views

Defines properties for view-related styleable elements.

Supported properties: Foreground, Background, Margin, Border, Padding, Min_width, Icon, Font

Inherits from: All

Example:

Numbers: on /off1 style :views do
2   background  "#202020" 
3 end

Focus

Defines properties for current active view.

Supported properties: Foreground, Background, Margin, Border, Padding, Min_width, Icon, Font

Inherits from: Views

Example:

Numbers: on /off1 style :focus do
2   padding     0, 0, 0, 0
3   border      "#303030", 0
4   foreground  "#fecf35" 
5   background  "#202020" 
6 end

Occupied

Defines properties for views with at least one client.

Supported properties: Foreground, Background, Margin, Border, Padding, Min_width, Icon, Font

Inherits from: Views

Example:

Numbers: on /off1 style :occupied do
2   padding     0, 0, 0, 0
3   border      "#303030", 0
4   foreground  "#b8b8b8" 
5   background  "#202020" 
6 end

Urgent

Defines properties for views with urgent clients.

Supported properties: Foreground, Background, Margin, Border, Padding, Min_width, Icon, Font

Inherits from:

This style doesn't inherit values and is used additionally to other view styles like occupied.

Example:

Numbers: on /off1 style :urgent do
2   padding     0, 0, 0, 0
3   border      "#303030", 0
4   foreground  "#ff9800" 
5   background  "#202020" 
6 end

3023

Visible

Defines properties for views that are visible on any screen.

Supported properties: Foreground, Background, Margin, Border, Padding, Min_width, Icon, Font

Inherits from:

This style doesn't inherit values and is used additionally to other view styles like occupied.

Example:

Numbers: on /off1 style :visible do
2   border-top "#303030", 2
3 end

3097

Separator

Defines properties for the views separator.

Supported properties: Foreground, Background, Margin, Border, Padding, Min_width, Font, Separator

Inherits from: Views

Example:

Numbers: on /off1 style :separator do
2   padding     0, 0, 0, 0
3   border      0
4   background  "#202020" 
5   foreground  "#757575" 
6 end

Properties

Following properties can be set for supported items:

Foreground

This property sets the foreground/text color.

Applicable to: All, Title, Focus, Urgent, Occupied, Views, Sublets, Separator, Visible

Example:

Numbers: on /off1 style :title do
2   foreground "#fecf35" 
3 end

Background

This property sets the background color.

Applicable to: All, Title, Focus, Urgent, Occupied, Views, Sublets, Separator, Visible

Example:

Numbers: on /off1 style :title do
2   background "#202020" 
3 end

3066

Font

This property sets the font and expects a string. The font string can either be from xfontsel or a valid XFT font description.

Applicable to: All, Title, Focus, Urgent, Occupied, Views, Sublets, Separator, Visible

Example:

Numbers: on /off1 style :all do
2   font  "-*-*-*-*-*-*-14-*-*-*-*-*-*-*" 
3   #font "xft:sans-8" 
4 end

Margin

This property sets a transparent (no background) outer spacing in given directions. Following notations are supported:

1 margin 2 Set space for all four directions
1 margin 2, 2 Set space for top/bottom and left/right
1 margin 2, 2, 2 Set space for top, left/right and bottom (top, right, bottom, left)
1 margin 2, 2, 2, 2 Set space for all four directions
1 margin_top 2 Set space for top side
1 margin_right 2 Set space for right side
1 margin_bottom 2 Set space for bottom side
1 margin_left 2 Set space for left side

Applicable to: All, Title, Focus, Urgent, Occupied, Views, Sublets, Separator, Visible

Example:

Numbers: on /off 1 style :title do
 2   margin 2
 3 end
 4 
 5 style :title do
 6   margin 2, 2
 7 end
 8 
 9 style :title do
10   margin_top 2
11 end

Border

This property sets the border color and size. Following notations are supported:

1 border "#303030", 0 Set border color and size of all four borders
1 border_top "#303030", 0 Set border color and size of top border
1 border_right "#303030", 0 Set border color and size of right border
1 border_bottom "#303030", 0 Set border color and size of bottom border
1 border_left "#303030", 0 Set border color and size of left border

Applicable to: All, Title, Focus, Urgent, Occupied, Views, Sublets, Separator, Visible

Example:

Numbers: on /off1 style :title do
2   border "#303030", 0
3 end
4 
5 style :title do
6   border_top    "#303030", 0
7 end

Padding

This property sets an inner spacing between border and content in given directions. Following notations are supported:

1 padding 2 Set space for all four directions
1 padding 2, 2 Set space for top/bottom and left/right
1 padding 2, 2, 2 Set space for top, left/right and bottom (top, right, bottom, left)
1 padding 2, 2, 2, 2 Set space for all four directions
1 padding_top 2 Set space for top side
1 padding_right 2 Set space for right side
1 padding_bottom 2 Set space for bottom side
1 padding_left 2 Set space for left side

Applicable to: All, Title, Focus, Urgent, Occupied, Views, Sublets, Separator, Visible, Subtle

Example:

Numbers: on /off 1 style :title do
 2   padding 2
 3 end
 4 
 5 style :title do
 6   padding 2, 2
 7 end
 8 
 9 style :title do
10   padding_top 2
11 end

Active

This property sets the border color and size of the current active client.

Applicable to: Clients

Example:

Numbers: on /off1 style :clients do
2   active "#303030", 2
3 end

r2979

Icon

This property sets the color of any icons in this panel item.

Applicable to: All, Focus, Urgent, Occupied, Views, Sublets, Visible

Example:

Numbers: on /off1 style :views do
2   icon "#303030" 
3 end

Inactive

This property sets the border color and size of all other clients.

The border size of inactive clients is ignored because different sizes would require many size and position changes everytime the focus moves.

Applicable to: Clients

Example:

Numbers: on /off1 style :clients do
2   inactive "#202020", 2
3 end

Panel

This property sets the panel color. Following notations are supported:

1 panel "#000000" Set color of both panels
1 panel_top "#000000" Set color of top panel
1 panel_bottom "#000000" Set color of bottom panel

Applicable to: Subtle

Example:

1 style :subtle do
2   panel "#202020" 
3 end
4 
5 style :subtle do
6   panel_top    "#202020" 
7   panel_bottom "#202020" 
8 end

3097

Separator

This property sets the separator string.

Applicable to: Separator

Example:

Numbers: on /off1 style :separator do
2   separator "|" 
3 end

Stipple

This property sets the color of the panel stippling if any.

Applicable to: Subtle

Example:

Numbers: on /off1 style :subtle do
2   stipple "#757575" 
3 end

Width

This property sets the string length in character, default is 50 characters.

Applicable to: Clients

Example:

Numbers: on /off1 style :clients do
2   width 50
3 end

Min_width

This property sets the min. pixel width of a panel item.

Applicable to: All, Title, Focus, Urgent, Occupied, Views, Sublets, Separator, Visible

Example:

Numbers: on /off1 style :title do
2   min_width 50
3 end