<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.spiretrading.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jon</id>
	<title>Spire Trading Inc. - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.spiretrading.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jon"/>
	<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php/Special:Contributions/Jon"/>
	<updated>2026-05-04T13:26:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Model&amp;diff=234</id>
		<title>Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Model&amp;diff=234"/>
		<updated>2025-04-23T19:29:56Z</updated>

		<summary type="html">&lt;p&gt;Jon: fix: remove duplicate 'event' in 'Input Event' link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;User interfaces are composed of reusable semantic elements called components. Each component is specified by a set of documents: &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;user_flow.drawio&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;use_cases.drawio&amp;lt;/code&amp;gt;. This page covers the &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; provides the complete description of the data the component operates on and displays, the state of the component, and the signals it produces. Any component with new behavior requires &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;. Components that simply customize the properties of existing components omit &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; as there is nothing to describe that is not already defined in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;data-and-behavior&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Data and Behavior ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; is necessary when the component being defined has specific data that it displays or manipulates or introduces novel behavior not found elsewhere in the UI Kit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-accountlistitem&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: AccountListItem ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  identicon: A unique icon identifier for the account.&lt;br /&gt;
  id: A unique username for the account.&lt;br /&gt;
  name: The full name associated with the account.&amp;lt;/pre&amp;gt;&lt;br /&gt;
The model for &amp;lt;code&amp;gt;AccountListItem&amp;lt;/code&amp;gt; is very simple and deals only with data. There is no special behavior associated with &amp;lt;code&amp;gt;AccountListItem&amp;lt;/code&amp;gt;: it behaves no differently than any other &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; that has been defined elsewhere. &amp;lt;code&amp;gt;AccountListItem&amp;lt;/code&amp;gt; takes a structured set of data:&lt;br /&gt;
* &amp;lt;code&amp;gt;identicon&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using a specific &amp;lt;code&amp;gt;AccountListItem&amp;lt;/code&amp;gt; for displaying user accounts in this way keeps components contained and simple.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-button&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: Button ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  body: The component to display inside of the button.&lt;br /&gt;
&lt;br /&gt;
State:  &lt;br /&gt;
  press: Whether the button is currently pressed.&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
  Click: Indicates that the button was clicked.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;Button&amp;lt;/code&amp;gt; is a more generic component. From &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt;, we see that it can be used to display any component, so there is no specific data associated with it. What distinguishes &amp;lt;code&amp;gt;Button&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;Component&amp;lt;/code&amp;gt; is its behavior: &lt;br /&gt;
* &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; is a new '''State''' that &amp;lt;code&amp;gt;Button&amp;lt;/code&amp;gt; can be in.&lt;br /&gt;
* &amp;lt;code&amp;gt;Click&amp;lt;/code&amp;gt; is a new '''Signal''' that &amp;lt;code&amp;gt;Button&amp;lt;/code&amp;gt; can send.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;getting-started&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; is written after &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt;. Clarifying in writing what data the component uses greatly simplifies the making of &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;use_cases.drawio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;user_flow.drawio&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Most expected behavior is specified in &amp;lt;code&amp;gt;Component&amp;lt;/code&amp;gt;, the base component for all UI components. Any property or signal found in &amp;lt;code&amp;gt;Component&amp;lt;/code&amp;gt; can be used by any component without repeating them in the model. This makes the model for most components sparse and keeps the focus on their ''unique'' data and behavior.&lt;br /&gt;
&lt;br /&gt;
Components are built using composition: complexity is built up from simple elements that manage a small set of responsibilities. These smaller elements are the &amp;lt;code&amp;gt;children&amp;lt;/code&amp;gt; and when we consider the model for a component it is helpful to think about what responsibilities are handled by its children rather than being its concern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-dropdownbox&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: DropDownBox ===&lt;br /&gt;
&lt;br /&gt;
[[File:drop_down_box_preview.png|640px|Preview of a drop down box in open and closed states]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DropDownBox&amp;lt;/code&amp;gt; lets the user select a single value from a list of options and submit that value. It has a child &amp;lt;code&amp;gt;DropDownList&amp;lt;/code&amp;gt;: the list of options and whether the list is open or closed can be thought of as properties of &amp;lt;code&amp;gt;DropDownList&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To describe &amp;lt;code&amp;gt;DropDownBox&amp;lt;/code&amp;gt;, we need to understand a little more of its behavior:&lt;br /&gt;
* It represents a single value that the user can select.&lt;br /&gt;
* Selecting a value is different from submitting a value. The user can select a value without submitting it.&lt;br /&gt;
* The user can revert a selection to what was last submitted (by pressing the Escape key).&lt;br /&gt;
* Focusing out of the &amp;lt;code&amp;gt;DropDownBox&amp;lt;/code&amp;gt; is treated as a submission when the selected value has changed from the last submitted value.&lt;br /&gt;
* It can be set to be read only.&lt;br /&gt;
&lt;br /&gt;
Based on its behavior, we need a few properties:&lt;br /&gt;
* A property to track the selected value&lt;br /&gt;
* A property to track the last submitted value&lt;br /&gt;
* A property to indicate if it is read only&lt;br /&gt;
&lt;br /&gt;
Other components will need to be notified when the user has made a submission so they can respond to changes. We can add one more requirement:&lt;br /&gt;
* A signal to indicate a submission&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  read_only: Whether the value is modifiable by the user.&lt;br /&gt;
  current: The item currently represented by the DropDownBox.&lt;br /&gt;
&lt;br /&gt;
State:&lt;br /&gt;
  submission: The last value submitted by the user.&lt;br /&gt;
  modified: Whether current has been modified since last Submit.&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
  Submit: Indicates the user is submitting current.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Reviewing the &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;, we see the following:&lt;br /&gt;
* &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; to track the selected value&lt;br /&gt;
* &amp;lt;code&amp;gt;submission&amp;lt;/code&amp;gt; to track the last submitted value&lt;br /&gt;
* &amp;lt;code&amp;gt;read_only&amp;lt;/code&amp;gt; to indicate if it is read only&lt;br /&gt;
* &amp;lt;code&amp;gt;modified&amp;lt;/code&amp;gt; to track whether &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; changed from &amp;lt;code&amp;gt;submission&amp;lt;/code&amp;gt; (not strictly necessary)&lt;br /&gt;
* &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt;, a signal to indicate a submission&lt;br /&gt;
&lt;br /&gt;
We note that &amp;lt;code&amp;gt;read_only&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; have been placed in &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt;, while &amp;lt;code&amp;gt;submission&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;modified&amp;lt;/code&amp;gt; are in &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt;. This means that external components can modify &amp;lt;code&amp;gt;read_only&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt;, while &amp;lt;code&amp;gt;DropDownBox&amp;lt;/code&amp;gt; manages &amp;lt;code&amp;gt;submission&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;modified&amp;lt;/code&amp;gt; itself. &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; is placed in &amp;lt;code&amp;gt;Signals&amp;lt;/code&amp;gt;. Properties are named using '''snake_case''' while signals use '''PascalCase'''.&lt;br /&gt;
&lt;br /&gt;
It may be useful for external components to respond to changes in &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;submission&amp;lt;/code&amp;gt;, such as showing a preview based on the current selection, but a &amp;lt;code&amp;gt;Current&amp;lt;/code&amp;gt; signal is not necessary for this. Because properties in &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; are read-write for external components, components can subscribe to property changes directly without requiring a signal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;anatomy&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Anatomy ==&lt;br /&gt;
&lt;br /&gt;
The structure of &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; is a linear document divided into preset sections. These sections are as follows:&lt;br /&gt;
* Definitions&lt;br /&gt;
* Styles&lt;br /&gt;
* Selectors&lt;br /&gt;
* Pseudo-Elements&lt;br /&gt;
* Data&lt;br /&gt;
* State&lt;br /&gt;
* Signals&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Definitions&amp;lt;/code&amp;gt; serve as an optional index for terms used throughout the model. &amp;lt;code&amp;gt;Selectors&amp;lt;/code&amp;gt; are used in older specs but should be avoided for simplicity. &amp;lt;code&amp;gt;Pseudo-Elements&amp;lt;/code&amp;gt; define sub-sections of the component and make them available for styling. The remaining sections &amp;lt;code&amp;gt;Styles&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;Signals&amp;lt;/code&amp;gt; can be conceptualized as relating to the interface as shown: &lt;br /&gt;
&lt;br /&gt;
[[File: Model_Component_anatomy.png | 640px | Diagram of a component with Data, Styles, State and Signals shown as wires between and within the boundary]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; flows through the interface, depending on the component, both external resources and the user may be able to modify &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; properties.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Styles&amp;lt;/code&amp;gt; can be set by external components to change the appearance of the component. Generally, the user doesn’t directly modify the style of a component, so these can be thought of as one-way.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; is managed internally by the component. It can be influenced by user interactions, by &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt;, or any combination of properties, but it remains encapsulated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Signals&amp;lt;/code&amp;gt; are messages sent out by the component. They inform other components about changes that are useful to know about resulting from a user action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;breakdown&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Breakdown ===&lt;br /&gt;
&lt;br /&gt;
Within each section is a list of properties followed by their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Section Heading:&lt;br /&gt;
  property_name: Property description. Optional default.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Property names should balance brevity with self-description. Leaning on familiar and established terminology is preferred over introducing new terms with the same meaning.&lt;br /&gt;
&lt;br /&gt;
Descriptions should be precise, concise, and readable, expressing in plain language the meaning of the property. If a property can only be one of a finite set of values, the possible values are enumerated directly in the definition by nesting them below the property name and definition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Section Heading:&lt;br /&gt;
  property_name: Property description.&lt;br /&gt;
    POSSIBLE_VALUE_1: Value description for 1. Default.&lt;br /&gt;
    POSSIBLE_VALUE_2: Value description for 2.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Values are distinguished using UPPERCASE.&lt;br /&gt;
&lt;br /&gt;
Properties can consist of sub-properties, such as list or tabular data, or properties consisting of multiple orthogonal components such as the &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; components of a position. Sub-properties are nested beneath properties.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Section Heading:&lt;br /&gt;
  property_name: Property description. Optional default.&lt;br /&gt;
    sub_property_name: Sub property description. Optional default.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Descriptions can include inline expressions provided they are trivial. With expressions, it is understood that they represent a ''binding'': they update automatically without requiring a sub-flow in &amp;lt;code&amp;gt;user_flow.drawio&amp;lt;/code&amp;gt;. When an expression is used, it is placed on its own line below the last sentence for the description. The equality is implied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Section Heading:&lt;br /&gt;
  property_name_1: Property description. Optional default.&lt;br /&gt;
  property_name_2: Property description.&lt;br /&gt;
                   property_name_1 + 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-component&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: Component ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Styles:&lt;br /&gt;
  visibility: Shows or hides the component.&lt;br /&gt;
    VISIBLE: The component is visible, (default).&lt;br /&gt;
    INVISIBLE: The component is invisible.&lt;br /&gt;
    NONE: The component is both invisible and removed from the layout.&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the above excerpt from &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Component&amp;lt;/code&amp;gt;, the &amp;lt;code&amp;gt;visibility&amp;lt;/code&amp;gt; property is defined within the &amp;lt;code&amp;gt;Styles&amp;lt;/code&amp;gt; section. &amp;lt;code&amp;gt;visibility&amp;lt;/code&amp;gt; can be one of three values:&lt;br /&gt;
* &amp;lt;code&amp;gt;VISIBLE&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;INVISIBLE&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;NONE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each possible value is named and defined directly below the definition for &amp;lt;code&amp;gt;visibility&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  parent: The parent of this component, for top-level components this is NULL.&lt;br /&gt;
  window: The window that this component belongs to.&lt;br /&gt;
  children: The list of this component's children.&lt;br /&gt;
  width: The width of the component in pixels.&lt;br /&gt;
  height: The height of the component in pixels.&lt;br /&gt;
  position: The position of the component relative to its parent, if the&lt;br /&gt;
            component has no parent, then the position is equal to&lt;br /&gt;
            screen_position.&lt;br /&gt;
    x - The x-coordinate in pixels.&lt;br /&gt;
    y - The y-coordinate in pixels.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Continuing to the &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; section, the &amp;lt;code&amp;gt;position&amp;lt;/code&amp;gt; property is a composite of two independent values: &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;. These properties can be referenced in other documentation with dot notation as &amp;lt;code&amp;gt;position.x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;position.y&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-saleconditionbox&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: SaleConditionBox ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;State:&lt;br /&gt;
  conditions_list: A list of all conditions.&lt;br /&gt;
    code: The identifier for the condition.&lt;br /&gt;
    name: The name for the condition.&lt;br /&gt;
    terms: The list of words from the name for the condition.&lt;br /&gt;
           name.split(' ')&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;conditions_list&amp;lt;/code&amp;gt; is a list of items, where each item has the fields specified. Visually it can be shown as tabular data. Below is what some of this data might look like: &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
  ! code!! name!! terms&lt;br /&gt;
|-&lt;br /&gt;
  | @ || Regular Settlement || Regular, Settlement &lt;br /&gt;
|-&lt;br /&gt;
  | C || Cash Settlement || Cash, Settlement &lt;br /&gt;
|- &lt;br /&gt;
  | N || Next Day Settlement || Next, Day, Settlement &lt;br /&gt;
|-&lt;br /&gt;
  | R || Seller Settlement || Seller, Settlement &lt;br /&gt;
|-&lt;br /&gt;
  | F || Intermarket Sweep || Intermarket, Sweep &lt;br /&gt;
|- &lt;br /&gt;
  | O || Opening Print || Opening, Print &lt;br /&gt;
|-&lt;br /&gt;
  | 4 || Derivative Priced || Derivative, Priced &lt;br /&gt;
|-&lt;br /&gt;
  | 5 || Re-Opening Print || Re-Opening, Print &lt;br /&gt;
|- &lt;br /&gt;
  | 6 || Closing Print || Closing, Print&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;terms&amp;lt;/code&amp;gt; is clearly derived from &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, the result of the inline expression. If the expression is non-trivial or not unconditionally true, then it does not belong in &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;. If you are unsure if an expression improves the clarity of the model, leave it out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-inputbox&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: InputBox ===&lt;br /&gt;
&lt;br /&gt;
Boolean (true or false) properties have implied values.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  read_only: Whether the InputBox is in read_only mode.&lt;br /&gt;
  rejected: Whether the last submission was rejected.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;InputBox&amp;lt;/code&amp;gt; has two boolean properties: &amp;lt;code&amp;gt;read_only&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rejected&amp;lt;/code&amp;gt;. Each may be &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, which is implied from their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;definitions&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Definitions ==&lt;br /&gt;
&lt;br /&gt;
This section is optional. It provides definitions for terms used throughout the model to improve clarity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-timeandsaleswindow&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: TimeAndSalesWindow ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Definitions:&lt;br /&gt;
  TimeAndSale: A trade on a security.&lt;br /&gt;
    timestamp: The time of the trade.&lt;br /&gt;
    price: The price of the trade.&lt;br /&gt;
    size: The number of shares traded.&lt;br /&gt;
    condition: A code that indicates the conditions of the trade.&lt;br /&gt;
    market_center: The market that facilitated the trade.&lt;br /&gt;
    bbo_indicator: An indicator that relates the price to the bbo.&lt;br /&gt;
      BBO_UNKNOWN: The bbo is unknown.&lt;br /&gt;
      ABOVE_ASK: The price is above the ask.&lt;br /&gt;
      AT_ASK: The price is equal to the ask.&lt;br /&gt;
      INSIDE: The price is between the bid and the ask.&lt;br /&gt;
      AT_BID: The price is equal to the bid.&lt;br /&gt;
      BELOW_BID: The price is below the bid.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;Definitions&amp;lt;/code&amp;gt; is used to define a &amp;lt;code&amp;gt;TimeAndSale&amp;lt;/code&amp;gt;. Each &amp;lt;code&amp;gt;TimeAndSale&amp;lt;/code&amp;gt; has a set of properties associated with it: &lt;br /&gt;
* &amp;lt;code&amp;gt;timestamp&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;price&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;condition&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;market_center&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;bbo_indicator&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TimeAndSale&amp;lt;/code&amp;gt; can be referenced elsewhere in the model.&lt;br /&gt;
&lt;br /&gt;
It is at the designer’s discretion whether to include a &amp;lt;code&amp;gt;Definitions&amp;lt;/code&amp;gt; section or to provide the description inline where the term is used. The following heuristics are helpful in determining whether to place a definition in a &amp;lt;code&amp;gt;Definitions&amp;lt;/code&amp;gt; section:&lt;br /&gt;
* The term is referenced by multiple properties throughout the model&lt;br /&gt;
* The definition is long or contains multiple levels of nesting which would impede the readability if included directly in the normal flow of the document &lt;br /&gt;
&lt;br /&gt;
When unsure, err on the side of putting the description inline rather than including a Definitions section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;styles&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Styles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Styles&amp;lt;/code&amp;gt; is for defining any style properties available on the component. Style properties affect the visual appearance of a component but do not directly relate to the data it displays. Style properties can be inputs that are provided externally to the component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-box&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: Box ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Styles:&lt;br /&gt;
  background_color: The background color. #FFFFFF by default.&lt;br /&gt;
  border_top_size: The height of the top border.&lt;br /&gt;
  border_right_size: The width of the right border.&lt;br /&gt;
  border_bottom_size: The height of the bottom border.&lt;br /&gt;
  border_left_size: The width of the left border.&lt;br /&gt;
  ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; defines a number of style properties for customizing its color, border, and padding. External components using &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; can make use of any of these properties as needed.&lt;br /&gt;
&lt;br /&gt;
No matter how deep in the component hierarchy a &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; is nested as a child, the component can access the properties for that &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; and make customizations. This avoids creating redundant properties to enable customization.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-timeandsale&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: TimeAndSale ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Styles:&lt;br /&gt;
  font: The font used to render the text in the cells. &lt;br /&gt;
        Default 10px Roboto 500.&lt;br /&gt;
  bbo_unknown: The bbo is unknown.&lt;br /&gt;
    background_color: Default #FFFFFF.&lt;br /&gt;
    text_color: Default #000000.&lt;br /&gt;
  above_ask: The price is above the ask.&lt;br /&gt;
    background_color: Default #D2F6E0.&lt;br /&gt;
    text_color: Default #007735.&lt;br /&gt;
  at_ask: The price is equal to the ask.&lt;br /&gt;
    background_color: Default #D2F6E0.&lt;br /&gt;
    text_color: Default #007735.&lt;br /&gt;
  inside: The price is between the bid and the ask.&lt;br /&gt;
    background_color: Default #FFFFFF.&lt;br /&gt;
    text_color: Default #000000.&lt;br /&gt;
  at_bid: The price is equal to the bid.&lt;br /&gt;
    background_color: Default #FAD8D9.&lt;br /&gt;
    text_color: Default #B71C1C.&lt;br /&gt;
  below_bid: The price is below the bid.&lt;br /&gt;
    background_color: Default #FAD8D9.&lt;br /&gt;
    text_color: Default #B71C1C.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;TimeAndSale&amp;lt;/code&amp;gt; defines a number of style properties specific to its function. &amp;lt;code&amp;gt;font&amp;lt;/code&amp;gt; is defined in &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt; and ordinarily does not need to be redefined: here it is done for convenience so that all the children of &amp;lt;code&amp;gt;TimeAndSale&amp;lt;/code&amp;gt; are styled with the same font without having to make separate declarations for each child. The remaining properties relate to &amp;lt;code&amp;gt;TimeAndSale&amp;lt;/code&amp;gt;: they depend on a comparison between the price of the &amp;lt;code&amp;gt;TimeAndSale&amp;lt;/code&amp;gt; to the bid and ask prices.&lt;br /&gt;
&lt;br /&gt;
Note that each comparative style (&amp;lt;code&amp;gt;bbo_unknown&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;above_ask&amp;lt;/code&amp;gt;, etc.) is a composite style of &amp;lt;code&amp;gt;background_color&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;text_color&amp;lt;/code&amp;gt;: coordinating separate styles into a set of presets is a common use case for &amp;lt;code&amp;gt;Styles&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The basic styles are all available in &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt;. Components should only define styles that are sensible to their function. Styles are not restricted to the properties and selectors of CSS or other languages, they are defined within &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; to suit the specific needs of the component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;selectors&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
Selectors may be deprecated. They were used to bundle &amp;lt;code&amp;gt;Styles&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; in an opt-in manner. It is recommended to use &amp;lt;code&amp;gt;Styles&amp;lt;/code&amp;gt; in combination with &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; for any properties that can be used to style the component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;pseudo-elements&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Pseudo-Elements ==&lt;br /&gt;
&lt;br /&gt;
Pseudo-elements are a way to give full styling properties to portions of a component that are not components themselves. They are used infrequently but can be useful for fundamental components that consist of semantic portions that are not components. Consider the following usage in TextBox:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Pseudo-elements:&lt;br /&gt;
  placeholder: Styles the placeholder sub-component.&amp;lt;/pre&amp;gt;&lt;br /&gt;
This enables the placeholder to be styled using the same properties as for TextBox, even though it is not itself a component. Text is the most obvious use case for pseudo-elements, as it can be broken up semantically into granular parts. See [https://web.dev/learn/css/pseudo-elements/ Pseudo-Elements on Web.dev] and [https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Pseudo-classes_and_pseudo-elements#what_is_a_pseudo-element Pseudo-Elements on MDN] for more detail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;data&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Data ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; is for properties that do not deal directly with styling and are provided externally. Properties in &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; are read-write to external components and may be modifiable by the user (such as the value of an input field).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; properties are not fixed, they can be updated from an external source at any time. It is common to have &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; properties that represent a stream, such as quotes from an exchange, which update as soon as they change without requiring a user-initiated update request. Anytime a property in &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; is changed, the change is immediately reflected in the component. It is sufficient to declare where the value resides in the component and it will always reflect the latest value.&lt;br /&gt;
&lt;br /&gt;
A default value is often declared. Where the data comes from is not specified (e.g. from a backend or a local file), that should be determined by the type of data and the application architecture.&lt;br /&gt;
&lt;br /&gt;
The following heuristic may be useful in determining whether property values belong in &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt;. It belongs in &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; if: &lt;br /&gt;
* The value can be modified by the user through interaction with the component&lt;br /&gt;
* The value is read from an external source requiring real-time updates&lt;br /&gt;
* There are obvious use-cases where external components will need to read or write to the value&lt;br /&gt;
&lt;br /&gt;
Otherwise, put the value in &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-textbox&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: TextBox ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  current: The text currently represented by the TextBox.&lt;br /&gt;
  cursor_position: The current cursor position. When 0, the cursor is at the&lt;br /&gt;
                   start of the TextBox.&lt;br /&gt;
  selection_start: The index position of the character in current at&lt;br /&gt;
                   the start of selection.&lt;br /&gt;
  selection_end: The index position of the character in current at the&lt;br /&gt;
                 end of selection. When selection_end &amp;amp;lt; selection_start,&lt;br /&gt;
                 the direction of selection is opposite of reading order.&lt;br /&gt;
  read_only: Whether the text is modifiable by the user.&lt;br /&gt;
  placeholder: The text to be displayed when current is empty.&lt;br /&gt;
  max_length: The maximum number of characters to accept.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt; has a number of bi-directional properties: &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;cursor_position&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;selection_start&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;selection_end&amp;lt;/code&amp;gt; are all typically driven by user actions, but they can also be set by external components or when the component is customized, such as setting an initial &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; value to display. There are also properties that are not modifiable by the user: &amp;lt;code&amp;gt;read_only&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;placeholder&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;max_length&amp;lt;/code&amp;gt;. However, it is possible for external components to modify these, so a component could be made that let the user change these properties.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;standard-property-names&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Standard Property Names ===&lt;br /&gt;
&lt;br /&gt;
Properties are directly defined in the &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; and may be anything the designer can define. That said, there are commonly recurring properties that have come to form an implicit convention and it is preferable to use consistent names and descriptions when the intended behavior is the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;current&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Current ====&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt; example, the text is named &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; and not &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. This is intentional: &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; is a standard property name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-decimalbox&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===== Example: DecimalBox =====&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;DecimalBox&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; refers to a number rather than a text string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  current: The current number represented by the DecimalBox.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-datebox&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===== Example: DateBox =====&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;DateBox&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; refers to a date value, not a number or text string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  current: The current date represented by the DateBox, in ISO format&lt;br /&gt;
           (YYYY-MM-DD).&amp;lt;/pre&amp;gt;&lt;br /&gt;
By convention, &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; refers to the current value of the component. The type of the value is generally defined by what the component displays.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-scalarfilterpanel&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===== Example: ScalarFilterPanel =====&lt;br /&gt;
&lt;br /&gt;
If there is no logical single current value for the component, it should not have &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  min: If set defines the minimum value to include.&lt;br /&gt;
  default_min: The default min value.&lt;br /&gt;
  max: If set defines the maximum value to include.&lt;br /&gt;
  default_max: The default max value.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;ScalarFilterPanel&amp;lt;/code&amp;gt; has two &amp;lt;code&amp;gt;DecimalBox&amp;lt;/code&amp;gt;, one aliased as &amp;lt;code&amp;gt;MinValue&amp;lt;/code&amp;gt; and another aliased as &amp;lt;code&amp;gt;MaxValue&amp;lt;/code&amp;gt;, and has access to &amp;lt;code&amp;gt;MinValue.current&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;MaxValue.current&amp;lt;/code&amp;gt;. It does not have a &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; as it does not represent a single value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-tablebody&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===== Example: TableBody =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; can be made more specific where appropriate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  rows: A list of table_rows each having an equal number of columns, used to&lt;br /&gt;
        populate the body.&lt;br /&gt;
  row_selection_mode: The selection mode used by rows (NONE by default).&lt;br /&gt;
  row_selection: Stores the list of selected rows.&lt;br /&gt;
  column_selection_mode: The selection mode used by columns (NONE by default).&lt;br /&gt;
  column_selection: Stores the list of selected columns.&lt;br /&gt;
  cell_selection: Stores the list of selected cells, indexed by row and column.&lt;br /&gt;
  cell_selection_mode: The selection mode used by cells (NONE by default).&lt;br /&gt;
  current_cell: The currently selected cell (null by default). The current cell&lt;br /&gt;
           can be used to implicitly specify a current row and current column&lt;br /&gt;
           if such functionality is desirable, for example the current cell's&lt;br /&gt;
           row is implicitly the current row.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;TableBody&amp;lt;/code&amp;gt; has a &amp;lt;code&amp;gt;current_cell&amp;lt;/code&amp;gt; property but no &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; property. Because &amp;lt;code&amp;gt;TableBody&amp;lt;/code&amp;gt; can only have one cell as current, it makes sense that this is a property of &amp;lt;code&amp;gt;TableBody&amp;lt;/code&amp;gt; and not of any of its children. However, &amp;lt;code&amp;gt;TableBody&amp;lt;/code&amp;gt; does not represent a single cell, so &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; without added specificity could cause confusion.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-listview&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===== Example: ListView =====&lt;br /&gt;
&lt;br /&gt;
Do not use current for lists of data: &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; refers to one value that varies in time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  current: The view's current value, can be null.&lt;br /&gt;
  selected: The value of the selected list item.&lt;br /&gt;
  items: A list of items used to populate the list.&lt;br /&gt;
    component: The component to display in the list.&lt;br /&gt;
    value: A text value associated with an item, used to select an item by&lt;br /&gt;
           keyboard.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;ListView&amp;lt;/code&amp;gt; uses &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; for the single value that is current, and &amp;lt;code&amp;gt;items&amp;lt;/code&amp;gt; contains the list of values that make up the list. While &amp;lt;code&amp;gt;ListView&amp;lt;/code&amp;gt; represents a list of values, only a single value can be &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;body&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Body ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt; represents a slot that fills the entirety of the component. Some components, like &amp;lt;code&amp;gt;Button&amp;lt;/code&amp;gt;, are generic enough that they can be used to display anything, and &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt; is the name these components are assigned to.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-box-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===== Example: Box =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  body: The component displayed in the box.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-button-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===== Example: Button =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  body: The component to display inside of the button.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;items&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Items ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;items&amp;lt;/code&amp;gt; represents a generic list of values that are managed by a single component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-listview-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===== Example: ListView =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Data:&lt;br /&gt;
  current: The view's current value, can be null.&lt;br /&gt;
  selected: The value of the selected list item.&lt;br /&gt;
  items: A list of items used to populate the list.&lt;br /&gt;
    component: The component to display in the list.&lt;br /&gt;
    value: A text value associated with an item, used to select an item by&lt;br /&gt;
           keyboard.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that, strictly following the &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt; naming convention, &amp;lt;code&amp;gt;items.component&amp;lt;/code&amp;gt; should be named &amp;lt;code&amp;gt;items.body&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;state&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== State ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; is for declaring properties that are internal to the component. These are properties that are useful to have because they simplify descriptions of the component’s behavior and map to the user’s mental model of the component. A common use-case for &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; is for declaring properties that can be used for styling the component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-component-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: Component ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;State:&lt;br /&gt;
  active: Whether the component belongs to the currently active window.&lt;br /&gt;
  enabled: The negation of disabled, enabled = !disabled.&lt;br /&gt;
  hover: Whether the mouse is located on top of the component.&lt;br /&gt;
  focus: Whether the component receives keyboard input.&lt;br /&gt;
  focus_in: Whether the component or any of its descendants has focus.&lt;br /&gt;
  focus_visible: Whether the box has focus and it is determined that focus&lt;br /&gt;
                 should be indicated on the box to assist the user:&lt;br /&gt;
                   - the user focused the box via non-pointing device&lt;br /&gt;
                   - the box received programmatic focus from a component that &lt;br /&gt;
                     had focus_visible&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;component&amp;lt;/code&amp;gt; declares a number of &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; properties that are used for styling purposes by many components. It is common for a component to have a certain appearance when it is &amp;lt;code&amp;gt;hover&amp;lt;/code&amp;gt;. Because &amp;lt;code&amp;gt;hover&amp;lt;/code&amp;gt; is defined in &amp;lt;code&amp;gt;component&amp;lt;/code&amp;gt;, it is trivial to style a component like a button based on its hover state. Each component doesn’t need to reinvent or redeclare the logic for what &amp;lt;code&amp;gt;hover&amp;lt;/code&amp;gt; means.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-securitybox&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: SecurityBox ===&lt;br /&gt;
&lt;br /&gt;
A common use-case for &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; is for storing data that is intrinsic to the component that the user cannot manipulate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;State:&lt;br /&gt;
  security_list: A list of all tradeable securities.&lt;br /&gt;
    symbol: The symbol of the security.&lt;br /&gt;
    name: The full name of the security.&lt;br /&gt;
    country: The ISO country code for the country in which the security's&lt;br /&gt;
             exchange is located in.&amp;lt;/pre&amp;gt;&lt;br /&gt;
In &amp;lt;code&amp;gt;SecurityBox&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;security_list&amp;lt;/code&amp;gt; is all tradeable securities. This list is dynamic, since securities are delisted and new securities listed all the time. It could be obtained from a remote resource that is periodically updated. Unlike with &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt;, it is not automatically assumed that this data is continuously flowing as a stream. Because the &amp;lt;code&amp;gt;security_list&amp;lt;/code&amp;gt; is neither a real-time feed or modifiable by the user, &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; is an appropriate location for it. This also ensures that &amp;lt;code&amp;gt;security_list&amp;lt;/code&amp;gt; cannot be tampered with by external components and makes using &amp;lt;code&amp;gt;SecurityBox&amp;lt;/code&amp;gt; more ergonomic: &amp;lt;code&amp;gt;SecurityBox&amp;lt;/code&amp;gt; always contains the list of all tradeable securities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;signals&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Signals ==&lt;br /&gt;
&lt;br /&gt;
Signals are how components notify other components about changes to their internal state. Any external component can listen for a signal from a specific component and respond accordingly. Use signals whenever there is a change in a component that it would be useful for external components to know about based on real use cases.&lt;br /&gt;
&lt;br /&gt;
Signals are not necessary for notifying external components about simple changes in &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt;: the properties in &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; are already externally accessible: an external component can see if &amp;lt;code&amp;gt;DecimalBox.current&amp;lt;/code&amp;gt; changed without needing a signal. However, sometimes a component will need to perform some operations on the data when it changes, and it should send a signal when these operations are completed.&lt;br /&gt;
&lt;br /&gt;
Signals should reflect the behavior of the component they belong to. Components should not pass along signals from their children if it does not make sense to their function.&lt;br /&gt;
&lt;br /&gt;
Components can define signals with the same name as their children. For a component with a child &amp;lt;code&amp;gt;DecimalBox&amp;lt;/code&amp;gt;, it can define its own &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; signal which is what is referenced by &amp;lt;code&amp;gt;A.Submit&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;DecimalBox&amp;lt;/code&amp;gt; is specified with dot notation as &amp;lt;code&amp;gt;A.DecimalBox.Submit&amp;lt;/code&amp;gt;. Ideally, only &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; should be interested in &amp;lt;code&amp;gt;DecimalBox.Submit&amp;lt;/code&amp;gt;, while other components should subscribe to &amp;lt;code&amp;gt;A.Submit&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;standard-signal-names&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Standard Signal Names ===&lt;br /&gt;
&lt;br /&gt;
As with properties, there are a few standard signals.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;change&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Change ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;Change&amp;lt;/code&amp;gt; signal may be fired by a component that needs to notify other components of a change to the &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; of its children. This may be useful when some logic should be performed such as validation before sending out the signal so that components listening for changes do not concern themselves with handling an invalid change. It is similar to the [https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event Input Event] in HTML&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;submit&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Submit ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; indicates that the user has submitted the value. A &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; signal should only be generated in response to an intentional user action, such as a key press. &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; is conventionally signaled on a &amp;lt;code&amp;gt;FocusOut&amp;lt;/code&amp;gt; event when &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; has changed from its previous value: the user’s change in focus is interpreted as an implicit submission. &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; typically follows an Enter key press. It is similar to the [https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event Change Event] in HTML.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;reject&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Reject ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Reject&amp;lt;/code&amp;gt; is fired to indicate that a submitted value was rejected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;payload&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Payload ===&lt;br /&gt;
&lt;br /&gt;
When a signal is fired, it carries with it a payload that components can read. For the &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; signal, its payload consists of &amp;lt;code&amp;gt;submission&amp;lt;/code&amp;gt; by default. The payload of any signal can be customized to better suit the use-cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-timefilterpanel&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Example: TimeFilterPanel ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Signals:&lt;br /&gt;
  Submit: The user has submitted their time range.&lt;br /&gt;
    start: The submitted start time of the range or NULL if offset is set.&lt;br /&gt;
    end: The submitted end time of the range or NULL if offset is set.&lt;br /&gt;
    offset: The submitted offset to filter by or NULL if start and end are set.&amp;lt;/pre&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; payload carries three values: &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;offset&amp;lt;/code&amp;gt;. This reflects &amp;lt;code&amp;gt;TimeFilterPanel&amp;lt;/code&amp;gt; which lacks a &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;submission&amp;lt;/code&amp;gt; but has &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;offset&amp;lt;/code&amp;gt; values. Within &amp;lt;code&amp;gt;user_flow.drawio&amp;lt;/code&amp;gt;, the values used for each payload slot are clarified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;ordering&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Ordering ==&lt;br /&gt;
&lt;br /&gt;
Keep the sections ordered as they appear in this overview and repeated below:&lt;br /&gt;
* Definitions&lt;br /&gt;
* Styles&lt;br /&gt;
* Pseudo-Elements&lt;br /&gt;
* Data&lt;br /&gt;
* State&lt;br /&gt;
* Signals&lt;br /&gt;
&lt;br /&gt;
Omit any section that is unused.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;usage&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
When placing data into &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;, use the property names exactly as they appear in &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;. States used by selectors in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; should also appear exactly as they appear in &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;. The property and signal names should also carry over to &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;use_cases.drawio&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;user_flow.drawio&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; is the most powerful tool in the designer’s toolkit; taking time upfront to provide good descriptions in the model can save a lot of designer and developer headaches later on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;references&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [https://web.dev/learn/css/pseudo-elements/ Web.dev: Pseudo-Elements]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Pseudo-classes_and_pseudo-elements#what_is_a_pseudo-element MDN: Pseudo-Elements] &lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event MDN: The Input Event] &lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event MDN: The Change Event]&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Styling_Grammar&amp;diff=229</id>
		<title>Styling Grammar</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Styling_Grammar&amp;diff=229"/>
		<updated>2024-09-06T21:39:00Z</updated>

		<summary type="html">&lt;p&gt;Jon: Add syntax highlighting to code snippets&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Syntax =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Declarations ==&lt;br /&gt;
&lt;br /&gt;
A property and value pair is called a declaration'''.''' The pair is separated by a colon, '&amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;'. White spaces are ignored. Properties and values are case-insensitive. If the value is invalid for the property, the declaration will be ignored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;Property            value&lt;br /&gt;
background-color:   white&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Declaration blocks ==&lt;br /&gt;
&lt;br /&gt;
A pair of brackets, ‘&amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt;’ and ‘&amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt;’, are used to group multiple declarations into a block. The semicolon ‘&amp;lt;code&amp;gt;;&amp;lt;/code&amp;gt;’ is used to separate different declarations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;{&lt;br /&gt;
    background-color: white;&lt;br /&gt;
    border-size: 1px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selector ==&lt;br /&gt;
&lt;br /&gt;
The selector specifies which components are being applied for styles.&lt;br /&gt;
&lt;br /&gt;
Selector types:&lt;br /&gt;
&lt;br /&gt;
{|  class=&amp;quot;wikitable simple-table&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|  | '''Selector'''&lt;br /&gt;
|  | '''Explanation'''&lt;br /&gt;
|  | '''Example'''&lt;br /&gt;
|  | '''Spire styling'''&lt;br /&gt;
|-&lt;br /&gt;
|  | Any selector (universal selector)&lt;br /&gt;
|  | Selects all components.&lt;br /&gt;
|  | *&lt;br /&gt;
|  | Any()&lt;br /&gt;
|-&lt;br /&gt;
|  | Type selector&lt;br /&gt;
|  | Selects all instances of the selector and of its subclasses.&lt;br /&gt;
|  | TextBox&lt;br /&gt;
|  | is_a&amp;lt;Type&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  | Property selector&lt;br /&gt;
|  | Selects elements based on the element having a given attribute explicitly set.&lt;br /&gt;
|  | Button[visibility=none]&amp;lt;br /&amp;gt;&lt;br /&gt;
Button:not([visibility=none])&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|  | Button &amp;amp;&amp;amp; matches(Visibility::NONE)&amp;lt;br /&amp;gt;&lt;br /&gt;
Button &amp;amp;&amp;amp; !matches(Visibility::NONE)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  | &amp;amp; nesting selector&lt;br /&gt;
|  | The &amp;amp; nesting selector makes the nested child rule selectors relative to the parent element. Without the &amp;amp; nesting selector, the child rule selector selects child elements.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;parentRule {&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/* parent rule style properties */&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp; childRule {&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/* child rule style properties */&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
}&amp;lt;br /&amp;gt;&lt;br /&gt;
}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|  |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The class selector and ID selector in CSS are not supported since the Spire styling doesn’t support them.&lt;br /&gt;
&lt;br /&gt;
{|  class=&amp;quot;wikitable simple-table&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| | &amp;lt;s&amp;gt;Class selector&amp;lt;/s&amp;gt;&lt;br /&gt;
| | Selects all instances of the selector.&lt;br /&gt;
| | .TextBox&lt;br /&gt;
| | Not support&lt;br /&gt;
|-&lt;br /&gt;
| | &amp;lt;s&amp;gt;ID selector&amp;lt;/s&amp;gt;&lt;br /&gt;
| | Matches all instances that has a specific object name.&lt;br /&gt;
| | #my-label&lt;br /&gt;
| | Not support&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Pseudo-classes ==&lt;br /&gt;
&lt;br /&gt;
The pseudo-class specifies a given state to the components. It starts with a colon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;:pseudo-class {&lt;br /&gt;
  property: value;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{|  class=&amp;quot;wikitable simple-table&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| | '''Selector'''&lt;br /&gt;
|  | '''Explanation'''&lt;br /&gt;
| | '''Related components'''&lt;br /&gt;
|-&lt;br /&gt;
| | :active&lt;br /&gt;
|  | Selects a component that is or belongs to the active window.&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :disabled&lt;br /&gt;
|  | Selects a disabled component.&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :hover&lt;br /&gt;
|  | Selects a hovered component.&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :focus&lt;br /&gt;
|  | Selects a focused component.&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :focus-in&lt;br /&gt;
|  | Selects a component that has focus or has a child that has focus..&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :focus-visible&lt;br /&gt;
|  | Selects a component if it was focused using a non-pointing device&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :drag&lt;br /&gt;
|  | Selects a Dragged component.&lt;br /&gt;
| | SplitView, ScrollBar&lt;br /&gt;
|-&lt;br /&gt;
| | :press&lt;br /&gt;
|  | Selects a pressed component.&lt;br /&gt;
| | Button, Slider, Slider2D, MenuButton&lt;br /&gt;
|-&lt;br /&gt;
| | :read-only&lt;br /&gt;
|  | Selects a read-only component.&lt;br /&gt;
| | All input boxes.&lt;br /&gt;
|-&lt;br /&gt;
| | :rejected&lt;br /&gt;
|  | Selects a a component whose input value is rejected.&lt;br /&gt;
| | TextBox, DurationBox, DestinationBox, SaleConditionBox, DateBox&lt;br /&gt;
|-&lt;br /&gt;
| | :checked&lt;br /&gt;
|  | Selects a checked CheckBox.&lt;br /&gt;
| | CheckBox&lt;br /&gt;
|-&lt;br /&gt;
| | :selected&lt;br /&gt;
|  | Selects a selected list item.&lt;br /&gt;
| | ListItem&lt;br /&gt;
|-&lt;br /&gt;
| | :current&lt;br /&gt;
|  | Selects the current list item.&lt;br /&gt;
| | ListItem&lt;br /&gt;
|-&lt;br /&gt;
| | :precedes-current&lt;br /&gt;
|  | Selects the list item precedes the current item.&lt;br /&gt;
| | ListItem&lt;br /&gt;
|-&lt;br /&gt;
| | :hover-item&lt;br /&gt;
|  | Selects the hovered table item&lt;br /&gt;
| | TableItem&lt;br /&gt;
|-&lt;br /&gt;
| | :current-row&lt;br /&gt;
|  | Selects the current row in the table.&lt;br /&gt;
| | TableBody&lt;br /&gt;
|-&lt;br /&gt;
| | :current-column&lt;br /&gt;
|  | Selects the current column in the table.&lt;br /&gt;
| | TableBody&lt;br /&gt;
|-&lt;br /&gt;
| | :sortable&lt;br /&gt;
|  | Selects the column when it's sort order is not UNORDERED.&lt;br /&gt;
| | TableHeaderItem&lt;br /&gt;
|-&lt;br /&gt;
| | :filtered&lt;br /&gt;
|  | Selects the column when a filter is applied.&lt;br /&gt;
| | TableHeaderItem&lt;br /&gt;
|-&lt;br /&gt;
| | :pop-up&lt;br /&gt;
|  | Selects the widget displaying a pop-up.&lt;br /&gt;
| | DropDownBox&lt;br /&gt;
|-&lt;br /&gt;
| | :high-lighted&lt;br /&gt;
|  | Selects the highlighted widget.&lt;br /&gt;
| | ColorSwatch&lt;br /&gt;
|-&lt;br /&gt;
| | :is-positive&lt;br /&gt;
|  | Selects the DecimalBox when its value is positive.&lt;br /&gt;
| | DecimalBox&lt;br /&gt;
|-&lt;br /&gt;
| | :is-negative&lt;br /&gt;
|  | Selects the DecimalBox when its value is negative.&lt;br /&gt;
| | DecimalBox&lt;br /&gt;
|-&lt;br /&gt;
| | :uptick&lt;br /&gt;
|  | Selects the DecimalBox when its value has increased.&lt;br /&gt;
| | DecimalBox&lt;br /&gt;
|-&lt;br /&gt;
| | :downtick&lt;br /&gt;
|  | Selects the DecimalBox when its value has decreased.&lt;br /&gt;
| | DecimalBox&lt;br /&gt;
|-&lt;br /&gt;
| | :modifier-key&lt;br /&gt;
|  | Selects the KeyTag when it's displaying a modifier key.&lt;br /&gt;
| | KeyTag&lt;br /&gt;
|-&lt;br /&gt;
| | :escape-key&lt;br /&gt;
|  | Selects the KeyTag when it's displaying the ESC key.&lt;br /&gt;
| | KeyTag&lt;br /&gt;
|-&lt;br /&gt;
| | :today&lt;br /&gt;
|  | Selects the CalendarDatePicker when the current day is today.&lt;br /&gt;
| | CalendarDatePicker&lt;br /&gt;
|-&lt;br /&gt;
| | :out-of-month&lt;br /&gt;
|  | Selects the CalendarDatePicker when a day is outside of the current month.&lt;br /&gt;
| | CalendarDatePicker&lt;br /&gt;
|-&lt;br /&gt;
| | :has()&lt;br /&gt;
|  | Takes a selector as its argument and matches any element matching this selector.&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :not()&lt;br /&gt;
|  | Selects a component that is not selected by a selector.&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :flip()&lt;br /&gt;
|  | Flips what elements are selected.&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :is()&lt;br /&gt;
|  | Selects any element that can be selected by one of the selectors in its list.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;:is(selector1, selector2, ...)&amp;lt;/code&amp;gt;&lt;br /&gt;
| | All components&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Pseudo-elements ==&lt;br /&gt;
&lt;br /&gt;
A pseudo-element selects components that are the specific part of a selector. The pseudo-element must be used in combination with a block-level element selector. This means you cannot use pseudo-elements on its own without specifying a block-level element. Pseudo-elements start with a double colon &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;selector::pseudo-element {&lt;br /&gt;
  property: value;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{|  class=&amp;quot;wikitable simple-table&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| | '''Selector'''&lt;br /&gt;
| | '''Explanation'''&lt;br /&gt;
| | '''Related components'''&lt;br /&gt;
| | '''Spire styling'''&lt;br /&gt;
|-&lt;br /&gt;
| | ::placeholder&lt;br /&gt;
| | Select the placeholder in the text box.&lt;br /&gt;
| | TextBox, TextAreaBox&lt;br /&gt;
| | &amp;lt;code&amp;gt;PseudoElement&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Sub-controls ==&lt;br /&gt;
&lt;br /&gt;
Selectors can contain sub-controls that make it possible to restrict the application of a rule to specific sub-controls. Its syntax is same as pseudo-element’s.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;selector::sub-controls{&lt;br /&gt;
  property: value;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{|  class=&amp;quot;wikitable simple-table&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| | '''Selector'''&lt;br /&gt;
| | '''Explanation'''&lt;br /&gt;
| | '''Related components'''&lt;br /&gt;
|-&lt;br /&gt;
| | ::row&lt;br /&gt;
| | Selects all rows in the table.&lt;br /&gt;
| | TableBody&lt;br /&gt;
|-&lt;br /&gt;
| | ::column&lt;br /&gt;
| | Selects all columns in the table.&lt;br /&gt;
| | TableBody&lt;br /&gt;
|-&lt;br /&gt;
| | ::prompt&lt;br /&gt;
| | Selects the prompt in a key input box.&lt;br /&gt;
| | KeyInputBox&lt;br /&gt;
|-&lt;br /&gt;
| | ::divider&lt;br /&gt;
| | Selects the divider.&lt;br /&gt;
| | TabView, SplitView&lt;br /&gt;
|-&lt;br /&gt;
| | ::body&lt;br /&gt;
| | Selects the body component of a box or button.&lt;br /&gt;
| | Box, Button&lt;br /&gt;
|-&lt;br /&gt;
| | ::empty-cell&lt;br /&gt;
| | Selects the empty table cell in the EditableTableView.&lt;br /&gt;
| | TableItem(EditableTableView)&lt;br /&gt;
|-&lt;br /&gt;
| | ::delete-button&lt;br /&gt;
| | Selects the delete button in the EditableTableView.&lt;br /&gt;
| | TableItem(EditableTableView)&lt;br /&gt;
|-&lt;br /&gt;
| | ::label&lt;br /&gt;
| | Selects the label inside the TableHeaderItem.&lt;br /&gt;
| | TableHeaderItem&lt;br /&gt;
|-&lt;br /&gt;
| | ::filter-button&lt;br /&gt;
| | Selects the filter button inside the TableHeaderItem.&lt;br /&gt;
| | TableHeaderItem&lt;br /&gt;
|-&lt;br /&gt;
| | ::hover-element&lt;br /&gt;
| | Selects the hover element inside the TableHeaderItem.&lt;br /&gt;
| | TableHeaderItem&lt;br /&gt;
|-&lt;br /&gt;
| | ::track&lt;br /&gt;
| | Selects the track of the slider.&lt;br /&gt;
| | Slider, Slider2D&lt;br /&gt;
|-&lt;br /&gt;
| | ::thumb&lt;br /&gt;
| | Selects the thumb of the slider.&lt;br /&gt;
| | Slider, Slider2D&lt;br /&gt;
|-&lt;br /&gt;
| | ::track-rail&lt;br /&gt;
| | Selects the track rail of the slider.&lt;br /&gt;
| | Slider&lt;br /&gt;
|-&lt;br /&gt;
| | ::track-fill&lt;br /&gt;
| | Selects the track fill of the slider.&lt;br /&gt;
| | Slider&lt;br /&gt;
|-&lt;br /&gt;
| | ::track-pad&lt;br /&gt;
| | Selects the track pad of the 2d slider.&lt;br /&gt;
| | Slider2D&lt;br /&gt;
|-&lt;br /&gt;
| | ::scrollbar-track&lt;br /&gt;
| | Selects the track of the scroll bar.&lt;br /&gt;
| | ScrollBar&lt;br /&gt;
|-&lt;br /&gt;
| | ::scrollbar-thumb&lt;br /&gt;
| | Selects the thumb of the scroll bar.&lt;br /&gt;
| | ScrollBar&lt;br /&gt;
|-&lt;br /&gt;
| | ::colon&lt;br /&gt;
| | Selects the colon field.&lt;br /&gt;
| | DurationBox&lt;br /&gt;
|-&lt;br /&gt;
| | ::alpha&lt;br /&gt;
| | Selects the alpha component in the ColorCodePanel.&lt;br /&gt;
| | ColorCodePanel&lt;br /&gt;
|-&lt;br /&gt;
| | ::primary&lt;br /&gt;
| | Selects the primary component in the SplitView.&lt;br /&gt;
| | SplitView&lt;br /&gt;
|-&lt;br /&gt;
| | ::secondary&lt;br /&gt;
| | Selects the secondary component in the SplitView.&lt;br /&gt;
| | SplitView&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Selectors Combination ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable simple-table&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| | '''Selector'''&lt;br /&gt;
| | '''Explanation'''&lt;br /&gt;
|  | '''Syntax'''&lt;br /&gt;
|  | '''Example'''&lt;br /&gt;
| | '''CSS supports'''&lt;br /&gt;
|-&lt;br /&gt;
| | Child selector&lt;br /&gt;
| | Selects a component matched by the second selector that is the direct child of the component matched by the first.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;selector1 &amp;gt; selector2&amp;lt;/code&amp;gt;&lt;br /&gt;
|  | &amp;lt;code&amp;gt;TableView &amp;gt; TableBody&amp;lt;/code&amp;gt;&lt;br /&gt;
| | Yes&lt;br /&gt;
|-&lt;br /&gt;
| | Descendant selector&lt;br /&gt;
| | Selects a component matched by the second selector that is the descendant of the component matched by the first.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;selector &amp;gt;&amp;gt; descendant- selector&amp;lt;/code&amp;gt;&lt;br /&gt;
|  | &amp;lt;code&amp;gt;ColorPicker &amp;gt;&amp;gt; Alpha&amp;lt;/code&amp;gt;&lt;br /&gt;
| | Yes, but a single space is used.&lt;br /&gt;
|-&lt;br /&gt;
| | Parent selector&lt;br /&gt;
| | Selects a component matched by the second selector that is the direct parent of the component matched by the first.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;:has(&amp;gt; child-selector)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|  | &amp;lt;code&amp;gt;ListItem:has(&amp;gt; TextBox)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| | The &amp;lt;code&amp;gt;:has() &amp;lt;/code&amp;gt;pseudo-class can achieve the functionality.&lt;br /&gt;
|-&lt;br /&gt;
| | Ancestor selector&lt;br /&gt;
| | Selects a component matched by the second selector that is the ancestor of the component matched by the first.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;:has(&amp;gt;&amp;gt; descendant-selector)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|  | &amp;lt;code&amp;gt;TableItem:has(&amp;gt;&amp;gt; TableItem)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| | The &amp;lt;code&amp;gt;:has() &amp;lt;/code&amp;gt;pseudo-class can achieve the functionality.&lt;br /&gt;
|-&lt;br /&gt;
| | And selector&lt;br /&gt;
| | Selects components that are matched by both selectors.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;&amp;lt;selector1&amp;gt;&amp;lt;selector2&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|  | &amp;lt;code&amp;gt;TextBox:hover&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| | Combining Type selector and Pseudo-Class&lt;br /&gt;
|-&lt;br /&gt;
| | Flip selector&lt;br /&gt;
| | Flips what elements are selected.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;:flip()&amp;lt;/code&amp;gt;&lt;br /&gt;
|  | &amp;lt;code&amp;gt;*:flip(:has(&amp;gt;&amp;gt; ListItem))&amp;lt;/code&amp;gt;&lt;br /&gt;
| | No&lt;br /&gt;
|-&lt;br /&gt;
| | Not selector&lt;br /&gt;
| | Selects a component that is not selected by a selector.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;:not()&amp;lt;/code&amp;gt;&lt;br /&gt;
|  | &amp;lt;code&amp;gt;:not(:hover)&amp;lt;/code&amp;gt;&lt;br /&gt;
| | &amp;lt;code&amp;gt;:not()&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| | Or selector&lt;br /&gt;
| | Selects a component that is selected by at least one of two selectors.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;selector1, selector2&amp;lt;/code&amp;gt;&lt;br /&gt;
|  | &amp;lt;code&amp;gt;:hover, :focus&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;:is(:hover, :focus)&amp;lt;/code&amp;gt;&lt;br /&gt;
| | selector list&lt;br /&gt;
|-&lt;br /&gt;
| | Sibling selector&lt;br /&gt;
| | Selects a component matched by the second selector that is the sibling of the component matched by the first.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;selector % sibling-selector&amp;lt;/code&amp;gt;&lt;br /&gt;
|  | &amp;lt;code&amp;gt;TextBox % Button&amp;lt;/code&amp;gt;&lt;br /&gt;
| | Yes, but &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; is used.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Child selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;is_a&amp;lt;Button&amp;gt;() &amp;gt; is_a&amp;lt;TextBox&amp;gt;()&lt;br /&gt;
&lt;br /&gt;
Button &amp;gt; TextBox {&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Button {&lt;br /&gt;
    TextBox {&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Button {&lt;br /&gt;
    &amp;amp; &amp;gt; TextBox {&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Descendant selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;is_a&amp;lt;Button&amp;gt;() &amp;gt;&amp;gt; is_a&amp;lt;TextBox&amp;gt;()&lt;br /&gt;
&lt;br /&gt;
Button &amp;gt;&amp;gt; TextBox {&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Button {&lt;br /&gt;
    &amp;amp; &amp;gt;&amp;gt; TextBox {&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parent selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;is_a&amp;lt;Button&amp;gt;() &amp;lt; is_a&amp;lt;TextBox&amp;gt;()&lt;br /&gt;
&lt;br /&gt;
Button:has(&amp;gt; TextBox) {&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Cases used in practice:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;auto body_selector = Any() &amp;gt; is_a&amp;lt;TableBody&amp;gt;();&lt;br /&gt;
auto item_selector = body_selector &amp;gt; Row() &amp;gt; is_a&amp;lt;TableItem&amp;gt;();&lt;br /&gt;
style.get((item_selector &amp;gt; EmptyCell()) &amp;lt; (HoverItem() || Current())).&lt;br /&gt;
    set(border_color(QColor(Qt::transparent)));&lt;br /&gt;
&lt;br /&gt;
TableView &amp;gt; TableBody &amp;gt; TableBody::row &amp;gt;&lt;br /&gt;
 TableItem:has(&amp;gt; TableItem::empty-cell):hover-item,&lt;br /&gt;
TableView &amp;gt; TableBody &amp;gt; TableBody::row &amp;gt;&lt;br /&gt;
 TableItem:has(&amp;gt; TableItem::empty-cell):current {&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
TableView {&lt;br /&gt;
    TableBody {&lt;br /&gt;
        TableBody::row {&lt;br /&gt;
            TableItem {&lt;br /&gt;
                    &amp;amp;:has(&amp;gt; ::empty-cell) {&lt;br /&gt;
                        &amp;amp; :hover-item,&lt;br /&gt;
                        &amp;amp; :current {&lt;br /&gt;
                            border-color: transparent;&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
TableView {&lt;br /&gt;
    TableBody {&lt;br /&gt;
        TableBody::row {&lt;br /&gt;
            TableItem {&lt;br /&gt;
                    &amp;amp;:has(&amp;gt; ::empty-cell):is(:hover-item, :current) {&lt;br /&gt;
                        border-color: transparent;&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ancestor selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;is_a&amp;lt;Button&amp;gt;() &amp;lt;&amp;lt; is_a&amp;lt;TextBox&amp;gt;(&lt;br /&gt;
&lt;br /&gt;
Button:has(&amp;gt;&amp;gt; TextBox) {&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== And selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;is_a&amp;lt;TextBox&amp;gt;() &amp;amp;&amp;amp; Hover()&lt;br /&gt;
&lt;br /&gt;
TextBox:hover&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;is_a&amp;lt;TextBox&amp;gt;() &amp;amp;&amp;amp; ReadOnly() &amp;amp;&amp;amp; Disabled()&lt;br /&gt;
&lt;br /&gt;
TextBox:read-only:disabled&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;is_a&amp;lt;TextBox&amp;gt;() &amp;amp;&amp;amp; !Prompt()&lt;br /&gt;
&lt;br /&gt;
TextBox:not(KeyInputBox::Prompt)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Flip selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;+Any()&lt;br /&gt;
&lt;br /&gt;
*:flip()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Not selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;!Hover()&lt;br /&gt;
&lt;br /&gt;
:not(:hover)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;!Prompt()&lt;br /&gt;
&lt;br /&gt;
:not(KeyInputBox::prompt)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Or selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;is_a&amp;lt;TextBox&amp;gt;() &amp;amp;&amp;amp; (Hover() || Focus()).&lt;br /&gt;
    set(border_color(QColor(0x4B23A0)));&lt;br /&gt;
&lt;br /&gt;
TextBox:hover, TextBox:focus {&lt;br /&gt;
    border-color: 0x4B23A0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
TextBox {&lt;br /&gt;
    &amp;amp;:hover,&lt;br /&gt;
    &amp;amp;:focus {&lt;br /&gt;
        border-color: 0x4B23A0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
TextBox {&lt;br /&gt;
    &amp;amp;:is(:hover, :focus) {&lt;br /&gt;
        border-color: 0x4B23A0;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sibling selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;is_a&amp;lt;TextBox&amp;gt;() % is_a&amp;lt;Button&amp;gt;()&lt;br /&gt;
&lt;br /&gt;
TextBox % Button&lt;br /&gt;
&lt;br /&gt;
TextBox {&lt;br /&gt;
    &amp;amp; % Button {&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rules ==&lt;br /&gt;
&lt;br /&gt;
A selector list and an associated declaration block are called a rule.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;TextBox {&lt;br /&gt;
    background-color: white;&lt;br /&gt;
    border-size: 1px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A commas, ‘&amp;lt;code&amp;gt;,&amp;lt;/code&amp;gt;’, is used to separated different selectors which have the the same declaration block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;TextBox, Button {&lt;br /&gt;
    background-color: white;&lt;br /&gt;
    border-size: 1px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inheritance ==&lt;br /&gt;
&lt;br /&gt;
Unlike CSS, a component doesn’t automatically inherit font and color settings from its parent component.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Nesting style ==&lt;br /&gt;
&lt;br /&gt;
Nesting refers to the practice of placing rules inside other rules. It allows you to group related styles together to improve readability and reduce repetition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;parent {&lt;br /&gt;
  /* parent styles */&lt;br /&gt;
  child {&lt;br /&gt;
    /* child of parent styles */&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
parent {&lt;br /&gt;
  /* parent styles */&lt;br /&gt;
  &amp;amp; child {&lt;br /&gt;
    /* child of parent styles */&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The difference between using &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; nesting selectors and not using nesting selectors.&lt;br /&gt;
&lt;br /&gt;
* ''without'' the &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; nesting selector&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;Button {&lt;br /&gt;
  /* parent styles */&lt;br /&gt;
  :hover {&lt;br /&gt;
    /* child of parent styles */&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
It automatically adds the Child selector &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; between the selectors to create a new selector rule(CSS adds a whitespace between the selectors, building the descendant relationship between selectors by default). The following code shows the equivalent non-nested rules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;Button {&lt;br /&gt;
    /* parent styles */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* styles the hovered button's children. */&lt;br /&gt;
Button &amp;gt; :hover {&lt;br /&gt;
    /* child of parent styles */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
is_a&amp;lt;Button&amp;gt;() &amp;gt; Hover()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* ''with'' the &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; nesting selector&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;Button {&lt;br /&gt;
  /* parent styles */&lt;br /&gt;
  &amp;amp; :hover {&lt;br /&gt;
    /* child of parent styles */&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
With the &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; nesting selector added with no whitespace, the above block equals to the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;Button {&lt;br /&gt;
    /* parent styles */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* styles the hovered button. */&lt;br /&gt;
Button:hover {&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
is_a&amp;lt;Button&amp;gt;() &amp;amp;&amp;amp; Hover()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Other examples&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;is_a&amp;lt;Button&amp;gt;() &amp;gt;&amp;gt; is_a&amp;lt;TextBox&amp;gt;()&lt;br /&gt;
&lt;br /&gt;
Button {&lt;br /&gt;
  /* parent styles */&lt;br /&gt;
  &amp;amp; &amp;gt;&amp;gt; TextBox {&lt;br /&gt;
    /* child of parent styles */&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Button {&lt;br /&gt;
    &amp;gt;&amp;gt; TextBox {&lt;br /&gt;
        background-color: black;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Button {&lt;br /&gt;
    /* parent styles */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* styles the hovered button. */&lt;br /&gt;
Button &amp;gt;&amp;gt; TextBox {&lt;br /&gt;
    /* child of parent styles */&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Values =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Number ==&lt;br /&gt;
&lt;br /&gt;
A decimal integer or a real number.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;0, 1, 10, 1.5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Length ==&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Number(px | pt | ch)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Color ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''Hexadecimal Colors'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Syntax:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;#rrggbb&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Example:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;TextBox {background-color: #ff0000;}&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;2&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''Hexadecimal Colors With Transparency'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Syntax:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;#rrggbbaa&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Example:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;TextBox {background-color: #ff000008;}&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;3&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''RGB Colors'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;An RGB color value is specified with syntax &amp;lt;code&amp;gt;rgb()&amp;lt;/code&amp;gt;, which has the following syntax:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;rgb(red, green, blue)&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Each parameter is an integer between 0 and 255.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Example:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;TextBox {background-color: rgb(255, 0, 0);} &amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;4&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''RGBA Colors'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;RGBA color values are an extension of RGB color values with an alpha channel. The syntax is&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;rgba(red, green, blue, alpha)&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Example:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;TextBox {background-color: rgba(255, 0, 0, 0.3);} &amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;5&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''Predefined Color Names'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Only three color names that have been used in Spire are defined here.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;transparent&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;white&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;black&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Example:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;TextBox {background-color: transparent;} &amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Font Style ==&lt;br /&gt;
&lt;br /&gt;
* '''normal'''&lt;br /&gt;
&lt;br /&gt;
* '''italic'''&lt;br /&gt;
&lt;br /&gt;
* '''oblique'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#TextBox {font-style: italic;} &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Font Weight ==&lt;br /&gt;
&lt;br /&gt;
Predefined weight values which Qt supports:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''thin'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 100.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''extra-light'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 200.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''light'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 300.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''normal'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 400.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''medium'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 500.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''demi-bold'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 600.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''bold'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 700.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''extra-bold'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 800.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''black'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 900.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Alignment ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;{left | right | top | bottom | center}*&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Time ==&lt;br /&gt;
&lt;br /&gt;
It represents a time value expressed in seconds or milliseconds. There is no space between Number and &amp;lt;code&amp;gt;s &amp;lt;/code&amp;gt;or &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Number(s | ms)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Overflow ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''none'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The list extends indefinitely.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''wrap'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;List items wrap to fill the perpendicular space.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== EdgeNavigation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''contain'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Selection stops at the current selection.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''wrap'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Selection moves from the first item to last item and vice versa.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Orientation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''horizontal'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The element is laid out horizontally.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''vertical'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The element is laid out vertically.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DateFormat ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''YYYYMMDD'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The year, month, and day can be input in a YYYY-MM-DD format.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''MMDD'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The month and day can be input in a MM-DD format.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Visibility ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''visible'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The element is visible.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''invisible'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The element is invisible.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''none'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The element is treated as if it has a width and height of 0.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Properties =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== all ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt; property is a property that resets all properties.&lt;br /&gt;
&lt;br /&gt;
Value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;unset&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The unset keyword clears styles of all properties, which has the different meaning with CSS unset. In CSS, unset specifies that all the element's properties should be changed to their inherited values if they inherit by default, or to their initial values if not.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;all: unset;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;TextBox:read-only {&lt;br /&gt;
    all: unset;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
style.get(ReadOnly()).clear();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Font ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''font-family''' ===&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#TextBox {font-family: &amp;quot;Roboto&amp;quot;;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''font-style''' ===&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#TextBox {font-style: normal;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''font-weight''' ===&lt;br /&gt;
&lt;br /&gt;
The weights available depend on the &amp;lt;code&amp;gt;font-style&amp;lt;/code&amp;gt; that is currently set. It doesn’t support arbitrary values since QFont::setWeight() uses QFont::Weight enumeration as the parameter. Referring to &amp;lt;code&amp;gt;Font weight&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#TextBox {font-weight: normal;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''font-size''' ===&lt;br /&gt;
&lt;br /&gt;
Sets the element's font size. Only pt and px metrics are supported.&amp;lt;br /&amp;gt;&lt;br /&gt;
Example:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#TextBox {font-size: 12px;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''font (shorthand)''' ===&lt;br /&gt;
&lt;br /&gt;
Syntax:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;font = font-style? font-weight? font-size font-family&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#TextBox {font: normal medium 12px &amp;quot;Roboto&amp;quot;;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Icon ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''url''' ===&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;url(filename)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
filename is the name of a file on the local disk or stored using the Qt resource system.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;url(&amp;quot;:/Icons/spire.svg”)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''fill''' ===&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;fill = color | none&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;Icon { fill: 0xA0A0A0; }&lt;br /&gt;
Icon { fill: none; }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''icon-image''' ===&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;icon-image = url (width height)?&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;Icon { icon-image: url(&amp;quot;:/Icons/spire.svg”) 16px 16px; }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Text ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''text-align''' ===&lt;br /&gt;
&lt;br /&gt;
Value: Alignment&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;TextBox {&lt;br /&gt;
  text-align: left;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''text-color''' ===&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;TextBox {&lt;br /&gt;
  text-color: black;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''text-style''' (Shorthand) ===&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;text-style = font text-color&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;TextBox {&lt;br /&gt;
    text-style: normal 12px &amp;quot;Roboto&amp;quot; black;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Border ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-top-size''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the top border.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-top-size: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-right-size''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the right border.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-right-size: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-bottom-size''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the bottom border.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-bottom-size: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-left-size''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the left border.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-left-size: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-top-color''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the color of the top border.&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-top-color: 0x4B23A0; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-right-color''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the color of the right border.&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-right-color: 0x4B23A0; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-bottom-color''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the color of the bottom border.&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-bottom-color: 0x4B23A0; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-left-color''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the color of the left border.&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-left-color: 0x4B23A0; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-top-left-radius''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the radius of the border's top left corner.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-top-left-radius: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-top-right-radius''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the radius of the border's top right corner.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-top-right-radius: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-bottom-right-radius''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the radius of the border's bottom right corner.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-bottom-right-radius: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-bottom-left-radius''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the radius of the border's bottom left corner.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-bottom-left-radius: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-size''' ===&lt;br /&gt;
&lt;br /&gt;
Applies a single size to all four borders: '''border-top-size, border-right-size, border-bottom-size and border-left-size.'''&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-size: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-color''' ===&lt;br /&gt;
&lt;br /&gt;
Applies a single color to all four border: '''border-top-color, border-right-color, border-bottom-color and border-left-color.'''&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-color: 0x4B23A0; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-radius''' ===&lt;br /&gt;
&lt;br /&gt;
Applies a single radius to all four corners: '''border-top-left-radius, border-top-right-radius, border-bottom-right-radius and border-bottom-left-radius.'''&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-radius: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border (shorthand)''' ===&lt;br /&gt;
&lt;br /&gt;
Styles all border colors and sizes.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;border = border-size border-color&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;TextBox {&lt;br /&gt;
    border: 1px 0x4B23A0;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Padding ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''padding-top''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the top padding.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { padding-top: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''padding-right''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the right padding.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { padding-right: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''padding-bottom''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the bottom padding.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { padding-bottom: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''padding-left''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the left padding.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { padding-left: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''horizontal-padding''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the left and right padding.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { horiztontal-padding: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''vertical-padding''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the top and bottom padding.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { vertical-padding: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''padding''' ===&lt;br /&gt;
&lt;br /&gt;
Styles all four padding size of an element at once.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { padding: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Spacing ==&lt;br /&gt;
&lt;br /&gt;
=== '''horizontal-spacing''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the horizontal spacing between items in the table body.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TableBody { horizontal-spacing: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''vertical-spacing''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the vertical spacing between items in the table body.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TableBody { vertical-spacing: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''spacing''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the spacing between items in the table body.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TableBody { spacing: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grid Color ==&lt;br /&gt;
&lt;br /&gt;
=== '''horizontal-grid-color''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the color of the horizontal grid lines in the table body.&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TableBody { horizontal-grid-color: transparent; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''vertical-grid-color''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the color of the vertical grid lines in the table body.&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TableBody { vertical-grid-color: transparent; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''grid-color''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the color of the grid lines.&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TableBody { grid-color: transparent; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== background-color ==&lt;br /&gt;
&lt;br /&gt;
Sets the background color of an element.&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { background-color: transparent; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== body-align ==&lt;br /&gt;
&lt;br /&gt;
Sets the alignment of the body in a box.&lt;br /&gt;
&lt;br /&gt;
Value: Alignment&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DurationBox { body-align: center; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== leading-zeros ==&lt;br /&gt;
&lt;br /&gt;
The number of leading zeros added as padding to a number.&lt;br /&gt;
&lt;br /&gt;
Value: Number&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DecimalBox { leading-zeros: 4; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== trailing-zeros ==&lt;br /&gt;
&lt;br /&gt;
The number of trailing zeros added as padding to the fractional part of a number.&lt;br /&gt;
&lt;br /&gt;
Value: Number&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DecimalBox { trailing-zeros: 4; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== list-item-gap ==&lt;br /&gt;
&lt;br /&gt;
Sets the spacing between list items.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ListView { list-item-gap: 2px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== list-over-flow-gap ==&lt;br /&gt;
&lt;br /&gt;
Sets the gap between list items on overflow=WRAP in direction perpendicular to list direction.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ListView { list-over-flow-gap: 2px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== line-height ==&lt;br /&gt;
&lt;br /&gt;
Styles the line height as a percentage of the font height in the TextAreaBox.&lt;br /&gt;
&lt;br /&gt;
Value: Number&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TextAreaBox { line-height: 1.2; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Attributes =&lt;br /&gt;
&lt;br /&gt;
== overflow ==&lt;br /&gt;
&lt;br /&gt;
Specifies how to layout items on overflow in the ListView.&lt;br /&gt;
&lt;br /&gt;
Value: Overflow&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;ListView { overflow: wrap; }&lt;br /&gt;
&lt;br /&gt;
ListView[overflow=wrap] {&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== edge-navigation ==&lt;br /&gt;
&lt;br /&gt;
Specifies the navigation behavior when the first or last list item is selected and the key for next or previous list item is pressed.&lt;br /&gt;
&lt;br /&gt;
Value: EdgeNavigation&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;ListView { edge-navigation: wrap; }&lt;br /&gt;
&lt;br /&gt;
ListView[edge-navigation=wrap] {&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== orientation ==&lt;br /&gt;
&lt;br /&gt;
Specifies the orientation of the ListView.&lt;br /&gt;
&lt;br /&gt;
Value: Orientation&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;ListView { orientation: vertical; }&lt;br /&gt;
&lt;br /&gt;
ListView[orientation=vertical] {&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== date-format ==&lt;br /&gt;
&lt;br /&gt;
Specifies the accepted date format of the DateBox.&lt;br /&gt;
&lt;br /&gt;
Value: DateFormat&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;DateBox { date-format: YYYYMMDD; }&lt;br /&gt;
&lt;br /&gt;
DateBox[date-format=YYYYMMDD] {&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== visibility ==&lt;br /&gt;
&lt;br /&gt;
It specifies whether an element is visible.&lt;br /&gt;
&lt;br /&gt;
Value: Visibility&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;Tag:read-only &amp;gt; Button {&lt;br /&gt;
 visibility: none;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Expression (Function) =&lt;br /&gt;
&lt;br /&gt;
== chain ==&lt;br /&gt;
&lt;br /&gt;
It chains two Expressions together, evaluating to the first until the first expression terminates, and then evaluating to the second.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chain(expression1, expression2)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;TextBox {&lt;br /&gt;
    border-color: chain(timeout(0xB71C1C, 550ms), revert);&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== linear ==&lt;br /&gt;
&lt;br /&gt;
It calculates a linear transition between two sub-expressions.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;linear(initial-expression, end-expression, duration)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;TextBox {&lt;br /&gt;
    border-color: linear(0xB71C1C, revert, 300ms);&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== minimum ==&lt;br /&gt;
&lt;br /&gt;
It calculates the minimum of two values.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;min(expression1, expression2) &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;Box {&lt;br /&gt;
    border-size: min(10, 20);&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== revert ==&lt;br /&gt;
&lt;br /&gt;
It reverts a property's value as if it had not been set by the current rule. It doesn’t take any parameters.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;revert&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;TextBox {&lt;br /&gt;
    border-color: chain(timeout(0xF2F2FF, 250ms),&lt;br /&gt;
    linear(0xF2F2FF, revert, 300ms));&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== timeout ==&lt;br /&gt;
&lt;br /&gt;
It evaluates an expression for a specified duration and then terminates.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;timout(expression, duration)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;TextBox {&lt;br /&gt;
    border-color: chain(timeout(0xB71C1C, 550ms), revert);&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Some examples =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Child selector with pseudo-classes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;Button&lt;br /&gt;
style.get((Checked() &amp;amp;&amp;amp; !Hover() &amp;amp;&amp;amp; !Press()) &amp;gt; is_a&amp;lt;Icon&amp;gt;()).&lt;br /&gt;
    set(Fill(QColor(0x7F5EEC)));&lt;br /&gt;
&lt;br /&gt;
Button:checked:not(:hover):not(:press) &amp;gt; Icon {&lt;br /&gt;
    fill: 0x7F5EEC;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Flip in the DecimalBox ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;update_style(*decimal_box, [] (auto&amp;amp; style) {&lt;br /&gt;
  style.get(ReadOnly() &amp;gt; is_a&amp;lt;Button&amp;gt;()).set(Visibility::NONE);&lt;br /&gt;
  style.get(+Any() &amp;gt; (is_a&amp;lt;Button&amp;gt;() &amp;amp;&amp;amp; !matches(Visibility::NONE))).&lt;br /&gt;
    set(PaddingRight(scale_width(24)));&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
DecimalBox {&lt;br /&gt;
    &amp;amp; :read-only {&lt;br /&gt;
        Button {&lt;br /&gt;
            visibility: none;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :flip(&amp;gt; Button:not([visibility=none])) {&lt;br /&gt;
        padding-right: 24px;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Clear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;update_style(*m_text_box, [] (auto&amp;amp; style) {&lt;br /&gt;
  style.get(ReadOnly()).clear();&lt;br /&gt;
  style.get(Disabled()).clear();&lt;br /&gt;
  style.get(ReadOnly() &amp;amp;&amp;amp; Disabled()).clear();&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
DropDownBox &amp;gt; TextBox {&lt;br /&gt;
    &amp;amp; :read-only {&lt;br /&gt;
        all: unset;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :disabled {&lt;br /&gt;
        all: unset;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :read-only:disabled {&lt;br /&gt;
        all: unset;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Update icons for the Slider ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt; auto track_image = QImage(&amp;quot;:/Icons/hue-spectrum.png&amp;quot;);&lt;br /&gt;
 auto thumb_image =&lt;br /&gt;
   imageFromSvg(&amp;quot;:/Icons/color-thumb.svg&amp;quot;, scale(14, 14));&lt;br /&gt;
 update_style(*slider, [&amp;amp;] (auto&amp;amp; style) {&lt;br /&gt;
   style.get(Any() &amp;gt; Track()).set(IconImage(track_image));&lt;br /&gt;
   style.get(Any() &amp;gt; Thumb() &amp;gt; is_a&amp;lt;Icon&amp;gt;()).&lt;br /&gt;
     set(Fill(boost::optional&amp;lt;QColor&amp;gt;())).&lt;br /&gt;
     set(IconImage(thumb_image));&lt;br /&gt;
   style.get(Focus() &amp;gt; Thumb() &amp;gt; is_a&amp;lt;Icon&amp;gt;()).&lt;br /&gt;
     set(Fill(QColor(0x808080)));&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Slider {&lt;br /&gt;
    ::track {&lt;br /&gt;
        icon-image: url(&amp;quot;:/Icons/hue-spectrum.png&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    ::thumb &amp;gt; Icon {&lt;br /&gt;
        icon-image: url(&amp;quot;:/Icons/color-thumb.svg&amp;quot;) 14px 14px;&lt;br /&gt;
        fill: none;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :focus {&lt;br /&gt;
        ::thumb &amp;gt; Icon {&lt;br /&gt;
            fill: 0x808080;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LabelButton styling ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt; style.get(Any() &amp;gt; Body()).&lt;br /&gt;
   set(TextAlign(Qt::Alignment(Qt::AlignCenter))).&lt;br /&gt;
   set(border(scale_width(1), QColor(Qt::transparent))).&lt;br /&gt;
   set(BackgroundColor(QColor(0xEBEBEB))).&lt;br /&gt;
   set(horizontal_padding(scale_width(8)));&lt;br /&gt;
 style.get(Hover() &amp;gt; Body()).&lt;br /&gt;
   set(TextColor(QColor(0xFFFFFF))).&lt;br /&gt;
   set(BackgroundColor(QColor(0x4B23A0)));&lt;br /&gt;
 style.get(Press() &amp;gt; Body()).&lt;br /&gt;
   set(TextColor(QColor(0xFFFFFF))).&lt;br /&gt;
   set(BackgroundColor(QColor(0x7E71B8)));&lt;br /&gt;
 style.get(FocusVisible() &amp;gt; Body()).set(border_color(QColor(0x4B23A0)));&lt;br /&gt;
 style.get(Disabled() &amp;gt; Body()).set(TextColor(QColor(0xB8B8B8)));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Button {&lt;br /&gt;
     ::body {&lt;br /&gt;
         text-align: center;&lt;br /&gt;
         boder: 1px transparent;&lt;br /&gt;
         background-color: 0xEBEBEB;&lt;br /&gt;
         horizontal-padding: 8px;&lt;br /&gt;
     }&lt;br /&gt;
     &amp;amp;:hover {&lt;br /&gt;
         ::body {&lt;br /&gt;
             text-color: 0xFFFFFF;&lt;br /&gt;
             background-color: 0x4B23A0;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
     &amp;amp;:press {&lt;br /&gt;
         ::body {&lt;br /&gt;
             text-color: 0xFFFFFF;&lt;br /&gt;
             background-color: 0x7E71B8;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
     &amp;amp;:focus-visible {&lt;br /&gt;
         ::body {&lt;br /&gt;
             border-color: 0x4B23A0;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
     &amp;amp;:disabled {&lt;br /&gt;
         ::body {&lt;br /&gt;
             text-color: 0xB8B8B8;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DeleteIconButton styling ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;update_style(*button, [] (auto&amp;amp; style) {&lt;br /&gt;
  style.get(Any() &amp;gt; is_a&amp;lt;Box&amp;gt;()).&lt;br /&gt;
    set(BackgroundColor(QColor(Qt::transparent)));&lt;br /&gt;
  style.get(Any() &amp;gt; is_a&amp;lt;Icon&amp;gt;()).&lt;br /&gt;
    set(BackgroundColor(QColor(Qt::transparent))).&lt;br /&gt;
    set(Fill(QColor(0xA0A0A0)));&lt;br /&gt;
  style.get((Hover() || Press()) &amp;gt; is_a&amp;lt;Icon&amp;gt;()).&lt;br /&gt;
    set(BackgroundColor(QColor(0xEBEBEB))).&lt;br /&gt;
    set(Fill(QColor(0x4B23A0)));&lt;br /&gt;
  style.get(Disabled() &amp;gt; is_a&amp;lt;Icon&amp;gt;()).set(Fill(QColor(0xD0D0D0)));&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
Button {&lt;br /&gt;
    Box {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
    }&lt;br /&gt;
    Icon {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
        fill: 0xA0A0A0;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :hover,&lt;br /&gt;
    &amp;amp; :press {&lt;br /&gt;
        Icon {&lt;br /&gt;
            background-color: 0xEBEBEB;&lt;br /&gt;
            fill: 0x4B23A0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :disabled {&lt;br /&gt;
        Icon {&lt;br /&gt;
            fill: 0xD0D0D0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== TextBox styling ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;TextBox&lt;br /&gt;
auto style = StyleSheet();&lt;br /&gt;
auto font = QFont(&amp;quot;Roboto&amp;quot;);&lt;br /&gt;
font.setWeight(QFont::Normal);&lt;br /&gt;
font.setPixelSize(scale_width(12));&lt;br /&gt;
style.get(Any()).&lt;br /&gt;
  set(BackgroundColor(QColor(0xFFFFFF))).&lt;br /&gt;
  set(border(scale_width(1), QColor(0xC8C8C8))).&lt;br /&gt;
  set(text_style(font, QColor(Qt::black))).&lt;br /&gt;
  set(TextAlign(Qt::Alignment(Qt::AlignLeft) | Qt::AlignVCenter)).&lt;br /&gt;
  set(horizontal_padding(scale_width(8))).&lt;br /&gt;
  set(vertical_padding(scale_height(5)));&lt;br /&gt;
style.get(Hover() || Focus()).&lt;br /&gt;
  set(border_color(QColor(0x4B23A0)));&lt;br /&gt;
style.get(ReadOnly()).&lt;br /&gt;
  set(BackgroundColor(QColor(Qt::transparent))).&lt;br /&gt;
  set(border_color(QColor(Qt::transparent))).&lt;br /&gt;
  set(horizontal_padding(0));&lt;br /&gt;
style.get(Disabled()).&lt;br /&gt;
  set(BackgroundColor(QColor(0xF5F5F5))).&lt;br /&gt;
  set(border_color(QColor(0xC8C8C8))).&lt;br /&gt;
  set(TextColor(QColor(0xC8C8C8)));&lt;br /&gt;
style.get(ReadOnly() &amp;amp;&amp;amp; Disabled()).&lt;br /&gt;
  set(BackgroundColor(QColor(Qt::transparent))).&lt;br /&gt;
  set(border_color(QColor(Qt::transparent)));&lt;br /&gt;
style.get(Rejected()).&lt;br /&gt;
  set(BackgroundColor(chain(timeout(QColor(0xFFF1F1), milliseconds(250)),&lt;br /&gt;
    linear(QColor(0xFFF1F1), revert, milliseconds(300))))).&lt;br /&gt;
  set(border_color(&lt;br /&gt;
    chain(timeout(QColor(0xB71C1C), milliseconds(550)), revert)));&lt;br /&gt;
style.get(Placeholder()).set(TextColor(QColor(0xA0A0A0)));&lt;br /&gt;
style.get(Disabled() &amp;gt; Placeholder()).set(TextColor(QColor(0xC8C8C8)));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;TextBox {&lt;br /&gt;
    background-color: 0xFFFFFF;&lt;br /&gt;
    border: 1px 0xC8C8C8;&lt;br /&gt;
    text-style: normal 12px &amp;quot;Roboto&amp;quot; black;&lt;br /&gt;
    text-align: left;&lt;br /&gt;
    horizontal-padding: 8px;&lt;br /&gt;
    vertical-padding: 5px;&lt;br /&gt;
    &amp;amp; :hover,&lt;br /&gt;
    &amp;amp; :focus {&lt;br /&gt;
        border-color: 0x4B23A0;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :read-only {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
        border-color: transparent;&lt;br /&gt;
        horizontal-padding: 0px;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :disabled {&lt;br /&gt;
        background-color: 0xF5F5F5;&lt;br /&gt;
        border-color: 0xC8C8C8;&lt;br /&gt;
        text-color: 0xC8C8C8;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :read-only:disabled {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
        border-color: transparent;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :rejected {&lt;br /&gt;
        background-color: chain(timeout(0xB71C1C, 250ms), linear(0xFFF1F1, revert, 300ms));&lt;br /&gt;
        border-color: chain(timeout(0xB71C1C, 550ms), revert);&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; ::placeholder {&lt;br /&gt;
        text-color: 0xA0A0A0;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :disabled::placeholder {&lt;br /&gt;
        text-color: 0xC8C8C8;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DropDownBox styling ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;auto style = StyleSheet();&lt;br /&gt;
style.get(ReadOnly() &amp;gt; is_a&amp;lt;TextBox&amp;gt;()).&lt;br /&gt;
  set(BackgroundColor(QColor(Qt::transparent))).&lt;br /&gt;
  set(border_color(QColor(Qt::transparent))).&lt;br /&gt;
  set(horizontal_padding(0));&lt;br /&gt;
style.get(Disabled() &amp;gt; is_a&amp;lt;TextBox&amp;gt;()).&lt;br /&gt;
  set(BackgroundColor(QColor(0xF5F5F5))).&lt;br /&gt;
  set(border_color(QColor(0xC8C8C8))).&lt;br /&gt;
  set(TextColor(QColor(0xC8C8C8)));&lt;br /&gt;
style.get((ReadOnly() &amp;amp;&amp;amp; Disabled()) &amp;gt; is_a&amp;lt;TextBox&amp;gt;()).&lt;br /&gt;
  set(BackgroundColor(QColor(Qt::transparent))).&lt;br /&gt;
  set(border_color(QColor(Qt::transparent)));&lt;br /&gt;
style.get(Any() &amp;gt; (is_a&amp;lt;Icon&amp;gt;() &amp;amp;&amp;amp; !(+Any() &amp;lt;&amp;lt; is_a&amp;lt;ListItem&amp;gt;()))).&lt;br /&gt;
  set(Fill(QColor(0x333333))).&lt;br /&gt;
  set(BackgroundColor(QColor(Qt::transparent)));&lt;br /&gt;
style.get(Disabled() &amp;gt; (is_a&amp;lt;Icon&amp;gt;() &amp;amp;&amp;amp; !(+Any() &amp;lt;&amp;lt; is_a&amp;lt;ListItem&amp;gt;()))).&lt;br /&gt;
  set(Fill(QColor(0xC8C8C8)));&lt;br /&gt;
style.get(ReadOnly() &amp;gt; (is_a&amp;lt;Icon&amp;gt;() &amp;amp;&amp;amp; !(+Any() &amp;lt;&amp;lt; is_a&amp;lt;ListItem&amp;gt;()))).&lt;br /&gt;
  set(Visibility::NONE);&lt;br /&gt;
style.get(Any() &amp;gt; (is_a&amp;lt;TextBox&amp;gt;() &amp;amp;&amp;amp; !(+Any() &amp;lt;&amp;lt; is_a&amp;lt;ListItem&amp;gt;()))).&lt;br /&gt;
  set(PaddingRight(scale_width(14)));&lt;br /&gt;
style.get(PopUp() &amp;gt; is_a&amp;lt;TextBox&amp;gt;() ||&lt;br /&gt;
    (+Any() &amp;gt; is_a&amp;lt;Button&amp;gt;() &amp;amp;&amp;amp; (Hover() || FocusIn())) &amp;gt; is_a&amp;lt;TextBox&amp;gt;()).&lt;br /&gt;
  set(border_color(QColor(0x4B23A0)));&lt;br /&gt;
style.get(ReadOnly() &amp;gt; (is_a&amp;lt;TextBox&amp;gt;() &amp;amp;&amp;amp; !(+Any() &amp;lt;&amp;lt; is_a&amp;lt;ListItem&amp;gt;()))).&lt;br /&gt;
  set(horizontal_padding(0)).&lt;br /&gt;
  set(border_color(QColor(Qt::transparent))).&lt;br /&gt;
  set(BackgroundColor(QColor(Qt::transparent)));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;DropDownBox {&lt;br /&gt;
    &amp;amp; :read-only &amp;gt; TextBox {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
        border-color: transparent;&lt;br /&gt;
        horizontal-padding: 0;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :disabled &amp;gt; TextBox {&lt;br /&gt;
        background-color: 0xF5F5F5;&lt;br /&gt;
        border-color: 0xC8C8C8;&lt;br /&gt;
        text-color: 0xC8C8C8;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :read-only:disabled &amp;gt; TextBox {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
        border-color: transparent;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :not(:flip(:has(&amp;gt;&amp;gt; ListItem))) {&lt;br /&gt;
        Icon {&lt;br /&gt;
            fill: 0x333333;&lt;br /&gt;
            background-color: transparent;&lt;br /&gt;
        }&lt;br /&gt;
        TextBox {&lt;br /&gt;
            padding-right: 14px;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :disabled:not(:flip(:has(&amp;gt;&amp;gt; ListItem))) &amp;gt; Icon {&lt;br /&gt;
        fill: 0xC8C8C8;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :read-only:not(:flip(:has(&amp;gt;&amp;gt; ListItem))) &amp;gt; Icon {&lt;br /&gt;
        visibility: none;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :pop-up,&lt;br /&gt;
    &amp;amp; :hover:flip(&amp;gt; Button),&lt;br /&gt;
    &amp;amp; :focus-in:flip(&amp;gt; Button) {&lt;br /&gt;
        TextBox {&lt;br /&gt;
            border-color: 0x4B23A0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :read-only:not(:flip(:has(&amp;gt;&amp;gt; ListItem))) {&lt;br /&gt;
        TextBox {&lt;br /&gt;
            horizontal-padding: 0;&lt;br /&gt;
            border-color: transparent;&lt;br /&gt;
            background-color: transparent;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;amp; :pop-up,&lt;br /&gt;
&amp;amp; :flip(&amp;gt; Button):is(:hover, :focus-in) {&lt;br /&gt;
    TextBox {&lt;br /&gt;
        border-color: 0x4B23A0;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== EditableTableView styling ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;    auto style = StyleSheet();&lt;br /&gt;
    auto body_selector = Any() &amp;gt; is_a&amp;lt;TableBody&amp;gt;();&lt;br /&gt;
    auto item_selector = body_selector &amp;gt; Row() &amp;gt; is_a&amp;lt;TableItem&amp;gt;();&lt;br /&gt;
    style.get(item_selector &amp;gt; Any() &amp;gt;&lt;br /&gt;
        (ReadOnly() &amp;amp;&amp;amp; !(+Any() &amp;lt;&amp;lt; is_a&amp;lt;ListItem&amp;gt;()) &amp;amp;&amp;amp; !Prompt())).&lt;br /&gt;
      set(horizontal_padding(scale_width(8)));&lt;br /&gt;
    style.get(item_selector &amp;gt;  Any() &amp;gt; ReadOnly() &amp;gt;&lt;br /&gt;
        (is_a&amp;lt;TextBox&amp;gt;() &amp;amp;&amp;amp; !(+Any() &amp;lt;&amp;lt; is_a&amp;lt;ListItem&amp;gt;()) &amp;amp;&amp;amp; !Prompt())).&lt;br /&gt;
      set(horizontal_padding(scale_width(8)));&lt;br /&gt;
    style.get((item_selector &amp;gt; !ReadOnly()) &amp;lt;&amp;lt; Current()).&lt;br /&gt;
      set(border_color(QColor(Qt::transparent)));&lt;br /&gt;
    style.get(body_selector &amp;gt; Row() &amp;gt; Current()).&lt;br /&gt;
      set(BackgroundColor(Qt::transparent));&lt;br /&gt;
    style.get(body_selector &amp;gt; Row() &amp;gt; HoverItem()).&lt;br /&gt;
      set(border_color(QColor(0xA0A0A0)));&lt;br /&gt;
    style.get(body_selector &amp;gt; (Row() &amp;amp;&amp;amp; Hover())).&lt;br /&gt;
      set(BackgroundColor(0xF2F2FF));&lt;br /&gt;
    style.get(item_selector &amp;gt; DeleteButton()).&lt;br /&gt;
      set(Visibility(Visibility::INVISIBLE));&lt;br /&gt;
    style.get(item_selector &amp;gt; DeleteButton() &amp;gt; is_a&amp;lt;Box&amp;gt;()).&lt;br /&gt;
      set(BackgroundColor(QColor(Qt::transparent))).&lt;br /&gt;
      set(horizontal_padding(scale_width(2))).&lt;br /&gt;
      set(vertical_padding(scale_height(2)));&lt;br /&gt;
    style.get(item_selector &amp;gt; DeleteButton() &amp;gt; is_a&amp;lt;Icon&amp;gt;()).&lt;br /&gt;
      set(BackgroundColor(QColor(Qt::transparent)));&lt;br /&gt;
    style.get(body_selector &amp;gt; (CurrentRow() || (Row() &amp;amp;&amp;amp; Hover())) &amp;gt;&lt;br /&gt;
        is_a&amp;lt;TableItem&amp;gt;() &amp;gt; DeleteButton()).&lt;br /&gt;
      set(Visibility(Visibility::VISIBLE));&lt;br /&gt;
    style.get((body_selector &amp;gt; (CurrentRow() || (Row() &amp;amp;&amp;amp; Hover()))) &amp;gt;&lt;br /&gt;
        DeleteButton() &amp;gt; is_a&amp;lt;Icon&amp;gt;()).&lt;br /&gt;
      set(Fill(QColor(0x535353)));&lt;br /&gt;
    style.get(body_selector &amp;gt; (Row() &amp;amp;&amp;amp; Hover()) &amp;gt; DeleteButton() &amp;gt;&lt;br /&gt;
        (is_a&amp;lt;Icon&amp;gt;() &amp;amp;&amp;amp; Hover())).&lt;br /&gt;
      set(BackgroundColor(QColor(0xDFDFEB))).&lt;br /&gt;
      set(Fill(QColor(0xB71C1C)));&lt;br /&gt;
    style.get(body_selector &amp;gt; CurrentRow() &amp;gt; DeleteButton() &amp;gt;&lt;br /&gt;
        (is_a&amp;lt;Icon&amp;gt;() &amp;amp;&amp;amp; Hover())).&lt;br /&gt;
      set(BackgroundColor(QColor(0xD0CEEB))).&lt;br /&gt;
      set(Fill(QColor(0xB71C1C)));&lt;br /&gt;
    style.get((item_selector &amp;gt; EmptyCell()) &amp;lt;&amp;lt; (HoverItem() || Current())).&lt;br /&gt;
      set(border_color(QColor(Qt::transparent)));&lt;br /&gt;
    style.get(body_selector &amp;gt; CurrentRow()).&lt;br /&gt;
      set(BackgroundColor(QColor(0xE2E0FF)));&lt;br /&gt;
    style.get(body_selector &amp;gt; CurrentColumn()).&lt;br /&gt;
      set(BackgroundColor(Qt::transparent));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;EditableTableView {&lt;br /&gt;
    TableBody {&lt;br /&gt;
        TableBody::row {&lt;br /&gt;
            TableItem {&lt;br /&gt;
                * {&lt;br /&gt;
                    :not(:flip(:has(&amp;gt;&amp;gt; ListItem))) {&lt;br /&gt;
                        :read-only:not(KeyInputBox::prompt) {&lt;br /&gt;
                            horizontal-padding: 8px;&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                    :read-only:not(:flip(:has(&amp;gt;&amp;gt; ListItem))) {&lt;br /&gt;
                        TextBox:not(KeyInputBox::prompt) {&lt;br /&gt;
                            horizontal-padding: 8px;&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            &amp;amp; :current:has(&amp;gt; :not(:read-only)) {&lt;br /&gt;
                border-color: transparent;&lt;br /&gt;
            }&lt;br /&gt;
            &amp;amp; :current {&lt;br /&gt;
                background-color: transparent;&lt;br /&gt;
            }&lt;br /&gt;
            &amp;amp; :hover-item {&lt;br /&gt;
                border-color: 0xA0A0A0;&lt;br /&gt;
            }&lt;br /&gt;
            ::delete-button {&lt;br /&gt;
                visibility: invisible;&lt;br /&gt;
                Box {&lt;br /&gt;
                    background-color: transparent;&lt;br /&gt;
                    horizontal-padding: 2px;&lt;br /&gt;
                    vertical-padding: 2px;&lt;br /&gt;
                }&lt;br /&gt;
                Icon {&lt;br /&gt;
                    background-color: transparent;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            &amp;amp; :has(&amp;gt; ::empty-cell) {&lt;br /&gt;
                &amp;amp; :hover-item,&lt;br /&gt;
                &amp;amp; :current {&lt;br /&gt;
                    border-color: transparent;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &amp;amp; :hover {&lt;br /&gt;
            background-color: 0xF2F2FF;&lt;br /&gt;
            TableItem::delete-button {&lt;br /&gt;
                visibility: visible;&lt;br /&gt;
                Icon {&lt;br /&gt;
                    fill: 0x535353;&lt;br /&gt;
                    &amp;amp; :hover {&lt;br /&gt;
                        background-color: 0xDFDFEB;&lt;br /&gt;
                        fill: 0xB71C1C;&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &amp;amp; :current-row {&lt;br /&gt;
            background-color: 0xE2E0FF;&lt;br /&gt;
            TableItem::delete-button {&lt;br /&gt;
                visibility: visible;&lt;br /&gt;
                Icon {&lt;br /&gt;
                    fill: 0x535353;&lt;br /&gt;
                    &amp;amp; :hover {&lt;br /&gt;
                        background-color: 0xDFDFEB;&lt;br /&gt;
                        fill: 0xB71C1C;&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &amp;amp; :current-column {&lt;br /&gt;
            background-color: transparent;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Styling_Grammar&amp;diff=228</id>
		<title>Styling Grammar</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Styling_Grammar&amp;diff=228"/>
		<updated>2024-09-06T19:24:31Z</updated>

		<summary type="html">&lt;p&gt;Jon: Detailed reference of the styling grammar for the UI.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Syntax =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Declarations ==&lt;br /&gt;
&lt;br /&gt;
A property and value pair is called a declaration'''.''' The pair is separated by a colon, '&amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;'. White spaces are ignored. Properties and values are case-insensitive. If the value is invalid for the property, the declaration will be ignored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Property            value&lt;br /&gt;
background-color:   white&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Declaration blocks ==&lt;br /&gt;
&lt;br /&gt;
A pair of brackets, ‘&amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt;’ and ‘&amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt;’, are used to group multiple declarations into a block. The semicolon ‘&amp;lt;code&amp;gt;;&amp;lt;/code&amp;gt;’ is used to separate different declarations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{&lt;br /&gt;
    background-color: white;&lt;br /&gt;
    border-size: 1px;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Selector ==&lt;br /&gt;
&lt;br /&gt;
The selector specifies which components are being applied for styles.&lt;br /&gt;
&lt;br /&gt;
Selector types:&lt;br /&gt;
&lt;br /&gt;
{|  class=&amp;quot;wikitable simple-table&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|  | '''Selector'''&lt;br /&gt;
|  | '''Explanation'''&lt;br /&gt;
|  | '''Example'''&lt;br /&gt;
|  | '''Spire styling'''&lt;br /&gt;
|-&lt;br /&gt;
|  | Any selector (universal selector)&lt;br /&gt;
|  | Selects all components.&lt;br /&gt;
|  | *&lt;br /&gt;
|  | Any()&lt;br /&gt;
|-&lt;br /&gt;
|  | Type selector&lt;br /&gt;
|  | Selects all instances of the selector and of its subclasses.&lt;br /&gt;
|  | TextBox&lt;br /&gt;
|  | is_a&amp;lt;Type&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  | Property selector&lt;br /&gt;
|  | Selects elements based on the element having a given attribute explicitly set.&lt;br /&gt;
|  | Button[visibility=none]&amp;lt;br /&amp;gt;&lt;br /&gt;
Button:not([visibility=none])&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|  | Button &amp;amp;&amp;amp; matches(Visibility::NONE)&amp;lt;br /&amp;gt;&lt;br /&gt;
Button &amp;amp;&amp;amp; !matches(Visibility::NONE)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  | &amp;amp; nesting selector&lt;br /&gt;
|  | The &amp;amp; nesting selector makes the nested child rule selectors relative to the parent element. Without the &amp;amp; nesting selector, the child rule selector selects child elements.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;parentRule {&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/* parent rule style properties */&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp; childRule {&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/* child rule style properties */&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
}&amp;lt;br /&amp;gt;&lt;br /&gt;
}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|  |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The class selector and ID selector in CSS are not supported since the Spire styling doesn’t support them.&lt;br /&gt;
&lt;br /&gt;
{|  class=&amp;quot;wikitable simple-table&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| | &amp;lt;s&amp;gt;Class selector&amp;lt;/s&amp;gt;&lt;br /&gt;
| | Selects all instances of the selector.&lt;br /&gt;
| | .TextBox&lt;br /&gt;
| | Not support&lt;br /&gt;
|-&lt;br /&gt;
| | &amp;lt;s&amp;gt;ID selector&amp;lt;/s&amp;gt;&lt;br /&gt;
| | Matches all instances that has a specific object name.&lt;br /&gt;
| | #my-label&lt;br /&gt;
| | Not support&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Pseudo-classes ==&lt;br /&gt;
&lt;br /&gt;
The pseudo-class specifies a given state to the components. It starts with a colon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;:pseudo-class {&lt;br /&gt;
  property: value;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
{|  class=&amp;quot;wikitable simple-table&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| | '''Selector'''&lt;br /&gt;
|  | '''Explanation'''&lt;br /&gt;
| | '''Related components'''&lt;br /&gt;
|-&lt;br /&gt;
| | :active&lt;br /&gt;
|  | Selects a component that is or belongs to the active window.&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :disabled&lt;br /&gt;
|  | Selects a disabled component.&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :hover&lt;br /&gt;
|  | Selects a hovered component.&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :focus&lt;br /&gt;
|  | Selects a focused component.&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :focus-in&lt;br /&gt;
|  | Selects a component that has focus or has a child that has focus..&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :focus-visible&lt;br /&gt;
|  | Selects a component if it was focused using a non-pointing device&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :drag&lt;br /&gt;
|  | Selects a Dragged component.&lt;br /&gt;
| | SplitView, ScrollBar&lt;br /&gt;
|-&lt;br /&gt;
| | :press&lt;br /&gt;
|  | Selects a pressed component.&lt;br /&gt;
| | Button, Slider, Slider2D, MenuButton&lt;br /&gt;
|-&lt;br /&gt;
| | :read-only&lt;br /&gt;
|  | Selects a read-only component.&lt;br /&gt;
| | All input boxes.&lt;br /&gt;
|-&lt;br /&gt;
| | :rejected&lt;br /&gt;
|  | Selects a a component whose input value is rejected.&lt;br /&gt;
| | TextBox, DurationBox, DestinationBox, SaleConditionBox, DateBox&lt;br /&gt;
|-&lt;br /&gt;
| | :checked&lt;br /&gt;
|  | Selects a checked CheckBox.&lt;br /&gt;
| | CheckBox&lt;br /&gt;
|-&lt;br /&gt;
| | :selected&lt;br /&gt;
|  | Selects a selected list item.&lt;br /&gt;
| | ListItem&lt;br /&gt;
|-&lt;br /&gt;
| | :current&lt;br /&gt;
|  | Selects the current list item.&lt;br /&gt;
| | ListItem&lt;br /&gt;
|-&lt;br /&gt;
| | :precedes-current&lt;br /&gt;
|  | Selects the list item precedes the current item.&lt;br /&gt;
| | ListItem&lt;br /&gt;
|-&lt;br /&gt;
| | :hover-item&lt;br /&gt;
|  | Selects the hovered table item&lt;br /&gt;
| | TableItem&lt;br /&gt;
|-&lt;br /&gt;
| | :current-row&lt;br /&gt;
|  | Selects the current row in the table.&lt;br /&gt;
| | TableBody&lt;br /&gt;
|-&lt;br /&gt;
| | :current-column&lt;br /&gt;
|  | Selects the current column in the table.&lt;br /&gt;
| | TableBody&lt;br /&gt;
|-&lt;br /&gt;
| | :sortable&lt;br /&gt;
|  | Selects the column when it's sort order is not UNORDERED.&lt;br /&gt;
| | TableHeaderItem&lt;br /&gt;
|-&lt;br /&gt;
| | :filtered&lt;br /&gt;
|  | Selects the column when a filter is applied.&lt;br /&gt;
| | TableHeaderItem&lt;br /&gt;
|-&lt;br /&gt;
| | :pop-up&lt;br /&gt;
|  | Selects the widget displaying a pop-up.&lt;br /&gt;
| | DropDownBox&lt;br /&gt;
|-&lt;br /&gt;
| | :high-lighted&lt;br /&gt;
|  | Selects the highlighted widget.&lt;br /&gt;
| | ColorSwatch&lt;br /&gt;
|-&lt;br /&gt;
| | :is-positive&lt;br /&gt;
|  | Selects the DecimalBox when its value is positive.&lt;br /&gt;
| | DecimalBox&lt;br /&gt;
|-&lt;br /&gt;
| | :is-negative&lt;br /&gt;
|  | Selects the DecimalBox when its value is negative.&lt;br /&gt;
| | DecimalBox&lt;br /&gt;
|-&lt;br /&gt;
| | :uptick&lt;br /&gt;
|  | Selects the DecimalBox when its value has increased.&lt;br /&gt;
| | DecimalBox&lt;br /&gt;
|-&lt;br /&gt;
| | :downtick&lt;br /&gt;
|  | Selects the DecimalBox when its value has decreased.&lt;br /&gt;
| | DecimalBox&lt;br /&gt;
|-&lt;br /&gt;
| | :modifier-key&lt;br /&gt;
|  | Selects the KeyTag when it's displaying a modifier key.&lt;br /&gt;
| | KeyTag&lt;br /&gt;
|-&lt;br /&gt;
| | :escape-key&lt;br /&gt;
|  | Selects the KeyTag when it's displaying the ESC key.&lt;br /&gt;
| | KeyTag&lt;br /&gt;
|-&lt;br /&gt;
| | :today&lt;br /&gt;
|  | Selects the CalendarDatePicker when the current day is today.&lt;br /&gt;
| | CalendarDatePicker&lt;br /&gt;
|-&lt;br /&gt;
| | :out-of-month&lt;br /&gt;
|  | Selects the CalendarDatePicker when a day is outside of the current month.&lt;br /&gt;
| | CalendarDatePicker&lt;br /&gt;
|-&lt;br /&gt;
| | :has()&lt;br /&gt;
|  | Takes a selector as its argument and matches any element matching this selector.&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :not()&lt;br /&gt;
|  | Selects a component that is not selected by a selector.&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :flip()&lt;br /&gt;
|  | Flips what elements are selected.&lt;br /&gt;
| | All components&lt;br /&gt;
|-&lt;br /&gt;
| | :is()&lt;br /&gt;
|  | Selects any element that can be selected by one of the selectors in its list.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;:is(selector1, selector2, ...)&amp;lt;/code&amp;gt;&lt;br /&gt;
| | All components&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Pseudo-elements ==&lt;br /&gt;
&lt;br /&gt;
A pseudo-element selects components that are the specific part of a selector. The pseudo-element must be used in combination with a block-level element selector. This means you cannot use pseudo-elements on its own without specifying a block-level element. Pseudo-elements start with a double colon &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;selector::pseudo-element {&lt;br /&gt;
  property: value;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
{|  class=&amp;quot;wikitable simple-table&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| | '''Selector'''&lt;br /&gt;
| | '''Explanation'''&lt;br /&gt;
| | '''Related components'''&lt;br /&gt;
| | '''Spire styling'''&lt;br /&gt;
|-&lt;br /&gt;
| | ::placeholder&lt;br /&gt;
| | Select the placeholder in the text box.&lt;br /&gt;
| | TextBox, TextAreaBox&lt;br /&gt;
| | &amp;lt;code&amp;gt;PseudoElement&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Sub-controls ==&lt;br /&gt;
&lt;br /&gt;
Selectors can contain sub-controls that make it possible to restrict the application of a rule to specific sub-controls. Its syntax is same as pseudo-element’s.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;selector::sub-controls{&lt;br /&gt;
  property: value;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
{|  class=&amp;quot;wikitable simple-table&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| | '''Selector'''&lt;br /&gt;
| | '''Explanation'''&lt;br /&gt;
| | '''Related components'''&lt;br /&gt;
|-&lt;br /&gt;
| | ::row&lt;br /&gt;
| | Selects all rows in the table.&lt;br /&gt;
| | TableBody&lt;br /&gt;
|-&lt;br /&gt;
| | ::column&lt;br /&gt;
| | Selects all columns in the table.&lt;br /&gt;
| | TableBody&lt;br /&gt;
|-&lt;br /&gt;
| | ::prompt&lt;br /&gt;
| | Selects the prompt in a key input box.&lt;br /&gt;
| | KeyInputBox&lt;br /&gt;
|-&lt;br /&gt;
| | ::divider&lt;br /&gt;
| | Selects the divider.&lt;br /&gt;
| | TabView, SplitView&lt;br /&gt;
|-&lt;br /&gt;
| | ::body&lt;br /&gt;
| | Selects the body component of a box or button.&lt;br /&gt;
| | Box, Button&lt;br /&gt;
|-&lt;br /&gt;
| | ::empty-cell&lt;br /&gt;
| | Selects the empty table cell in the EditableTableView.&lt;br /&gt;
| | TableItem(EditableTableView)&lt;br /&gt;
|-&lt;br /&gt;
| | ::delete-button&lt;br /&gt;
| | Selects the delete button in the EditableTableView.&lt;br /&gt;
| | TableItem(EditableTableView)&lt;br /&gt;
|-&lt;br /&gt;
| | ::label&lt;br /&gt;
| | Selects the label inside the TableHeaderItem.&lt;br /&gt;
| | TableHeaderItem&lt;br /&gt;
|-&lt;br /&gt;
| | ::filter-button&lt;br /&gt;
| | Selects the filter button inside the TableHeaderItem.&lt;br /&gt;
| | TableHeaderItem&lt;br /&gt;
|-&lt;br /&gt;
| | ::hover-element&lt;br /&gt;
| | Selects the hover element inside the TableHeaderItem.&lt;br /&gt;
| | TableHeaderItem&lt;br /&gt;
|-&lt;br /&gt;
| | ::track&lt;br /&gt;
| | Selects the track of the slider.&lt;br /&gt;
| | Slider, Slider2D&lt;br /&gt;
|-&lt;br /&gt;
| | ::thumb&lt;br /&gt;
| | Selects the thumb of the slider.&lt;br /&gt;
| | Slider, Slider2D&lt;br /&gt;
|-&lt;br /&gt;
| | ::track-rail&lt;br /&gt;
| | Selects the track rail of the slider.&lt;br /&gt;
| | Slider&lt;br /&gt;
|-&lt;br /&gt;
| | ::track-fill&lt;br /&gt;
| | Selects the track fill of the slider.&lt;br /&gt;
| | Slider&lt;br /&gt;
|-&lt;br /&gt;
| | ::track-pad&lt;br /&gt;
| | Selects the track pad of the 2d slider.&lt;br /&gt;
| | Slider2D&lt;br /&gt;
|-&lt;br /&gt;
| | ::scrollbar-track&lt;br /&gt;
| | Selects the track of the scroll bar.&lt;br /&gt;
| | ScrollBar&lt;br /&gt;
|-&lt;br /&gt;
| | ::scrollbar-thumb&lt;br /&gt;
| | Selects the thumb of the scroll bar.&lt;br /&gt;
| | ScrollBar&lt;br /&gt;
|-&lt;br /&gt;
| | ::colon&lt;br /&gt;
| | Selects the colon field.&lt;br /&gt;
| | DurationBox&lt;br /&gt;
|-&lt;br /&gt;
| | ::alpha&lt;br /&gt;
| | Selects the alpha component in the ColorCodePanel.&lt;br /&gt;
| | ColorCodePanel&lt;br /&gt;
|-&lt;br /&gt;
| | ::primary&lt;br /&gt;
| | Selects the primary component in the SplitView.&lt;br /&gt;
| | SplitView&lt;br /&gt;
|-&lt;br /&gt;
| | ::secondary&lt;br /&gt;
| | Selects the secondary component in the SplitView.&lt;br /&gt;
| | SplitView&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Selectors Combination ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable simple-table&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| | '''Selector'''&lt;br /&gt;
| | '''Explanation'''&lt;br /&gt;
|  | '''Syntax'''&lt;br /&gt;
|  | '''Example'''&lt;br /&gt;
| | '''CSS supports'''&lt;br /&gt;
|-&lt;br /&gt;
| | Child selector&lt;br /&gt;
| | Selects a component matched by the second selector that is the direct child of the component matched by the first.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;selector1 &amp;gt; selector2&amp;lt;/code&amp;gt;&lt;br /&gt;
|  | &amp;lt;code&amp;gt;TableView &amp;gt; TableBody&amp;lt;/code&amp;gt;&lt;br /&gt;
| | Yes&lt;br /&gt;
|-&lt;br /&gt;
| | Descendant selector&lt;br /&gt;
| | Selects a component matched by the second selector that is the descendant of the component matched by the first.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;selector &amp;gt;&amp;gt; descendant- selector&amp;lt;/code&amp;gt;&lt;br /&gt;
|  | &amp;lt;code&amp;gt;ColorPicker &amp;gt;&amp;gt; Alpha&amp;lt;/code&amp;gt;&lt;br /&gt;
| | Yes, but a single space is used.&lt;br /&gt;
|-&lt;br /&gt;
| | Parent selector&lt;br /&gt;
| | Selects a component matched by the second selector that is the direct parent of the component matched by the first.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;:has(&amp;gt; child-selector)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|  | &amp;lt;code&amp;gt;ListItem:has(&amp;gt; TextBox)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| | The &amp;lt;code&amp;gt;:has() &amp;lt;/code&amp;gt;pseudo-class can achieve the functionality.&lt;br /&gt;
|-&lt;br /&gt;
| | Ancestor selector&lt;br /&gt;
| | Selects a component matched by the second selector that is the ancestor of the component matched by the first.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;:has(&amp;gt;&amp;gt; descendant-selector)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|  | &amp;lt;code&amp;gt;TableItem:has(&amp;gt;&amp;gt; TableItem)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| | The &amp;lt;code&amp;gt;:has() &amp;lt;/code&amp;gt;pseudo-class can achieve the functionality.&lt;br /&gt;
|-&lt;br /&gt;
| | And selector&lt;br /&gt;
| | Selects components that are matched by both selectors.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;&amp;lt;selector1&amp;gt;&amp;lt;selector2&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|  | &amp;lt;code&amp;gt;TextBox:hover&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| | Combining Type selector and Pseudo-Class&lt;br /&gt;
|-&lt;br /&gt;
| | Flip selector&lt;br /&gt;
| | Flips what elements are selected.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;:flip()&amp;lt;/code&amp;gt;&lt;br /&gt;
|  | &amp;lt;code&amp;gt;*:flip(:has(&amp;gt;&amp;gt; ListItem))&amp;lt;/code&amp;gt;&lt;br /&gt;
| | No&lt;br /&gt;
|-&lt;br /&gt;
| | Not selector&lt;br /&gt;
| | Selects a component that is not selected by a selector.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;:not()&amp;lt;/code&amp;gt;&lt;br /&gt;
|  | &amp;lt;code&amp;gt;:not(:hover)&amp;lt;/code&amp;gt;&lt;br /&gt;
| | &amp;lt;code&amp;gt;:not()&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| | Or selector&lt;br /&gt;
| | Selects a component that is selected by at least one of two selectors.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;selector1, selector2&amp;lt;/code&amp;gt;&lt;br /&gt;
|  | &amp;lt;code&amp;gt;:hover, :focus&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;:is(:hover, :focus)&amp;lt;/code&amp;gt;&lt;br /&gt;
| | selector list&lt;br /&gt;
|-&lt;br /&gt;
| | Sibling selector&lt;br /&gt;
| | Selects a component matched by the second selector that is the sibling of the component matched by the first.&lt;br /&gt;
|  | &amp;lt;code&amp;gt;selector % sibling-selector&amp;lt;/code&amp;gt;&lt;br /&gt;
|  | &amp;lt;code&amp;gt;TextBox % Button&amp;lt;/code&amp;gt;&lt;br /&gt;
| | Yes, but &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; is used.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Child selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;is_a&amp;lt;Button&amp;gt;() &amp;gt; is_a&amp;lt;TextBox&amp;gt;()&lt;br /&gt;
&lt;br /&gt;
Button &amp;gt; TextBox {&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Button {&lt;br /&gt;
    TextBox {&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Button {&lt;br /&gt;
    &amp;amp; &amp;gt; TextBox {&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Descendant selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;is_a&amp;lt;Button&amp;gt;() &amp;gt;&amp;gt; is_a&amp;lt;TextBox&amp;gt;()&lt;br /&gt;
&lt;br /&gt;
Button &amp;gt;&amp;gt; TextBox {&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Button {&lt;br /&gt;
    &amp;amp; &amp;gt;&amp;gt; TextBox {&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parent selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;is_a&amp;lt;Button&amp;gt;() &amp;lt; is_a&amp;lt;TextBox&amp;gt;()&lt;br /&gt;
&lt;br /&gt;
Button:has(&amp;gt; TextBox) {&amp;lt;/pre&amp;gt;&lt;br /&gt;
Cases used in practice:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;auto body_selector = Any() &amp;gt; is_a&amp;lt;TableBody&amp;gt;();&lt;br /&gt;
auto item_selector = body_selector &amp;gt; Row() &amp;gt; is_a&amp;lt;TableItem&amp;gt;();&lt;br /&gt;
style.get((item_selector &amp;gt; EmptyCell()) &amp;lt; (HoverItem() || Current())).&lt;br /&gt;
    set(border_color(QColor(Qt::transparent)));&lt;br /&gt;
&lt;br /&gt;
TableView &amp;gt; TableBody &amp;gt; TableBody::row &amp;gt;&lt;br /&gt;
 TableItem:has(&amp;gt; TableItem::empty-cell):hover-item,&lt;br /&gt;
TableView &amp;gt; TableBody &amp;gt; TableBody::row &amp;gt;&lt;br /&gt;
 TableItem:has(&amp;gt; TableItem::empty-cell):current {&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
TableView {&lt;br /&gt;
    TableBody {&lt;br /&gt;
        TableBody::row {&lt;br /&gt;
            TableItem {&lt;br /&gt;
                    &amp;amp;:has(&amp;gt; ::empty-cell) {&lt;br /&gt;
                        &amp;amp; :hover-item,&lt;br /&gt;
                        &amp;amp; :current {&lt;br /&gt;
                            border-color: transparent;&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
TableView {&lt;br /&gt;
    TableBody {&lt;br /&gt;
        TableBody::row {&lt;br /&gt;
            TableItem {&lt;br /&gt;
                    &amp;amp;:has(&amp;gt; ::empty-cell):is(:hover-item, :current) {&lt;br /&gt;
                        border-color: transparent;&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ancestor selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;is_a&amp;lt;Button&amp;gt;() &amp;lt;&amp;lt; is_a&amp;lt;TextBox&amp;gt;(&lt;br /&gt;
&lt;br /&gt;
Button:has(&amp;gt;&amp;gt; TextBox) {&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== And selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;is_a&amp;lt;TextBox&amp;gt;() &amp;amp;&amp;amp; Hover()&lt;br /&gt;
&lt;br /&gt;
TextBox:hover&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;is_a&amp;lt;TextBox&amp;gt;() &amp;amp;&amp;amp; ReadOnly() &amp;amp;&amp;amp; Disabled()&lt;br /&gt;
&lt;br /&gt;
TextBox:read-only:disabled&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;is_a&amp;lt;TextBox&amp;gt;() &amp;amp;&amp;amp; !Prompt()&lt;br /&gt;
&lt;br /&gt;
TextBox:not(KeyInputBox::Prompt)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Flip selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;+Any()&lt;br /&gt;
&lt;br /&gt;
*:flip()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Not selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;!Hover()&lt;br /&gt;
&lt;br /&gt;
:not(:hover)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;!Prompt()&lt;br /&gt;
&lt;br /&gt;
:not(KeyInputBox::prompt)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Or selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;is_a&amp;lt;TextBox&amp;gt;() &amp;amp;&amp;amp; (Hover() || Focus()).&lt;br /&gt;
    set(border_color(QColor(0x4B23A0)));&lt;br /&gt;
&lt;br /&gt;
TextBox:hover, TextBox:focus {&lt;br /&gt;
    border-color: 0x4B23A0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
TextBox {&lt;br /&gt;
    &amp;amp;:hover,&lt;br /&gt;
    &amp;amp;:focus {&lt;br /&gt;
        border-color: 0x4B23A0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
TextBox {&lt;br /&gt;
    &amp;amp;:is(:hover, :focus) {&lt;br /&gt;
        border-color: 0x4B23A0;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sibling selector ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;is_a&amp;lt;TextBox&amp;gt;() % is_a&amp;lt;Button&amp;gt;()&lt;br /&gt;
&lt;br /&gt;
TextBox % Button&lt;br /&gt;
&lt;br /&gt;
TextBox {&lt;br /&gt;
    &amp;amp; % Button {&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rules ==&lt;br /&gt;
&lt;br /&gt;
A selector list and an associated declaration block are called a rule.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TextBox {&lt;br /&gt;
    background-color: white;&lt;br /&gt;
    border-size: 1px;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
A commas, ‘&amp;lt;code&amp;gt;,&amp;lt;/code&amp;gt;’, is used to separated different selectors which have the the same declaration block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TextBox, Button {&lt;br /&gt;
    background-color: white;&lt;br /&gt;
    border-size: 1px;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inheritance ==&lt;br /&gt;
&lt;br /&gt;
Unlike CSS, a component doesn’t automatically inherit font and color settings from its parent component.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Nesting style ==&lt;br /&gt;
&lt;br /&gt;
Nesting refers to the practice of placing rules inside other rules. It allows you to group related styles together to improve readability and reduce repetition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;parent {&lt;br /&gt;
  /* parent styles */&lt;br /&gt;
  child {&lt;br /&gt;
    /* child of parent styles */&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
parent {&lt;br /&gt;
  /* parent styles */&lt;br /&gt;
  &amp;amp; child {&lt;br /&gt;
    /* child of parent styles */&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
The difference between using &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; nesting selectors and not using nesting selectors.&lt;br /&gt;
&lt;br /&gt;
* ''without'' the &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; nesting selector&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Button {&lt;br /&gt;
  /* parent styles */&lt;br /&gt;
  :hover {&lt;br /&gt;
    /* child of parent styles */&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
It automatically adds the Child selector &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; between the selectors to create a new selector rule(CSS adds a whitespace between the selectors, building the descendant relationship between selectors by default). The following code shows the equivalent non-nested rules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Button {&lt;br /&gt;
    /* parent styles */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* styles the hovered button's children. */&lt;br /&gt;
Button &amp;gt; :hover {&lt;br /&gt;
    /* child of parent styles */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
is_a&amp;lt;Button&amp;gt;() &amp;gt; Hover()&amp;lt;/pre&amp;gt;&lt;br /&gt;
* ''with'' the &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; nesting selector&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Button {&lt;br /&gt;
  /* parent styles */&lt;br /&gt;
  &amp;amp; :hover {&lt;br /&gt;
    /* child of parent styles */&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
With the &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; nesting selector added with no whitespace, the above block equals to the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Button {&lt;br /&gt;
    /* parent styles */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* styles the hovered button. */&lt;br /&gt;
Button:hover {&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
is_a&amp;lt;Button&amp;gt;() &amp;amp;&amp;amp; Hover()&amp;lt;/pre&amp;gt;&lt;br /&gt;
Other examples&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;is_a&amp;lt;Button&amp;gt;() &amp;gt;&amp;gt; is_a&amp;lt;TextBox&amp;gt;()&lt;br /&gt;
&lt;br /&gt;
Button {&lt;br /&gt;
  /* parent styles */&lt;br /&gt;
  &amp;amp; &amp;gt;&amp;gt; TextBox {&lt;br /&gt;
    /* child of parent styles */&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Button {&lt;br /&gt;
    &amp;gt;&amp;gt; TextBox {&lt;br /&gt;
        background-color: black;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Button {&lt;br /&gt;
    /* parent styles */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* styles the hovered button. */&lt;br /&gt;
Button &amp;gt;&amp;gt; TextBox {&lt;br /&gt;
    /* child of parent styles */&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Values =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Number ==&lt;br /&gt;
&lt;br /&gt;
A decimal integer or a real number.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;0, 1, 10, 1.5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Length ==&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Number(px | pt | ch)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Color ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''Hexadecimal Colors'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Syntax:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;#rrggbb&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Example:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;TextBox {background-color: #ff0000;}&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;2&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''Hexadecimal Colors With Transparency'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Syntax:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;#rrggbbaa&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Example:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;TextBox {background-color: #ff000008;}&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;3&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''RGB Colors'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;An RGB color value is specified with syntax &amp;lt;code&amp;gt;rgb()&amp;lt;/code&amp;gt;, which has the following syntax:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;rgb(red, green, blue)&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Each parameter is an integer between 0 and 255.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Example:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;TextBox {background-color: rgb(255, 0, 0);} &amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;4&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''RGBA Colors'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;RGBA color values are an extension of RGB color values with an alpha channel. The syntax is&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;rgba(red, green, blue, alpha)&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Example:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;TextBox {background-color: rgba(255, 0, 0, 0.3);} &amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;5&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''Predefined Color Names'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Only three color names that have been used in Spire are defined here.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;transparent&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;white&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;black&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Example:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;TextBox {background-color: transparent;} &amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Font Style ==&lt;br /&gt;
&lt;br /&gt;
* '''normal'''&lt;br /&gt;
&lt;br /&gt;
* '''italic'''&lt;br /&gt;
&lt;br /&gt;
* '''oblique'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#TextBox {font-style: italic;} &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Font Weight ==&lt;br /&gt;
&lt;br /&gt;
Predefined weight values which Qt supports:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''thin'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 100.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''extra-light'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 200.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''light'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 300.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''normal'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 400.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''medium'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 500.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''demi-bold'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 600.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''bold'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 700.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''extra-bold'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 800.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''black'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Same as 900.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Alignment ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;{left | right | top | bottom | center}*&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Time ==&lt;br /&gt;
&lt;br /&gt;
It represents a time value expressed in seconds or milliseconds. There is no space between Number and &amp;lt;code&amp;gt;s &amp;lt;/code&amp;gt;or &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Number(s | ms)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Overflow ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''none'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The list extends indefinitely.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''wrap'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;List items wrap to fill the perpendicular space.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== EdgeNavigation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''contain'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Selection stops at the current selection.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''wrap'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Selection moves from the first item to last item and vice versa.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Orientation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''horizontal'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The element is laid out horizontally.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''vertical'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The element is laid out vertically.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DateFormat ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''YYYYMMDD'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The year, month, and day can be input in a YYYY-MM-DD format.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''MMDD'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The month and day can be input in a MM-DD format.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Visibility ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''visible'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The element is visible.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''invisible'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The element is invisible.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;'''none'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The element is treated as if it has a width and height of 0.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Properties =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== all ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt; property is a property that resets all properties.&lt;br /&gt;
&lt;br /&gt;
Value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;unset&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The unset keyword clears styles of all properties, which has the different meaning with CSS unset. In CSS, unset specifies that all the element's properties should be changed to their inherited values if they inherit by default, or to their initial values if not.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;all: unset;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Example:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TextBox:read-only {&lt;br /&gt;
    all: unset;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
style.get(ReadOnly()).clear();&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Font ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''font-family''' ===&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#TextBox {font-family: &amp;quot;Roboto&amp;quot;;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''font-style''' ===&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#TextBox {font-style: normal;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''font-weight''' ===&lt;br /&gt;
&lt;br /&gt;
The weights available depend on the &amp;lt;code&amp;gt;font-style&amp;lt;/code&amp;gt; that is currently set. It doesn’t support arbitrary values since QFont::setWeight() uses QFont::Weight enumeration as the parameter. Referring to &amp;lt;code&amp;gt;Font weight&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#TextBox {font-weight: normal;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''font-size''' ===&lt;br /&gt;
&lt;br /&gt;
Sets the element's font size. Only pt and px metrics are supported.&amp;lt;br /&amp;gt;&lt;br /&gt;
Example:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#TextBox {font-size: 12px;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''font (shorthand)''' ===&lt;br /&gt;
&lt;br /&gt;
Syntax:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;font = font-style? font-weight? font-size font-family&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#TextBox {font: normal medium 12px &amp;quot;Roboto&amp;quot;;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Icon ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''url''' ===&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;url(filename)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
filename is the name of a file on the local disk or stored using the Qt resource system.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;url(&amp;quot;:/Icons/spire.svg”)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''fill''' ===&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;fill = color | none&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Icon { fill: 0xA0A0A0; }&lt;br /&gt;
Icon { fill: none; }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''icon-image''' ===&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;icon-image = url (width height)?&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Icon { icon-image: url(&amp;quot;:/Icons/spire.svg”) 16px 16px; }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Text ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''text-align''' ===&lt;br /&gt;
&lt;br /&gt;
Value: Alignment&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TextBox {&lt;br /&gt;
  text-align: left;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''text-color''' ===&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TextBox {&lt;br /&gt;
  text-color: black;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''text-style''' (Shorthand) ===&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;text-style = font text-color&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TextBox {&lt;br /&gt;
    text-style: normal 12px &amp;quot;Roboto&amp;quot; black;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Border ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-top-size''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the top border.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-top-size: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-right-size''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the right border.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-right-size: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-bottom-size''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the bottom border.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-bottom-size: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-left-size''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the left border.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-left-size: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-top-color''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the color of the top border.&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-top-color: 0x4B23A0; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-right-color''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the color of the right border.&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-right-color: 0x4B23A0; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-bottom-color''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the color of the bottom border.&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-bottom-color: 0x4B23A0; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-left-color''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the color of the left border.&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-left-color: 0x4B23A0; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-top-left-radius''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the radius of the border's top left corner.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-top-left-radius: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-top-right-radius''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the radius of the border's top right corner.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-top-right-radius: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-bottom-right-radius''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the radius of the border's bottom right corner.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-bottom-right-radius: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-bottom-left-radius''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the radius of the border's bottom left corner.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-bottom-left-radius: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-size''' ===&lt;br /&gt;
&lt;br /&gt;
Applies a single size to all four borders: '''border-top-size, border-right-size, border-bottom-size and border-left-size.'''&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-size: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-color''' ===&lt;br /&gt;
&lt;br /&gt;
Applies a single color to all four border: '''border-top-color, border-right-color, border-bottom-color and border-left-color.'''&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-color: 0x4B23A0; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border-radius''' ===&lt;br /&gt;
&lt;br /&gt;
Applies a single radius to all four corners: '''border-top-left-radius, border-top-right-radius, border-bottom-right-radius and border-bottom-left-radius.'''&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { border-radius: 1px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''border (shorthand)''' ===&lt;br /&gt;
&lt;br /&gt;
Styles all border colors and sizes.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;border = border-size border-color&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TextBox {&lt;br /&gt;
    border: 1px 0x4B23A0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Padding ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''padding-top''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the top padding.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { padding-top: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''padding-right''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the right padding.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { padding-right: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''padding-bottom''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the bottom padding.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { padding-bottom: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''padding-left''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the left padding.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { padding-left: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''horizontal-padding''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the left and right padding.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { horiztontal-padding: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''vertical-padding''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the size of the top and bottom padding.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { vertical-padding: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''padding''' ===&lt;br /&gt;
&lt;br /&gt;
Styles all four padding size of an element at once.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { padding: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Spacing ==&lt;br /&gt;
&lt;br /&gt;
=== '''horizontal-spacing''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the horizontal spacing between items in the table body.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TableBody { horizontal-spacing: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''vertical-spacing''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the vertical spacing between items in the table body.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TableBody { vertical-spacing: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''spacing''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the spacing between items in the table body.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TableBody { spacing: 8px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grid Color ==&lt;br /&gt;
&lt;br /&gt;
=== '''horizontal-grid-color''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the color of the horizontal grid lines in the table body.&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TableBody { horizontal-grid-color: transparent; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''vertical-grid-color''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the color of the vertical grid lines in the table body.&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TableBody { vertical-grid-color: transparent; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''grid-color''' ===&lt;br /&gt;
&lt;br /&gt;
Styles the color of the grid lines.&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TableBody { grid-color: transparent; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== background-color ==&lt;br /&gt;
&lt;br /&gt;
Sets the background color of an element.&lt;br /&gt;
&lt;br /&gt;
Value: Color&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box { background-color: transparent; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== body-align ==&lt;br /&gt;
&lt;br /&gt;
Sets the alignment of the body in a box.&lt;br /&gt;
&lt;br /&gt;
Value: Alignment&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DurationBox { body-align: center; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== leading-zeros ==&lt;br /&gt;
&lt;br /&gt;
The number of leading zeros added as padding to a number.&lt;br /&gt;
&lt;br /&gt;
Value: Number&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DecimalBox { leading-zeros: 4; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== trailing-zeros ==&lt;br /&gt;
&lt;br /&gt;
The number of trailing zeros added as padding to the fractional part of a number.&lt;br /&gt;
&lt;br /&gt;
Value: Number&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DecimalBox { trailing-zeros: 4; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== list-item-gap ==&lt;br /&gt;
&lt;br /&gt;
Sets the spacing between list items.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ListView { list-item-gap: 2px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== list-over-flow-gap ==&lt;br /&gt;
&lt;br /&gt;
Sets the gap between list items on overflow=WRAP in direction perpendicular to list direction.&lt;br /&gt;
&lt;br /&gt;
Value: Length&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ListView { list-over-flow-gap: 2px; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== line-height ==&lt;br /&gt;
&lt;br /&gt;
Styles the line height as a percentage of the font height in the TextAreaBox.&lt;br /&gt;
&lt;br /&gt;
Value: Number&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TextAreaBox { line-height: 1.2; }&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Attributes =&lt;br /&gt;
&lt;br /&gt;
== overflow ==&lt;br /&gt;
&lt;br /&gt;
Specifies how to layout items on overflow in the ListView.&lt;br /&gt;
&lt;br /&gt;
Value: Overflow&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ListView { overflow: wrap; }&lt;br /&gt;
&lt;br /&gt;
ListView[overflow=wrap] {&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== edge-navigation ==&lt;br /&gt;
&lt;br /&gt;
Specifies the navigation behavior when the first or last list item is selected and the key for next or previous list item is pressed.&lt;br /&gt;
&lt;br /&gt;
Value: EdgeNavigation&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ListView { edge-navigation: wrap; }&lt;br /&gt;
&lt;br /&gt;
ListView[edge-navigation=wrap] {&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== orientation ==&lt;br /&gt;
&lt;br /&gt;
Specifies the orientation of the ListView.&lt;br /&gt;
&lt;br /&gt;
Value: Orientation&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ListView { orientation: vertical; }&lt;br /&gt;
&lt;br /&gt;
ListView[orientation=vertical] {&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== date-format ==&lt;br /&gt;
&lt;br /&gt;
Specifies the accepted date format of the DateBox.&lt;br /&gt;
&lt;br /&gt;
Value: DateFormat&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;DateBox { date-format: YYYYMMDD; }&lt;br /&gt;
&lt;br /&gt;
DateBox[date-format=YYYYMMDD] {&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== visibility ==&lt;br /&gt;
&lt;br /&gt;
It specifies whether an element is visible.&lt;br /&gt;
&lt;br /&gt;
Value: Visibility&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Tag:read-only &amp;gt; Button {&lt;br /&gt;
 visibility: none;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Expression (Function) =&lt;br /&gt;
&lt;br /&gt;
== chain ==&lt;br /&gt;
&lt;br /&gt;
It chains two Expressions together, evaluating to the first until the first expression terminates, and then evaluating to the second.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chain(expression1, expression2)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TextBox {&lt;br /&gt;
    border-color: chain(timeout(0xB71C1C, 550ms), revert);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== linear ==&lt;br /&gt;
&lt;br /&gt;
It calculates a linear transition between two sub-expressions.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;linear(initial-expression, end-expression, duration)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TextBox {&lt;br /&gt;
    border-color: linear(0xB71C1C, revert, 300ms);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== minimum ==&lt;br /&gt;
&lt;br /&gt;
It calculates the minimum of two values.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;min(expression1, expression2) &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Box {&lt;br /&gt;
    border-size: min(10, 20);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== revert ==&lt;br /&gt;
&lt;br /&gt;
It reverts a property's value as if it had not been set by the current rule. It doesn’t take any parameters.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;revert&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TextBox {&lt;br /&gt;
    border-color: chain(timeout(0xF2F2FF, 250ms),&lt;br /&gt;
    linear(0xF2F2FF, revert, 300ms));&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== timeout ==&lt;br /&gt;
&lt;br /&gt;
It evaluates an expression for a specified duration and then terminates.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;timout(expression, duration)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TextBox {&lt;br /&gt;
    border-color: chain(timeout(0xB71C1C, 550ms), revert);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Some examples =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Child selector with pseudo-classes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Button&lt;br /&gt;
style.get((Checked() &amp;amp;&amp;amp; !Hover() &amp;amp;&amp;amp; !Press()) &amp;gt; is_a&amp;lt;Icon&amp;gt;()).&lt;br /&gt;
    set(Fill(QColor(0x7F5EEC)));&lt;br /&gt;
&lt;br /&gt;
Button:checked:not(:hover):not(:press) &amp;gt; Icon {&lt;br /&gt;
    fill: 0x7F5EEC;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Flip in the DecimalBox ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;update_style(*decimal_box, [] (auto&amp;amp; style) {&lt;br /&gt;
  style.get(ReadOnly() &amp;gt; is_a&amp;lt;Button&amp;gt;()).set(Visibility::NONE);&lt;br /&gt;
  style.get(+Any() &amp;gt; (is_a&amp;lt;Button&amp;gt;() &amp;amp;&amp;amp; !matches(Visibility::NONE))).&lt;br /&gt;
    set(PaddingRight(scale_width(24)));&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
DecimalBox {&lt;br /&gt;
    &amp;amp; :read-only {&lt;br /&gt;
        Button {&lt;br /&gt;
            visibility: none;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :flip(&amp;gt; Button:not([visibility=none])) {&lt;br /&gt;
        padding-right: 24px;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Clear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;update_style(*m_text_box, [] (auto&amp;amp; style) {&lt;br /&gt;
  style.get(ReadOnly()).clear();&lt;br /&gt;
  style.get(Disabled()).clear();&lt;br /&gt;
  style.get(ReadOnly() &amp;amp;&amp;amp; Disabled()).clear();&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
DropDownBox &amp;gt; TextBox {&lt;br /&gt;
    &amp;amp; :read-only {&lt;br /&gt;
        all: unset;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :disabled {&lt;br /&gt;
        all: unset;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :read-only:disabled {&lt;br /&gt;
        all: unset;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Update icons for the Slider ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; auto track_image = QImage(&amp;quot;:/Icons/hue-spectrum.png&amp;quot;);&lt;br /&gt;
 auto thumb_image =&lt;br /&gt;
   imageFromSvg(&amp;quot;:/Icons/color-thumb.svg&amp;quot;, scale(14, 14));&lt;br /&gt;
 update_style(*slider, [&amp;amp;] (auto&amp;amp; style) {&lt;br /&gt;
   style.get(Any() &amp;gt; Track()).set(IconImage(track_image));&lt;br /&gt;
   style.get(Any() &amp;gt; Thumb() &amp;gt; is_a&amp;lt;Icon&amp;gt;()).&lt;br /&gt;
     set(Fill(boost::optional&amp;lt;QColor&amp;gt;())).&lt;br /&gt;
     set(IconImage(thumb_image));&lt;br /&gt;
   style.get(Focus() &amp;gt; Thumb() &amp;gt; is_a&amp;lt;Icon&amp;gt;()).&lt;br /&gt;
     set(Fill(QColor(0x808080)));&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Slider {&lt;br /&gt;
    ::track {&lt;br /&gt;
        icon-image: url(&amp;quot;:/Icons/hue-spectrum.png&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    ::thumb &amp;gt; Icon {&lt;br /&gt;
        icon-image: url(&amp;quot;:/Icons/color-thumb.svg&amp;quot;) 14px 14px;&lt;br /&gt;
        fill: none;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :focus {&lt;br /&gt;
        ::thumb &amp;gt; Icon {&lt;br /&gt;
            fill: 0x808080;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LabelButton styling ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; style.get(Any() &amp;gt; Body()).&lt;br /&gt;
   set(TextAlign(Qt::Alignment(Qt::AlignCenter))).&lt;br /&gt;
   set(border(scale_width(1), QColor(Qt::transparent))).&lt;br /&gt;
   set(BackgroundColor(QColor(0xEBEBEB))).&lt;br /&gt;
   set(horizontal_padding(scale_width(8)));&lt;br /&gt;
 style.get(Hover() &amp;gt; Body()).&lt;br /&gt;
   set(TextColor(QColor(0xFFFFFF))).&lt;br /&gt;
   set(BackgroundColor(QColor(0x4B23A0)));&lt;br /&gt;
 style.get(Press() &amp;gt; Body()).&lt;br /&gt;
   set(TextColor(QColor(0xFFFFFF))).&lt;br /&gt;
   set(BackgroundColor(QColor(0x7E71B8)));&lt;br /&gt;
 style.get(FocusVisible() &amp;gt; Body()).set(border_color(QColor(0x4B23A0)));&lt;br /&gt;
 style.get(Disabled() &amp;gt; Body()).set(TextColor(QColor(0xB8B8B8)));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Button {&lt;br /&gt;
     ::body {&lt;br /&gt;
         text-align: center;&lt;br /&gt;
         boder: 1px transparent;&lt;br /&gt;
         background-color: 0xEBEBEB;&lt;br /&gt;
         horizontal-padding: 8px;&lt;br /&gt;
     }&lt;br /&gt;
     &amp;amp;:hover {&lt;br /&gt;
         ::body {&lt;br /&gt;
             text-color: 0xFFFFFF;&lt;br /&gt;
             background-color: 0x4B23A0;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
     &amp;amp;:press {&lt;br /&gt;
         ::body {&lt;br /&gt;
             text-color: 0xFFFFFF;&lt;br /&gt;
             background-color: 0x7E71B8;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
     &amp;amp;:focus-visible {&lt;br /&gt;
         ::body {&lt;br /&gt;
             border-color: 0x4B23A0;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
     &amp;amp;:disabled {&lt;br /&gt;
         ::body {&lt;br /&gt;
             text-color: 0xB8B8B8;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DeleteIconButton styling ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;update_style(*button, [] (auto&amp;amp; style) {&lt;br /&gt;
  style.get(Any() &amp;gt; is_a&amp;lt;Box&amp;gt;()).&lt;br /&gt;
    set(BackgroundColor(QColor(Qt::transparent)));&lt;br /&gt;
  style.get(Any() &amp;gt; is_a&amp;lt;Icon&amp;gt;()).&lt;br /&gt;
    set(BackgroundColor(QColor(Qt::transparent))).&lt;br /&gt;
    set(Fill(QColor(0xA0A0A0)));&lt;br /&gt;
  style.get((Hover() || Press()) &amp;gt; is_a&amp;lt;Icon&amp;gt;()).&lt;br /&gt;
    set(BackgroundColor(QColor(0xEBEBEB))).&lt;br /&gt;
    set(Fill(QColor(0x4B23A0)));&lt;br /&gt;
  style.get(Disabled() &amp;gt; is_a&amp;lt;Icon&amp;gt;()).set(Fill(QColor(0xD0D0D0)));&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
Button {&lt;br /&gt;
    Box {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
    }&lt;br /&gt;
    Icon {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
        fill: 0xA0A0A0;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :hover,&lt;br /&gt;
    &amp;amp; :press {&lt;br /&gt;
        Icon {&lt;br /&gt;
            background-color: 0xEBEBEB;&lt;br /&gt;
            fill: 0x4B23A0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :disabled {&lt;br /&gt;
        Icon {&lt;br /&gt;
            fill: 0xD0D0D0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== TextBox styling ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TextBox&lt;br /&gt;
auto style = StyleSheet();&lt;br /&gt;
auto font = QFont(&amp;quot;Roboto&amp;quot;);&lt;br /&gt;
font.setWeight(QFont::Normal);&lt;br /&gt;
font.setPixelSize(scale_width(12));&lt;br /&gt;
style.get(Any()).&lt;br /&gt;
  set(BackgroundColor(QColor(0xFFFFFF))).&lt;br /&gt;
  set(border(scale_width(1), QColor(0xC8C8C8))).&lt;br /&gt;
  set(text_style(font, QColor(Qt::black))).&lt;br /&gt;
  set(TextAlign(Qt::Alignment(Qt::AlignLeft) | Qt::AlignVCenter)).&lt;br /&gt;
  set(horizontal_padding(scale_width(8))).&lt;br /&gt;
  set(vertical_padding(scale_height(5)));&lt;br /&gt;
style.get(Hover() || Focus()).&lt;br /&gt;
  set(border_color(QColor(0x4B23A0)));&lt;br /&gt;
style.get(ReadOnly()).&lt;br /&gt;
  set(BackgroundColor(QColor(Qt::transparent))).&lt;br /&gt;
  set(border_color(QColor(Qt::transparent))).&lt;br /&gt;
  set(horizontal_padding(0));&lt;br /&gt;
style.get(Disabled()).&lt;br /&gt;
  set(BackgroundColor(QColor(0xF5F5F5))).&lt;br /&gt;
  set(border_color(QColor(0xC8C8C8))).&lt;br /&gt;
  set(TextColor(QColor(0xC8C8C8)));&lt;br /&gt;
style.get(ReadOnly() &amp;amp;&amp;amp; Disabled()).&lt;br /&gt;
  set(BackgroundColor(QColor(Qt::transparent))).&lt;br /&gt;
  set(border_color(QColor(Qt::transparent)));&lt;br /&gt;
style.get(Rejected()).&lt;br /&gt;
  set(BackgroundColor(chain(timeout(QColor(0xFFF1F1), milliseconds(250)),&lt;br /&gt;
    linear(QColor(0xFFF1F1), revert, milliseconds(300))))).&lt;br /&gt;
  set(border_color(&lt;br /&gt;
    chain(timeout(QColor(0xB71C1C), milliseconds(550)), revert)));&lt;br /&gt;
style.get(Placeholder()).set(TextColor(QColor(0xA0A0A0)));&lt;br /&gt;
style.get(Disabled() &amp;gt; Placeholder()).set(TextColor(QColor(0xC8C8C8)));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TextBox {&lt;br /&gt;
    background-color: 0xFFFFFF;&lt;br /&gt;
    border: 1px 0xC8C8C8;&lt;br /&gt;
    text-style: normal 12px &amp;quot;Roboto&amp;quot; black;&lt;br /&gt;
    text-align: left;&lt;br /&gt;
    horizontal-padding: 8px;&lt;br /&gt;
    vertical-padding: 5px;&lt;br /&gt;
    &amp;amp; :hover,&lt;br /&gt;
    &amp;amp; :focus {&lt;br /&gt;
        border-color: 0x4B23A0;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :read-only {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
        border-color: transparent;&lt;br /&gt;
        horizontal-padding: 0px;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :disabled {&lt;br /&gt;
        background-color: 0xF5F5F5;&lt;br /&gt;
        border-color: 0xC8C8C8;&lt;br /&gt;
        text-color: 0xC8C8C8;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :read-only:disabled {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
        border-color: transparent;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :rejected {&lt;br /&gt;
        background-color: chain(timeout(0xB71C1C, 250ms), linear(0xFFF1F1, revert, 300ms));&lt;br /&gt;
        border-color: chain(timeout(0xB71C1C, 550ms), revert);&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; ::placeholder {&lt;br /&gt;
        text-color: 0xA0A0A0;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :disabled::placeholder {&lt;br /&gt;
        text-color: 0xC8C8C8;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DropDownBox styling ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;auto style = StyleSheet();&lt;br /&gt;
style.get(ReadOnly() &amp;gt; is_a&amp;lt;TextBox&amp;gt;()).&lt;br /&gt;
  set(BackgroundColor(QColor(Qt::transparent))).&lt;br /&gt;
  set(border_color(QColor(Qt::transparent))).&lt;br /&gt;
  set(horizontal_padding(0));&lt;br /&gt;
style.get(Disabled() &amp;gt; is_a&amp;lt;TextBox&amp;gt;()).&lt;br /&gt;
  set(BackgroundColor(QColor(0xF5F5F5))).&lt;br /&gt;
  set(border_color(QColor(0xC8C8C8))).&lt;br /&gt;
  set(TextColor(QColor(0xC8C8C8)));&lt;br /&gt;
style.get((ReadOnly() &amp;amp;&amp;amp; Disabled()) &amp;gt; is_a&amp;lt;TextBox&amp;gt;()).&lt;br /&gt;
  set(BackgroundColor(QColor(Qt::transparent))).&lt;br /&gt;
  set(border_color(QColor(Qt::transparent)));&lt;br /&gt;
style.get(Any() &amp;gt; (is_a&amp;lt;Icon&amp;gt;() &amp;amp;&amp;amp; !(+Any() &amp;lt;&amp;lt; is_a&amp;lt;ListItem&amp;gt;()))).&lt;br /&gt;
  set(Fill(QColor(0x333333))).&lt;br /&gt;
  set(BackgroundColor(QColor(Qt::transparent)));&lt;br /&gt;
style.get(Disabled() &amp;gt; (is_a&amp;lt;Icon&amp;gt;() &amp;amp;&amp;amp; !(+Any() &amp;lt;&amp;lt; is_a&amp;lt;ListItem&amp;gt;()))).&lt;br /&gt;
  set(Fill(QColor(0xC8C8C8)));&lt;br /&gt;
style.get(ReadOnly() &amp;gt; (is_a&amp;lt;Icon&amp;gt;() &amp;amp;&amp;amp; !(+Any() &amp;lt;&amp;lt; is_a&amp;lt;ListItem&amp;gt;()))).&lt;br /&gt;
  set(Visibility::NONE);&lt;br /&gt;
style.get(Any() &amp;gt; (is_a&amp;lt;TextBox&amp;gt;() &amp;amp;&amp;amp; !(+Any() &amp;lt;&amp;lt; is_a&amp;lt;ListItem&amp;gt;()))).&lt;br /&gt;
  set(PaddingRight(scale_width(14)));&lt;br /&gt;
style.get(PopUp() &amp;gt; is_a&amp;lt;TextBox&amp;gt;() ||&lt;br /&gt;
    (+Any() &amp;gt; is_a&amp;lt;Button&amp;gt;() &amp;amp;&amp;amp; (Hover() || FocusIn())) &amp;gt; is_a&amp;lt;TextBox&amp;gt;()).&lt;br /&gt;
  set(border_color(QColor(0x4B23A0)));&lt;br /&gt;
style.get(ReadOnly() &amp;gt; (is_a&amp;lt;TextBox&amp;gt;() &amp;amp;&amp;amp; !(+Any() &amp;lt;&amp;lt; is_a&amp;lt;ListItem&amp;gt;()))).&lt;br /&gt;
  set(horizontal_padding(0)).&lt;br /&gt;
  set(border_color(QColor(Qt::transparent))).&lt;br /&gt;
  set(BackgroundColor(QColor(Qt::transparent)));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;DropDownBox {&lt;br /&gt;
    &amp;amp; :read-only &amp;gt; TextBox {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
        border-color: transparent;&lt;br /&gt;
        horizontal-padding: 0;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :disabled &amp;gt; TextBox {&lt;br /&gt;
        background-color: 0xF5F5F5;&lt;br /&gt;
        border-color: 0xC8C8C8;&lt;br /&gt;
        text-color: 0xC8C8C8;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :read-only:disabled &amp;gt; TextBox {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
        border-color: transparent;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :not(:flip(:has(&amp;gt;&amp;gt; ListItem))) {&lt;br /&gt;
        Icon {&lt;br /&gt;
            fill: 0x333333;&lt;br /&gt;
            background-color: transparent;&lt;br /&gt;
        }&lt;br /&gt;
        TextBox {&lt;br /&gt;
            padding-right: 14px;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :disabled:not(:flip(:has(&amp;gt;&amp;gt; ListItem))) &amp;gt; Icon {&lt;br /&gt;
        fill: 0xC8C8C8;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :read-only:not(:flip(:has(&amp;gt;&amp;gt; ListItem))) &amp;gt; Icon {&lt;br /&gt;
        visibility: none;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :pop-up,&lt;br /&gt;
    &amp;amp; :hover:flip(&amp;gt; Button),&lt;br /&gt;
    &amp;amp; :focus-in:flip(&amp;gt; Button) {&lt;br /&gt;
        TextBox {&lt;br /&gt;
            border-color: 0x4B23A0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &amp;amp; :read-only:not(:flip(:has(&amp;gt;&amp;gt; ListItem))) {&lt;br /&gt;
        TextBox {&lt;br /&gt;
            horizontal-padding: 0;&lt;br /&gt;
            border-color: transparent;&lt;br /&gt;
            background-color: transparent;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;amp; :pop-up,&lt;br /&gt;
&amp;amp; :flip(&amp;gt; Button):is(:hover, :focus-in) {&lt;br /&gt;
    TextBox {&lt;br /&gt;
        border-color: 0x4B23A0;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== EditableTableView styling ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    auto style = StyleSheet();&lt;br /&gt;
    auto body_selector = Any() &amp;gt; is_a&amp;lt;TableBody&amp;gt;();&lt;br /&gt;
    auto item_selector = body_selector &amp;gt; Row() &amp;gt; is_a&amp;lt;TableItem&amp;gt;();&lt;br /&gt;
    style.get(item_selector &amp;gt; Any() &amp;gt;&lt;br /&gt;
        (ReadOnly() &amp;amp;&amp;amp; !(+Any() &amp;lt;&amp;lt; is_a&amp;lt;ListItem&amp;gt;()) &amp;amp;&amp;amp; !Prompt())).&lt;br /&gt;
      set(horizontal_padding(scale_width(8)));&lt;br /&gt;
    style.get(item_selector &amp;gt;  Any() &amp;gt; ReadOnly() &amp;gt;&lt;br /&gt;
        (is_a&amp;lt;TextBox&amp;gt;() &amp;amp;&amp;amp; !(+Any() &amp;lt;&amp;lt; is_a&amp;lt;ListItem&amp;gt;()) &amp;amp;&amp;amp; !Prompt())).&lt;br /&gt;
      set(horizontal_padding(scale_width(8)));&lt;br /&gt;
    style.get((item_selector &amp;gt; !ReadOnly()) &amp;lt;&amp;lt; Current()).&lt;br /&gt;
      set(border_color(QColor(Qt::transparent)));&lt;br /&gt;
    style.get(body_selector &amp;gt; Row() &amp;gt; Current()).&lt;br /&gt;
      set(BackgroundColor(Qt::transparent));&lt;br /&gt;
    style.get(body_selector &amp;gt; Row() &amp;gt; HoverItem()).&lt;br /&gt;
      set(border_color(QColor(0xA0A0A0)));&lt;br /&gt;
    style.get(body_selector &amp;gt; (Row() &amp;amp;&amp;amp; Hover())).&lt;br /&gt;
      set(BackgroundColor(0xF2F2FF));&lt;br /&gt;
    style.get(item_selector &amp;gt; DeleteButton()).&lt;br /&gt;
      set(Visibility(Visibility::INVISIBLE));&lt;br /&gt;
    style.get(item_selector &amp;gt; DeleteButton() &amp;gt; is_a&amp;lt;Box&amp;gt;()).&lt;br /&gt;
      set(BackgroundColor(QColor(Qt::transparent))).&lt;br /&gt;
      set(horizontal_padding(scale_width(2))).&lt;br /&gt;
      set(vertical_padding(scale_height(2)));&lt;br /&gt;
    style.get(item_selector &amp;gt; DeleteButton() &amp;gt; is_a&amp;lt;Icon&amp;gt;()).&lt;br /&gt;
      set(BackgroundColor(QColor(Qt::transparent)));&lt;br /&gt;
    style.get(body_selector &amp;gt; (CurrentRow() || (Row() &amp;amp;&amp;amp; Hover())) &amp;gt;&lt;br /&gt;
        is_a&amp;lt;TableItem&amp;gt;() &amp;gt; DeleteButton()).&lt;br /&gt;
      set(Visibility(Visibility::VISIBLE));&lt;br /&gt;
    style.get((body_selector &amp;gt; (CurrentRow() || (Row() &amp;amp;&amp;amp; Hover()))) &amp;gt;&lt;br /&gt;
        DeleteButton() &amp;gt; is_a&amp;lt;Icon&amp;gt;()).&lt;br /&gt;
      set(Fill(QColor(0x535353)));&lt;br /&gt;
    style.get(body_selector &amp;gt; (Row() &amp;amp;&amp;amp; Hover()) &amp;gt; DeleteButton() &amp;gt;&lt;br /&gt;
        (is_a&amp;lt;Icon&amp;gt;() &amp;amp;&amp;amp; Hover())).&lt;br /&gt;
      set(BackgroundColor(QColor(0xDFDFEB))).&lt;br /&gt;
      set(Fill(QColor(0xB71C1C)));&lt;br /&gt;
    style.get(body_selector &amp;gt; CurrentRow() &amp;gt; DeleteButton() &amp;gt;&lt;br /&gt;
        (is_a&amp;lt;Icon&amp;gt;() &amp;amp;&amp;amp; Hover())).&lt;br /&gt;
      set(BackgroundColor(QColor(0xD0CEEB))).&lt;br /&gt;
      set(Fill(QColor(0xB71C1C)));&lt;br /&gt;
    style.get((item_selector &amp;gt; EmptyCell()) &amp;lt;&amp;lt; (HoverItem() || Current())).&lt;br /&gt;
      set(border_color(QColor(Qt::transparent)));&lt;br /&gt;
    style.get(body_selector &amp;gt; CurrentRow()).&lt;br /&gt;
      set(BackgroundColor(QColor(0xE2E0FF)));&lt;br /&gt;
    style.get(body_selector &amp;gt; CurrentColumn()).&lt;br /&gt;
      set(BackgroundColor(Qt::transparent));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EditableTableView {&lt;br /&gt;
    TableBody {&lt;br /&gt;
        TableBody::row {&lt;br /&gt;
            TableItem {&lt;br /&gt;
                * {&lt;br /&gt;
                    :not(:flip(:has(&amp;gt;&amp;gt; ListItem))) {&lt;br /&gt;
                        :read-only:not(KeyInputBox::prompt) {&lt;br /&gt;
                            horizontal-padding: 8px;&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                    :read-only:not(:flip(:has(&amp;gt;&amp;gt; ListItem))) {&lt;br /&gt;
                        TextBox:not(KeyInputBox::prompt) {&lt;br /&gt;
                            horizontal-padding: 8px;&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            &amp;amp; :current:has(&amp;gt; :not(:read-only)) {&lt;br /&gt;
                border-color: transparent;&lt;br /&gt;
            }&lt;br /&gt;
            &amp;amp; :current {&lt;br /&gt;
                background-color: transparent;&lt;br /&gt;
            }&lt;br /&gt;
            &amp;amp; :hover-item {&lt;br /&gt;
                border-color: 0xA0A0A0;&lt;br /&gt;
            }&lt;br /&gt;
            ::delete-button {&lt;br /&gt;
                visibility: invisible;&lt;br /&gt;
                Box {&lt;br /&gt;
                    background-color: transparent;&lt;br /&gt;
                    horizontal-padding: 2px;&lt;br /&gt;
                    vertical-padding: 2px;&lt;br /&gt;
                }&lt;br /&gt;
                Icon {&lt;br /&gt;
                    background-color: transparent;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            &amp;amp; :has(&amp;gt; ::empty-cell) {&lt;br /&gt;
                &amp;amp; :hover-item,&lt;br /&gt;
                &amp;amp; :current {&lt;br /&gt;
                    border-color: transparent;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &amp;amp; :hover {&lt;br /&gt;
            background-color: 0xF2F2FF;&lt;br /&gt;
            TableItem::delete-button {&lt;br /&gt;
                visibility: visible;&lt;br /&gt;
                Icon {&lt;br /&gt;
                    fill: 0x535353;&lt;br /&gt;
                    &amp;amp; :hover {&lt;br /&gt;
                        background-color: 0xDFDFEB;&lt;br /&gt;
                        fill: 0xB71C1C;&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &amp;amp; :current-row {&lt;br /&gt;
            background-color: 0xE2E0FF;&lt;br /&gt;
            TableItem::delete-button {&lt;br /&gt;
                visibility: visible;&lt;br /&gt;
                Icon {&lt;br /&gt;
                    fill: 0x535353;&lt;br /&gt;
                    &amp;amp; :hover {&lt;br /&gt;
                        background-color: 0xDFDFEB;&lt;br /&gt;
                        fill: 0xB71C1C;&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &amp;amp; :current-column {&lt;br /&gt;
            backgournd-color: transparent;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Layout&amp;diff=227</id>
		<title>Layout</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Layout&amp;diff=227"/>
		<updated>2024-03-19T16:19:12Z</updated>

		<summary type="html">&lt;p&gt;Jon: Created page with &amp;quot;&amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; defines the visual composition for a component and its child elements. It’s required whenever a new element arrangement is needed. &amp;lt;code&amp;gt;layout.xd&amp;lt;/co...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; defines the visual composition for a component and its child elements. It’s required whenever a new element arrangement is needed. &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; is not necessary when it inherits its layout from another component and does not modify that layout. For example, &amp;lt;code&amp;gt;Label&amp;lt;/code&amp;gt; is a customized &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt; that makes no changes to the layout, so &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; is not needed.&lt;br /&gt;
&lt;br /&gt;
This document is the go-to for widths, heights, and positions; it takes precedence in the event of conflicts with &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;. However, dynamic adjustments tied to user input can override it, as specified in &amp;lt;code&amp;gt;user_flow.drawio&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
While &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; outlines the parts of a component, &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; is about fitting these parts together. &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; answers the question: “What goes where?” It should include the following details:&lt;br /&gt;
* '''Position:''' Specifying where child components are positioned relative to each other.&lt;br /&gt;
* '''Size Policy:''' Define the size or proportions of child components and how they change with resizing.&lt;br /&gt;
* '''Spacing:''' Detailing the spacing or gaps between child components.&lt;br /&gt;
* '''Layer Hierarchy:''' How the elements of a child component are visually stacked.&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; comes after &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;. It is generally advised to ensure &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; is finalized first, as the names defined there carry over to &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; communicates spatial relations (position and size policy) through a primarily visual language. Each element is portrayed as a rectangle, with constraints along each edge indicated by edge color. When first learning the system, start by reviewing the [https://drive.spiretrading.com/f/91480 layout reference document].&lt;br /&gt;
&lt;br /&gt;
Before starting &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, the visual design for all scenarios should already be worked out, with the key ones ideally captured in &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt;. Use &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; to formalize the layout.&lt;br /&gt;
&lt;br /&gt;
Sketch the component’s layout and that of each child at the preferred size. Maintain simplicity by restricting layouts to a single depth level; nesting layouts within layouts isn’t a convention in the visual layout language. If a child’s layout is specified elsewhere and remains unchanged, omit it. When included, consider it an ''override'': the specified layout takes precedence over the existing one within the component instance.&lt;br /&gt;
&lt;br /&gt;
=== Example: Slider ===&lt;br /&gt;
&lt;br /&gt;
[[File:Slider_preview.png | 720px | Preview of a slider showing horizontal and vertical orientations and use cases in a Color Picker.]] &lt;br /&gt;
&lt;br /&gt;
From the preview, we can see that &amp;lt;code&amp;gt;Slider&amp;lt;/code&amp;gt; has a different layout depending on its orientation. Based on the examples, it appears that the thumb and the track are customizable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Styles:&lt;br /&gt;
  orientation: The orientation of the slider.&lt;br /&gt;
    HORIZONTAL - The thumb can be dragged horizontally.&lt;br /&gt;
    VERTICAL - The thumb can be dragged vertically.&lt;br /&gt;
&lt;br /&gt;
Data:&lt;br /&gt;
  current: The current value represented by the slider. Cannot be null.&lt;br /&gt;
           Defaults to halfway between min and max.&lt;br /&gt;
  min: The minimum value that current is allowed to be. Default 0.&lt;br /&gt;
  max: The maximum value that current is allowed to be. Default 100.&lt;br /&gt;
  step: The granularity that current must adhere to. Default 0.&lt;br /&gt;
  default_increment: The amount of change in current when the user increments or&lt;br /&gt;
                     decrements the slider.&lt;br /&gt;
  shift_increment: The amount of change in current when the user increments or&lt;br /&gt;
                   decrements the slider while holding the shift key.&lt;br /&gt;
  track: The component representing the track of the slider.&lt;br /&gt;
  thumb: The component representing the thumb of the slider.&lt;br /&gt;
 ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
The model for &amp;lt;code&amp;gt;Slider&amp;lt;/code&amp;gt; shows a style &amp;lt;code&amp;gt;orientation&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;HORIZONTAL&amp;lt;/code&amp;gt; | &amp;lt;code&amp;gt;VERTICAL&amp;lt;/code&amp;gt;) corresponding to the preview. There are also two slots &amp;lt;code&amp;gt;track&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;thumb&amp;lt;/code&amp;gt;, indicating that these are customizable.&lt;br /&gt;
&lt;br /&gt;
[[File:Slider_components.png | 720px | Definition cards for children of Slider.]]&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;, child names and styles are defined.&lt;br /&gt;
&lt;br /&gt;
[[File:Slider_Layouts.png | 720px | Layout for Slider.]]&lt;br /&gt;
&lt;br /&gt;
By contrast with &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;, in &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; the bottommost (outermost) element receives the title of the component itself. This is necessary to clarify how the component’s children are arranged within it and to provide its size constraints. In the above, &amp;lt;code&amp;gt;Slider&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; that contains &amp;lt;code&amp;gt;track&amp;lt;/code&amp;gt; on layer 0 and &amp;lt;code&amp;gt;thumb&amp;lt;/code&amp;gt; on layer 1.&lt;br /&gt;
&lt;br /&gt;
'''Note''': The &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; did not appear in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; as no customization is done to it, but it is required in &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; to define &amp;lt;code&amp;gt;Slider&amp;lt;/code&amp;gt;. The use of &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; means that components using &amp;lt;code&amp;gt;Slider&amp;lt;/code&amp;gt; can customize it with &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt;-specific styling such as &amp;lt;code&amp;gt;border&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;padding&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;background_color&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Separate layers in &amp;lt;code&amp;gt;Box.body&amp;lt;/code&amp;gt; allow for overlap between &amp;lt;code&amp;gt;thumb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;track&amp;lt;/code&amp;gt;. Similarly, two layers are used in the layout of &amp;lt;code&amp;gt;Track.body&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Rail&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Fill&amp;lt;/code&amp;gt;. To avoid overriding &amp;lt;code&amp;gt;Track&amp;lt;/code&amp;gt;’s layout, &amp;lt;code&amp;gt;Track.body&amp;lt;/code&amp;gt; is laid out instead. Generally, when a component has slots, composition is done by laying out the slots without altering the overall layout.&lt;br /&gt;
&lt;br /&gt;
The width of &amp;lt;code&amp;gt;Fill&amp;lt;/code&amp;gt; is determined by an expression, creating a ''binding'' that updates with model property changes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Thumb&amp;lt;/code&amp;gt; is laid out directly using absolute &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt; size. Here, an ''anonymous'' element is used to specify the size without overriding the layout.&lt;br /&gt;
&lt;br /&gt;
To understand &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, one must be familiar with Spire’s visual layout language.&lt;br /&gt;
&lt;br /&gt;
== Visual Layout Language ==&lt;br /&gt;
&lt;br /&gt;
Within &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, each element has a specific color and an identifier, rather than appearing as they do in &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt;. These colors convey size constraints.&lt;br /&gt;
&lt;br /&gt;
=== Elements ===&lt;br /&gt;
&lt;br /&gt;
Layouts are composed of ''elements'', representing components like &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Button&amp;lt;/code&amp;gt;, spacers for visual separation, or containers strictly for layout. Elements are generally depicted as rectangles, with center-aligned identifiers like &amp;lt;code&amp;gt;&amp;amp;lt;ElementName&amp;amp;gt;&amp;lt;/code&amp;gt;. The appearance of the identifier doesn’t align with text orientation within the element. An element without an identifier is ''anonymous''. Each element can be thought of as having &amp;lt;code&amp;gt;top&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bottom&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;left&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;right&amp;lt;/code&amp;gt; for its position and &amp;lt;code&amp;gt;width&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;height&amp;lt;/code&amp;gt; for its size.&lt;br /&gt;
&lt;br /&gt;
[[File:Element Basics.png | 720px | An element drawn as a box with its identifier and the properties top, right, bottom, left, width, and height labelled.]]&lt;br /&gt;
&lt;br /&gt;
=== Size Constraints ===&lt;br /&gt;
&lt;br /&gt;
Elements are sized through either fixed dimensions, expressed in pixels, or by occupying all available container space. An element’s size may also come from its contents, but ultimately any contents are either &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Constraint&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt;&lt;br /&gt;
| The size of the component is a literal value that comes directly from the visual. An element drawn 12px wide is rendered 12px wide. As the size of the layout changes, the element size is unchanged.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt;&lt;br /&gt;
| The size of the component fills the available space. The literal size of the depicted element represents the ''preferred'' size if no preferred size can be determined from the layout bottom-up. As the size of the layout changes, the element shrinks or grows to fill all available space. When multiple components in a layout have this constraint, the available space is distributed equally among them.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;FIT&amp;lt;/code&amp;gt;&lt;br /&gt;
| The size of the component is determined by its contents. The literal size of the depicted element represents the ''preferred'' size if no preferred size can be determined from the layout bottom-up. This is often used for text which takes on a fixed value at any time, but changes dynamically or for windows that can be resized by the user and simultaneously restricted by their contents.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Uniform constraints (same in both axes) encode edges and background color with the appropriate constraint color. For non-uniform constraints, edges are color-encoded, and the background remains neutral. Optionally, a neutral background helps distinguish adjacent components with identical constraints.&lt;br /&gt;
&lt;br /&gt;
[[File:LayoutSpecificity.png | 720px | Three rectangles showing different constraints. (1) Non-uniform constraints: neutral background and different colors for horizontal and vertical borders. (2) Uniform constraints: colored background and same color borders. (3) Uniform constraints (alternate): neutral background and same color borders.]] &lt;br /&gt;
&lt;br /&gt;
Color-encoding for borders and backgrounds is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:LayoutColorSemantics.png | 720px | Five rectangles showing meaning of constraint colors. (1) Fixed Size: yellow. (2) Fill Available Space: blue. (3) Fit to Content: green. (4) Repeat: light purple. (5) Repeat Direction: dark purple.]] &lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;Repeat&amp;lt;/code&amp;gt; element can be used to describe repetitive layouts. &amp;lt;code&amp;gt;Repeat&amp;lt;/code&amp;gt; duplicates adjacent layouts, following the color-encoded &amp;lt;code&amp;gt;Repeat Direction&amp;lt;/code&amp;gt;. It is useful for dynamic lists where the content dictates the number of items.&lt;br /&gt;
&lt;br /&gt;
[[File:LayoutExamples.png | 720px | Three collections of rectangles demonstrating different combinations of constraints. (1) Non-Uniform Constraints: rectangles with a neutral background color and differently colored vertical and horizontal borders (combinations of yellow, blue, and green). (2) Size Limit Examples: a neutral background rectangle with blue horizontal borders and yellow vertical borders. A note next to it says &amp;quot;width: min(100%, 500px)&amp;quot;. (3) Repeater Constraint Examples: rectangles with a light purple background and a single dark purple border on the top, left, bottom or right indicating repeat from top to bottom, repeat from right to left, repeat from bottom to top, and repeat from left to right respectively.]]&lt;br /&gt;
&lt;br /&gt;
==== Example: Box ====&lt;br /&gt;
&lt;br /&gt;
[[File:Box_preview.png | 720px | Preview showing an empty Box, a TextBox, a LabelButton and other use cases.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; establishes the basic style properties. The relevant properties are detailed in &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Styles:&lt;br /&gt;
  border_top_size: The height of the top border.&lt;br /&gt;
  border_right_size: The width of the right border.&lt;br /&gt;
  border_bottom_size: The height of the bottom border.&lt;br /&gt;
  border_left_size: The width of the left border.&lt;br /&gt;
  ...&lt;br /&gt;
  padding_top: The amount of padding on the top of the box.&lt;br /&gt;
  padding_right: The amount of padding to the right of the box.&lt;br /&gt;
  padding_bottom: The amount of padding on the bottom of top of the box.&lt;br /&gt;
  padding_left: The amount of padding to the left of the box.&lt;br /&gt;
  ...&lt;br /&gt;
&lt;br /&gt;
Data:&lt;br /&gt;
  body: The component displayed in the box.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; has a &amp;lt;code&amp;gt;border&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;padding&amp;lt;/code&amp;gt;, and a &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;border&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;padding&amp;lt;/code&amp;gt; are specified as fixed sizes for each edge, while &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt; can be any component. &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; shows how these elements are arranged:&lt;br /&gt;
&lt;br /&gt;
[[File:Box_layout.png | 720px | A rectangle labeled body enclosed by trapezoids labeled padding_left, padding_top, padding_right, padding_bottom, enclosed by trapezoids labeled border_left, border_top, border_right, border_bottom.]]&lt;br /&gt;
&lt;br /&gt;
In the layout, &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt; adopts &amp;lt;code&amp;gt;FIT&amp;lt;/code&amp;gt; constraints on all sides. By default, the size of the &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; adapts to its content. &amp;lt;code&amp;gt;padding&amp;lt;/code&amp;gt; is specified with separate components for each edge using &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt; constraints. &amp;lt;code&amp;gt;border&amp;lt;/code&amp;gt;, akin to &amp;lt;code&amp;gt;padding&amp;lt;/code&amp;gt;, uses the same specifications but lies outside it. The layout makes clear that &amp;lt;code&amp;gt;border&amp;lt;/code&amp;gt; extends beyond &amp;lt;code&amp;gt;padding&amp;lt;/code&amp;gt;, and both consume space that &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt; cannot occupy.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; introduces a unique scenario as both &amp;lt;code&amp;gt;border&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;padding&amp;lt;/code&amp;gt; elements converge at angles, presenting trapezoids instead of rectangles.&lt;br /&gt;
&lt;br /&gt;
=== Position Constraints ===&lt;br /&gt;
&lt;br /&gt;
The positioning of an element is considered relative to its container.&lt;br /&gt;
&lt;br /&gt;
[[File:Positioning 1.png | 720px | A rectangle labeled Item inside a larger rectangle with markers between the left, top, right, and bottom edges of the two rectangles.]] &lt;br /&gt;
&lt;br /&gt;
In the above diagram, the element &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; is placed inside a container at some distances to its edges. Within the visual layout language, the layout must be drawn so that all of the space is taken up by elements, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Positioning 2.png | 720px | A rectangle labeled Item inside a larger rectangle with rectangles labeled A, B, C, and D occupying the space between the edges of the outer rectangle and Item.]] &lt;br /&gt;
&lt;br /&gt;
Above, the position of &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; is defined by the surrounding elements &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;C&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;. These elements can be other components or ''anonymous'' and they each have their own size constraints. How &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; is positioned will depend on the ''size'' of the adjacent elements. The layout ensures no underflow, meaning no unoccupied space between components (the gaps shown in the diagram are for illustration only).&lt;br /&gt;
&lt;br /&gt;
Edges of elements that touch are bound together. Where the right edge of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; is adjacent to the left edge of &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;, it signifies &amp;lt;code&amp;gt;A.right = B.left&amp;lt;/code&amp;gt;. Likewise, where the bottom edge of &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; aligns with the top edge of &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt;, it signifies &amp;lt;code&amp;gt;B.bottom = Item.top&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Example: A Fixed and B Fill ====&lt;br /&gt;
&lt;br /&gt;
[[File:Example1_1.png | 720px | Two rectangles labeled A and B side-by-side with the same height and an overall width of 320 pixels.]]&lt;br /&gt;
&lt;br /&gt;
In this scenario, &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt;, signifying a literal size, while &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; has &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt; constraints so that it occupies the available space.&lt;br /&gt;
&lt;br /&gt;
When the width is reduced, &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; goes to zero width:&lt;br /&gt;
&lt;br /&gt;
[[File:Example1_2.png | 720px | One rectangle labeled A with a width of 128 pixels.]]&lt;br /&gt;
&lt;br /&gt;
When the width is increased, &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; stretches to fill the available space:&lt;br /&gt;
&lt;br /&gt;
[[File:Example1_3.png | 720px | Two rectangles labeled A and B side-by-side with the same height and an overall width of 640 pixels.]]&lt;br /&gt;
&lt;br /&gt;
For the horizontal direction, the constraints are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;A.left = left&lt;br /&gt;
A.right = left + 128px&lt;br /&gt;
B.left = A.right&lt;br /&gt;
B.right = right&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the vertical direction:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;A.top = top&lt;br /&gt;
A.bottom = top + 128px&lt;br /&gt;
B.top = top&lt;br /&gt;
B.bottom = bottom&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since underflow is forbidden, the layout cannot exceed the height of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;: there’s nothing to occupy the additional space.&lt;br /&gt;
&lt;br /&gt;
=== Spacers ===&lt;br /&gt;
&lt;br /&gt;
Negative space is specified with spacers — elements absent from &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; and devoid of interactive and styling attributes. Spacers, often ''anonymous'', serve the sole purpose of defining space between components.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Negative space can also be introduced by using internal padding on adjacent components. Doing so is often preferred for &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt; spacing.&lt;br /&gt;
&lt;br /&gt;
==== Example: A Fixed and B Fixed ====&lt;br /&gt;
&lt;br /&gt;
[[File:Example2_1.png | 720px | Three rectangles side-by-side, all the same height and with an overall width of 320 pixels. The rectangles on each end are labeled A and B, and the rectangle in the middle is unlabeled.]]&lt;br /&gt;
&lt;br /&gt;
In this scenario, both &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; are &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt;, with literal sizes of 128px in &amp;lt;code&amp;gt;width&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;height&amp;lt;/code&amp;gt;. They are positioned on opposite ends of the layout through the use of a spacer that is constrained to &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt; the available space. The spacer lacks an identifier: it is ''anonymous''.&lt;br /&gt;
&lt;br /&gt;
When the width of the layout is reduced, the spacer collapses and &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; touch:&lt;br /&gt;
&lt;br /&gt;
[[File:Example2_2.png | 720px | Two rectangles side-by-side, labeled A and B, with the same height and an overall width of 256 pixels.]]&lt;br /&gt;
&lt;br /&gt;
When the width of the layout is increased, the spacer expands to fill the available space:&lt;br /&gt;
&lt;br /&gt;
[[File:Example2_3.png | 720px | Three rectangles side-by-side, all the same height and with an overall width of 640 pixels. The rectangles on each end are labeled A and B, and the rectangle in the middle is unlabeled.]]&lt;br /&gt;
&lt;br /&gt;
For the horizontal constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;A.left = left&lt;br /&gt;
A.right = left + 128px&lt;br /&gt;
spacer.left = A.right&lt;br /&gt;
spacer.right = B.left&lt;br /&gt;
B.left = right - 128px&lt;br /&gt;
B.right = right&amp;lt;/pre&amp;gt;&lt;br /&gt;
For the vertical constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;A.top = top&lt;br /&gt;
A.bottom = top + 128px&lt;br /&gt;
spacer.top = top&lt;br /&gt;
spacer.bottom = bottom&lt;br /&gt;
B.top = top&lt;br /&gt;
B.bottom = top + 128px&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Containers ===&lt;br /&gt;
&lt;br /&gt;
Layouts can be subdivided at the designer’s choosing using containers. They are used to encapsulate the arrangement of elements. Unlike spacers, containers cannot be anonymous; they require identification for referencing.&lt;br /&gt;
&lt;br /&gt;
==== Example: ListView ====&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;direction = VERTICAL and overflow = WRAP&amp;lt;/code&amp;gt; , the layout is divided into containers named &amp;lt;code&amp;gt;Column&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;Column&amp;lt;/code&amp;gt; is purely a layout element, without any representation in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:ListView_layout.png | 720px | Two elements labeled Column arranged left-to-right with a Repeat-Left-to-Right element between them.]]&lt;br /&gt;
&lt;br /&gt;
The layout for &amp;lt;code&amp;gt;Column&amp;lt;/code&amp;gt; is shown the same as for any other component.&lt;br /&gt;
&lt;br /&gt;
[[File:ListView_layout-2.png | 720px | Two elements labeled Item arranged top-to-bottom with a Repeat-Top-to-Bottom element between them.]]&lt;br /&gt;
&lt;br /&gt;
=== Example: TitleBar ===&lt;br /&gt;
&lt;br /&gt;
[[File:TitleBar_preview-2.png | 720px | A window titlebar.]] &lt;br /&gt;
&lt;br /&gt;
From &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt;, we can see that &amp;lt;code&amp;gt;TitleBar&amp;lt;/code&amp;gt; consists of a few elements:&lt;br /&gt;
* Icon&lt;br /&gt;
* Title&lt;br /&gt;
* Window controls&lt;br /&gt;
* Container&lt;br /&gt;
&lt;br /&gt;
The height of &amp;lt;code&amp;gt;TitleBar&amp;lt;/code&amp;gt; is constant, while its width can vary.&lt;br /&gt;
&lt;br /&gt;
[[File:TitleBar_components.png | 720px | Definition cards for TitleBar's children.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; introduces aliases:&lt;br /&gt;
* WindowIcon&lt;br /&gt;
* WindowName&lt;br /&gt;
* Minimize, Maximize, and Close&lt;br /&gt;
* Box&lt;br /&gt;
&lt;br /&gt;
Appearance tweaks—background colors, icons, and title text—are handled in the property declarations.&lt;br /&gt;
&lt;br /&gt;
[[File:TitleBar_layout.png | 720px | Layout for TitleBar.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WindowIcon&amp;lt;/code&amp;gt; is an &amp;lt;code&amp;gt;Icon&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt; size of 10px that is vertically centered. Top and bottom spacers with &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt; size ensure center alignment.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Centering is indicated because the two elements are equally sized. Any positional bias could be provided by adjusting the relative sizes of the spacers.&lt;br /&gt;
&lt;br /&gt;
The contents of &amp;lt;code&amp;gt;TitleBar&amp;lt;/code&amp;gt; are arranged in &amp;lt;code&amp;gt;Box.body&amp;lt;/code&amp;gt;:&lt;br /&gt;
* &amp;lt;code&amp;gt;WindowIcon&amp;lt;/code&amp;gt; is given a vertical constraint of &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt; and a horizontal constraint of &amp;lt;code&amp;gt;FIT&amp;lt;/code&amp;gt;. It will be as tall as allowed by &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; and only as wide as required by its content.&lt;br /&gt;
* &amp;lt;code&amp;gt;WindowName&amp;lt;/code&amp;gt; is constrained vertically as &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt; and horizontally as &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt;, adapting to available space.&lt;br /&gt;
* &amp;lt;code&amp;gt;Minimize&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Maximize&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;Close&amp;lt;/code&amp;gt; are all given constraints of &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt; in height and width (22px x 26px). Their literal size is defined by the visual.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; is the container with a vertical constraint of &amp;lt;code&amp;gt;FIT&amp;lt;/code&amp;gt; and a horizontal constraint of &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt;. An expression for width restricts its minimum size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;width: max(FIT_CONTENT, 100%)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This takes precedence over the sketch.&lt;br /&gt;
&lt;br /&gt;
The layout ensures that &amp;lt;code&amp;gt;TitleBar&amp;lt;/code&amp;gt; matches the width of its parent window without getting so narrow that the user is unable to interact with the controls.&lt;br /&gt;
&lt;br /&gt;
== Anatomy ==&lt;br /&gt;
&lt;br /&gt;
The structure of &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; is a vertical list of sections, each dedicated to the layout of a single element. Each section is divided into a grid with columns for scenarios and rows for layers and property declarations.&lt;br /&gt;
&lt;br /&gt;
==== Example: SplitView ====&lt;br /&gt;
&lt;br /&gt;
[[File:SplitView_layout_anatomy.png | 720px | Layout section for SplitView with the various parts highlighted and labeled. Identified parts are: Section, Heading, Scenarios, Scenario Condition, Layers, Layer Name, Scenario Layout, Identifier, and Scenario Property Declarations.]] &lt;br /&gt;
&lt;br /&gt;
The heading is the name of the element being laid out.&lt;br /&gt;
&lt;br /&gt;
Layers are stacked vertically in the column for a scenario. If only one layer is needed, the layer name is omitted.&lt;br /&gt;
&lt;br /&gt;
When the scenario shown is the default condition, the scenario condition heading is omitted.&lt;br /&gt;
&lt;br /&gt;
Each scenario and layer has a layout. Layouts are sketched at 1:1 scale.&lt;br /&gt;
&lt;br /&gt;
At the bottom of each column are property declarations. These declarations supersede visual layout statements. They are useful for specifying sizes that are impractical to depict visually and for incorporating expressions.&lt;br /&gt;
&lt;br /&gt;
== Heading ==&lt;br /&gt;
&lt;br /&gt;
The heading identifies the element that is being laid out. If an alias is assigned in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;, the alias is used.&lt;br /&gt;
&lt;br /&gt;
== Scenarios ==&lt;br /&gt;
&lt;br /&gt;
Scenarios are used to create conditional layouts. While the presence or absence of components can be handled in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; using the &amp;lt;code&amp;gt;visibility&amp;lt;/code&amp;gt; property, specific positioning of children must be specified in &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example: OverlayPanel ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  parent: The component that showed the OverlayPanel.&lt;br /&gt;
  ...&lt;br /&gt;
  positioning: Specifies the positioning of the panel relative to the parent:&lt;br /&gt;
    NONE: The panel is not positioned relative to any other component.&lt;br /&gt;
    PARENT: The panel is positioned relative to the parent. Default.&lt;br /&gt;
&lt;br /&gt;
State:&lt;br /&gt;
  vertical_orientation: Whether the OverlayPanel is placed above or below the&lt;br /&gt;
                        its parent, this is determined based on the position&lt;br /&gt;
                        of the parent and the size of the body. If the body&lt;br /&gt;
                        can fit entirely below the parent then the orientation&lt;br /&gt;
                        will be BELOW, otherwise it will be ABOVE.&lt;br /&gt;
    BELOW: The OverlayPanel is below the parent.&lt;br /&gt;
    ABOVE: The OverlayPanel is above the parent.&lt;br /&gt;
&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OverlayPanel_layout.png | 720px | Layout for OverlayPanel.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;OverlayPanel&amp;lt;/code&amp;gt; has a conditional layout based on whether the panel is: - &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; - &amp;lt;code&amp;gt;positioning = PARENT and vertical_orientation = BELOW&amp;lt;/code&amp;gt; - &amp;lt;code&amp;gt;positioning = PARENT and vertical_orientation = ABOVE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are the scenario conditions.&lt;br /&gt;
&lt;br /&gt;
Scenario evaluation follows a right-to-left (and bottom-to-top if applicable) sequence: the first matching scenario takes effect. In the &amp;lt;code&amp;gt;OverlayPanel&amp;lt;/code&amp;gt; example, the match depends on &amp;lt;code&amp;gt;parent&amp;lt;/code&amp;gt;’s location relative to the screen and the size of &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Scenario conditions are written using selectors. Refer to the [https://wiki.spiretrading.com/index.php/Components#Selectors documentation for selectors on components] for details on using selectors to specify a condition.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
Layouts can be separated into layers. This is done by prepending &amp;lt;code&amp;gt;layer n:&amp;lt;/code&amp;gt; before the layout, where &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; is the layer number. Layers are zero-indexed and arranged vertically from bottom to top. Lower layers have ''z-priority''.&lt;br /&gt;
&lt;br /&gt;
Layers are useful for specifying where components need to overlap.&lt;br /&gt;
&lt;br /&gt;
=== Example: DecimalBox ===&lt;br /&gt;
&lt;br /&gt;
[[File:DecimalBox_layout.png | 720px | Layout for DecimalBox.]]&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt; is placed on layer 0 while the step buttons &amp;lt;code&amp;gt;Increment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Decrement&amp;lt;/code&amp;gt; are placed on layer 1. This allows the step buttons to be visually nested in the &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt; without modifying the &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt; layout.&lt;br /&gt;
&lt;br /&gt;
[[File:DecimalBox_preview.png | 720px | Preview for DecimalBox.]]&lt;br /&gt;
&lt;br /&gt;
== Layout ==&lt;br /&gt;
&lt;br /&gt;
The layout is a 1:1 scale sketch of the scenario using the visual layout language. The size used to represent a layout is the ''preferred size''.&lt;br /&gt;
&lt;br /&gt;
Through the use of the visual layout language and property declarations, the layout fully specifies the positions and sizes of an element’s children for all possible sizes of the element.&lt;br /&gt;
&lt;br /&gt;
== Identifier ==&lt;br /&gt;
&lt;br /&gt;
Each element is labeled with an identifier. The identifier is shown in angle brackets as &amp;lt;code&amp;gt;&amp;amp;lt;ElementName&amp;amp;gt;&amp;lt;/code&amp;gt;. Naming follows the '''PascalCase''' convention from &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When an identifier matches the name of an existing component, the layout is for an ''instance'' of that component.&lt;br /&gt;
&lt;br /&gt;
''Slots'', components specified in &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; under Data, earmark children open to substitution with different components. When identifying slots, the '''snake_case''' convention from &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
When an identifier does not match a component name or a slot, the layout is for a spacer or a container used for organizational purposes within the document.&lt;br /&gt;
&lt;br /&gt;
=== Example: SplitView ===&lt;br /&gt;
&lt;br /&gt;
The model for &amp;lt;code&amp;gt;SplitView&amp;lt;/code&amp;gt; shows two slots: &amp;lt;code&amp;gt;primary&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;secondary&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;...&lt;br /&gt;
Data:&lt;br /&gt;
  primary: The primary pane.&lt;br /&gt;
  secondary: The secondary pane.&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, these are represented as &amp;lt;code&amp;gt;&amp;amp;lt;primary&amp;amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;lt;secondary&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:SplitView_layout.png | 720px | Layout for SplitView for HORIZONTAL orientation.]]&lt;br /&gt;
&lt;br /&gt;
Additionally, three named elements are depicted—&amp;lt;code&amp;gt;Padding&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Offset&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;Sash&amp;lt;/code&amp;gt;. These lack correspondence to any components or slots and serve as reference points for property declarations.&lt;br /&gt;
&lt;br /&gt;
While &amp;lt;code&amp;gt;Padding&amp;lt;/code&amp;gt; is intended to be 2px wide, it’s shown at an enlarged size for readability. The declaration is used to provide the true size. A similar approach applies to &amp;lt;code&amp;gt;Sash&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Multiples ==&lt;br /&gt;
&lt;br /&gt;
In a component, you might have several instances of the same type, and their layouts could be identical. In such cases, the element identifiers in &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; drop the index found in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Example: ListView ===&lt;br /&gt;
&lt;br /&gt;
[[File:ListView_components.png | 720px | Definition card for Item within ListView.]]&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; there is a child &amp;lt;code&amp;gt;Item[i]&amp;lt;/code&amp;gt;, as there are multiple &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; children depending on the data given to &amp;lt;code&amp;gt;ListView&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:ListView_layout-2.png | 720px | Layout of Column element in ListView showing two elements labeled Item arranged top-to-bottom with a Repeat-Top-to-Bottom element between them.]]&lt;br /&gt;
&lt;br /&gt;
However, in &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, we simply use &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; without an index in the identifier. Because the layout is positioning the items, specific index values would not accurately convey our intent. Instead, the &amp;lt;code&amp;gt;Repeat&amp;lt;/code&amp;gt; element is used to signify repetition and dictate the direction.&lt;br /&gt;
&lt;br /&gt;
== Property Declaration ==&lt;br /&gt;
&lt;br /&gt;
Property declarations take precedence over the visual layout. Properties come from the child being defined. To understand what’s available, consult its &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;. Generally, only size and position properties, such as &amp;lt;code&amp;gt;width&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;height&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;position&amp;lt;/code&amp;gt; should be declared in &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The key properties are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Property&lt;br /&gt;
! Definition&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;width&amp;lt;/code&amp;gt;&lt;br /&gt;
| The width of the component in pixels.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;height&amp;lt;/code&amp;gt;&lt;br /&gt;
| The height of the component in pixels.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;position&amp;lt;/code&amp;gt;&lt;br /&gt;
| The position of the component relative to its parent, if the component has no parent, then the position is equal to &amp;lt;code&amp;gt;screen_position&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; The x-coordinate in pixels.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; The y-coordinate in pixels.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Property declarations are made using expressions which support basic mathematical operators (&amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;×&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt;) and various functions. These are used for more complex constraints that are not easily visually represented.&lt;br /&gt;
&lt;br /&gt;
A fluid layout with a minimum width of 20px and a maximum width of 100px can be specified as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;width: clamp(20px, FILL_AVAILABLE, 100px)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The preferred size is the middle value (&amp;lt;code&amp;gt;FILL_AVAILABLE&amp;lt;/code&amp;gt;), but it is bounded by 20px and 100px on either side.&lt;br /&gt;
&lt;br /&gt;
Expressions containing dependencies establish a binding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;Offset.width: primary.width - (Sash.width - Divider.width) / 2&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Whenever &amp;lt;code&amp;gt;primary.width&amp;lt;/code&amp;gt; changes, &amp;lt;code&amp;gt;Offset.width&amp;lt;/code&amp;gt; will also change.&lt;br /&gt;
&lt;br /&gt;
=== Expression Values and Units ===&lt;br /&gt;
&lt;br /&gt;
Expressions use a fixed set of units and preset values.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Unit / Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; px&lt;br /&gt;
| A literal amount in pixels&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; ch&lt;br /&gt;
| The width of the “0” character for the element font. A width value of &amp;lt;code&amp;gt;6ch&amp;lt;/code&amp;gt; is approximately 6 characters wide in the specified font.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; em&lt;br /&gt;
| Represents the calculated font size of the element.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; %&lt;br /&gt;
| A percentage amount relative to the immediate parent layout&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;FILL_AVAILABLE&amp;lt;/code&amp;gt;&lt;br /&gt;
| Fills its parent&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;FIT_CONTENT&amp;lt;/code&amp;gt;&lt;br /&gt;
| Fits its contents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additional units may be used provided they have compelling use cases and are documented. The above units come from [https://developer.mozilla.org/en-US/docs/Web/CSS/length CSS]&lt;br /&gt;
&lt;br /&gt;
=== Expression Functions ===&lt;br /&gt;
&lt;br /&gt;
Any function can be used in an expression provided its definition is provided or it is sufficiently self-explanatory. In practice, it is best to stick to a limited set of functions. The following have been used in layout specifications:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;min(a, b)&amp;lt;/code&amp;gt; &lt;br /&gt;
| The minimum of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;max(a, b)&amp;lt;/code&amp;gt; &lt;br /&gt;
| The maximum of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;clamp(lower, value, upper)&amp;lt;/code&amp;gt; &lt;br /&gt;
| &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;, clamped to between &amp;lt;code&amp;gt;lower&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;upper&amp;lt;/code&amp;gt; (inclusive) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These have CSS equivalents:&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/CSS/min min()]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/CSS/max max()]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/CSS/clamp clamp()]&lt;br /&gt;
&lt;br /&gt;
Expressions can also be set to animation values as outlined in the documentation on [https://wiki.spiretrading.com/index.php/Animations Animations].&lt;br /&gt;
&lt;br /&gt;
==== Example: DropDownList ====&lt;br /&gt;
&lt;br /&gt;
[[File:DropDownList_layout.png | 720px | Layout for DropDownList.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DropDownList&amp;lt;/code&amp;gt; sets the &amp;lt;code&amp;gt;width&amp;lt;/code&amp;gt; to the greater of its parent’s width or the content width of the &amp;lt;code&amp;gt;ScrollableListBox&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;height&amp;lt;/code&amp;gt; is set dynamically to display either ten items or all available items, whichever is less.&lt;br /&gt;
&lt;br /&gt;
== Ordering ==&lt;br /&gt;
&lt;br /&gt;
When structuring &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, maintain an order mirroring &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;—from innermost to outermost. This ensures clarity and consistency.&lt;br /&gt;
&lt;br /&gt;
=== Example: TabView ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; lists a &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt;, a &amp;lt;code&amp;gt;ScrollableListBox&amp;lt;/code&amp;gt;, and a custom &amp;lt;code&amp;gt;ListView&amp;lt;/code&amp;gt; that uses a &amp;lt;code&amp;gt;Tab&amp;lt;/code&amp;gt; component for each &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TabView_components.png | 720px | Definition cards for the children of TabView.]]&lt;br /&gt;
&lt;br /&gt;
From top to bottom, the order is: &lt;br /&gt;
* Tab[i]&lt;br /&gt;
* ListItem[i]&lt;br /&gt;
* ListView:TabList&lt;br /&gt;
* ScrollableListBox&lt;br /&gt;
* Box:TabBar&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; lays out &amp;lt;code&amp;gt;TabView&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;TabBar&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt;, along with two spacing elements. &amp;lt;code&amp;gt;TabBar&amp;lt;/code&amp;gt; is laid out as &amp;lt;code&amp;gt;ScrollableListBox&amp;lt;/code&amp;gt; and a spacer, and &amp;lt;code&amp;gt;ScrollableListBox&amp;lt;/code&amp;gt; is laid out as &amp;lt;code&amp;gt;TabList&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:TabView_layout.png | 720px | Layout for TabView.]]&lt;br /&gt;
&lt;br /&gt;
From top to bottom, the order is:&lt;br /&gt;
* ScrollableListBox&lt;br /&gt;
* TabBar&lt;br /&gt;
* TabView&lt;br /&gt;
&lt;br /&gt;
Unlike &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TabView&amp;lt;/code&amp;gt; itself is included in &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;. As in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ScrollableListBox&amp;lt;/code&amp;gt; comes before &amp;lt;code&amp;gt;TabBar&amp;lt;/code&amp;gt; as the order moves from innermost to outermost. While &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; lists &amp;lt;code&amp;gt;TabList&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ListItem[i]&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Tab[i]&amp;lt;/code&amp;gt;, they are absent from &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;. As these components all specify their layouts and &amp;lt;code&amp;gt;TabView&amp;lt;/code&amp;gt; does not override any of these layouts, they are omitted.&lt;br /&gt;
&lt;br /&gt;
== Referencing ==&lt;br /&gt;
&lt;br /&gt;
In property declarations, only elements positioned higher in the document can be referenced.&lt;br /&gt;
&lt;br /&gt;
=== Example: HighlightPicker ===&lt;br /&gt;
&lt;br /&gt;
[[File:HighlightPicker_layout.png | Layout for HighlightPicker.]]&lt;br /&gt;
&lt;br /&gt;
The property declaration in &amp;lt;code&amp;gt;OverlayPanel.body&amp;lt;/code&amp;gt; references the width of &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;HighlightPalette.width: 8 * ListItem.width&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This is a valid reference, as &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; is a child of &amp;lt;code&amp;gt;OverlayPanel.body&amp;lt;/code&amp;gt; so the layout for &amp;lt;code&amp;gt;ListItem.body&amp;lt;/code&amp;gt; comes above that for &amp;lt;code&amp;gt;OverlayPanel.body&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Adaptive Layouts ==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is necessary to specify a different layout according to the available space. Instead of a gradual transition of elements, a step-change may be appropriate such as switching between an even grid and a linear arrangement, or switching labels between a long-form and a short-hand. Consider the &amp;lt;code&amp;gt;TechnicalsPanel&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;BookView&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:TechnicalsPanel_preview.png | 720px | Preview for Technicals Panel showing Book View Window at different widths.]]&lt;br /&gt;
&lt;br /&gt;
The six technical indicators &amp;lt;code&amp;gt;High&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Low&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Open&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Close&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Def&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;Vol&amp;lt;/code&amp;gt; are shown stacked in a 3x2 grid or linearly as a 6x1 row. They are also shown either as a full name (e.g. &amp;lt;code&amp;gt;High&amp;lt;/code&amp;gt;) or an abbreviation (e.g. &amp;lt;code&amp;gt;H&amp;lt;/code&amp;gt;). There should be a step-change between the 3x2 and 6x1 arrangements, as a partially filled second row makes for more difficult reading. There should also be a step-change between full labels and abbreviations, since if the labels are not coordinated it becomes visually confusing.&lt;br /&gt;
&lt;br /&gt;
This behavior is not specified directly in the visual layout language. Instead, a purpose-built component &amp;lt;code&amp;gt;AdaptiveBox&amp;lt;/code&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
To use &amp;lt;code&amp;gt;AdaptiveBox&amp;lt;/code&amp;gt;, the designer specifies each layout within &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;. It is convention to use size-based naming: &amp;lt;code&amp;gt;ExtraSmall&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Small&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Medium&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Large&amp;lt;/code&amp;gt;, but this can be adjusted to suit the specific use-case. &amp;lt;code&amp;gt;AdaptiveBox&amp;lt;/code&amp;gt; is placed in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; and its &amp;lt;code&amp;gt;components&amp;lt;/code&amp;gt; property is set to a list containing the named layouts.&lt;br /&gt;
&lt;br /&gt;
[[File:TechnicalsPanel_components.png | 720px | Definition cards for children of TechnicalsPanel.]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;components&amp;lt;/code&amp;gt; are listed in order of largest size to smallest size when passed to &amp;lt;code&amp;gt;AdaptiveBox&amp;lt;/code&amp;gt;. Within &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, the layout for &amp;lt;code&amp;gt;AdaptiveBox&amp;lt;/code&amp;gt; and each layout in &amp;lt;code&amp;gt;layouts&amp;lt;/code&amp;gt; is specified.&lt;br /&gt;
&lt;br /&gt;
[[File:TechnicalsPanel_layout.png | 720px | Layout for TechnicalsPanel.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AdaptiveBox&amp;lt;/code&amp;gt; then manages which layout is displayed based on the available space. There is no specifying of fixed-pixel ''breakpoints''.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
When laying out children from &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; that have been assigned an alias, use the alias to title the layout. When laying out a component slot, use dot notation to title the slot (e.g. &amp;lt;code&amp;gt;Box.body&amp;lt;/code&amp;gt;) and avoid repeating the layout for the component itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; is used to bring a component together, formalizing the position and size relations of it and its children. Approach &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; after fully utilizing &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; to enumerate the component’s children and with a firm understanding of how the component will adjust at different sizes.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [https://drive.spiretrading.com/f/91480 Layout Reference Document] &lt;br /&gt;
* [https://wiki.spiretrading.com/index.php/Components#Selectors Selectors Documentation] &lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/CSS/length CSS Length Units] &lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/CSS/clamp Clamp Function]&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TechnicalsPanel_layout.png&amp;diff=226</id>
		<title>File:TechnicalsPanel layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TechnicalsPanel_layout.png&amp;diff=226"/>
		<updated>2024-03-19T15:32:43Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for Technicals Panel component.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for Technicals Panel component.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TechnicalsPanel_components.png&amp;diff=225</id>
		<title>File:TechnicalsPanel components.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TechnicalsPanel_components.png&amp;diff=225"/>
		<updated>2024-03-19T15:32:15Z</updated>

		<summary type="html">&lt;p&gt;Jon: Definition cards for the children of Technicals Panel in components.xd.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Definition cards for the children of Technicals Panel in components.xd.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TechnicalsPanel_preview.png&amp;diff=224</id>
		<title>File:TechnicalsPanel preview.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TechnicalsPanel_preview.png&amp;diff=224"/>
		<updated>2024-03-19T15:31:35Z</updated>

		<summary type="html">&lt;p&gt;Jon: Preview of the Technicals Panel component.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Preview of the Technicals Panel component.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:HighlightPicker_layout.png&amp;diff=223</id>
		<title>File:HighlightPicker layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:HighlightPicker_layout.png&amp;diff=223"/>
		<updated>2024-03-19T15:31:01Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for HighlightPicker component.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for HighlightPicker component.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TabView_layout.png&amp;diff=222</id>
		<title>File:TabView layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TabView_layout.png&amp;diff=222"/>
		<updated>2024-03-19T15:30:33Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for TabView component.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for TabView component.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TabView_components.png&amp;diff=221</id>
		<title>File:TabView components.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TabView_components.png&amp;diff=221"/>
		<updated>2024-03-19T15:30:06Z</updated>

		<summary type="html">&lt;p&gt;Jon: Definition cards for the children of TabView in components.xd.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Definition cards for the children of TabView in components.xd.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:DropDownList_layout.png&amp;diff=220</id>
		<title>File:DropDownList layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:DropDownList_layout.png&amp;diff=220"/>
		<updated>2024-03-19T15:29:27Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for DropDownList component.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for DropDownList component.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:ListView_components.png&amp;diff=219</id>
		<title>File:ListView components.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:ListView_components.png&amp;diff=219"/>
		<updated>2024-03-19T15:28:53Z</updated>

		<summary type="html">&lt;p&gt;Jon: Definition card for Item sub-component for ListView.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Definition card for Item sub-component for ListView.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:SplitView_layout.png&amp;diff=218</id>
		<title>File:SplitView layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:SplitView_layout.png&amp;diff=218"/>
		<updated>2024-03-19T15:28:01Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for SplitView component when orientation is HORIZONTAL.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for SplitView component when orientation is HORIZONTAL.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:DecimalBox_preview.png&amp;diff=217</id>
		<title>File:DecimalBox preview.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:DecimalBox_preview.png&amp;diff=217"/>
		<updated>2024-03-19T15:26:12Z</updated>

		<summary type="html">&lt;p&gt;Jon: Preview for the DecimalBox component.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Preview for the DecimalBox component.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:DecimalBox_layout.png&amp;diff=216</id>
		<title>File:DecimalBox layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:DecimalBox_layout.png&amp;diff=216"/>
		<updated>2024-03-19T15:25:32Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for the DecimalBox component.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for the DecimalBox component.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:OverlayPanel_layout.png&amp;diff=215</id>
		<title>File:OverlayPanel layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:OverlayPanel_layout.png&amp;diff=215"/>
		<updated>2024-03-19T15:25:09Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for the OverlayPanel component.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for the OverlayPanel component.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:SplitView_layout_anatomy.png&amp;diff=214</id>
		<title>File:SplitView layout anatomy.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:SplitView_layout_anatomy.png&amp;diff=214"/>
		<updated>2024-03-19T15:24:24Z</updated>

		<summary type="html">&lt;p&gt;Jon: Jon uploaded a new version of File:SplitView layout anatomy.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Breakdown of a layout section for the SplitView component.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:SplitView_layout_anatomy.png&amp;diff=213</id>
		<title>File:SplitView layout anatomy.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:SplitView_layout_anatomy.png&amp;diff=213"/>
		<updated>2024-03-19T15:21:24Z</updated>

		<summary type="html">&lt;p&gt;Jon: Breakdown of a layout section for the SplitView component.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Breakdown of a layout section for the SplitView component.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Slider_Layouts.png&amp;diff=212</id>
		<title>File:Slider Layouts.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Slider_Layouts.png&amp;diff=212"/>
		<updated>2024-03-19T15:01:36Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for the Slider component.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for the Slider component.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TitleBar_layout.png&amp;diff=211</id>
		<title>File:TitleBar layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TitleBar_layout.png&amp;diff=211"/>
		<updated>2024-03-19T14:58:04Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for the TitleBar component.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for the TitleBar component.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TitleBar_preview-2.png&amp;diff=210</id>
		<title>File:TitleBar preview-2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TitleBar_preview-2.png&amp;diff=210"/>
		<updated>2024-03-19T14:57:05Z</updated>

		<summary type="html">&lt;p&gt;Jon: Preview for the TitleBar component.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Preview for the TitleBar component.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:ListView_layout-2.png&amp;diff=209</id>
		<title>File:ListView layout-2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:ListView_layout-2.png&amp;diff=209"/>
		<updated>2024-03-19T14:56:04Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for the Column element within the ListView component.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for the Column element within the ListView component.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:ListView_layout.png&amp;diff=208</id>
		<title>File:ListView layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:ListView_layout.png&amp;diff=208"/>
		<updated>2024-03-19T14:55:20Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for the body of the Box sub-component of ListView when the direction is VERTICAL and the overflow is WRAP.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for the body of the Box sub-component of ListView when the direction is VERTICAL and the overflow is WRAP.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Example2_3.png&amp;diff=207</id>
		<title>File:Example2 3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Example2_3.png&amp;diff=207"/>
		<updated>2024-03-19T14:54:00Z</updated>

		<summary type="html">&lt;p&gt;Jon: Example layout of three elements: A, an anonymous spacer, and B, with an overall width of 640 pixels.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Example layout of three elements: A, an anonymous spacer, and B, with an overall width of 640 pixels.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Example2_2.png&amp;diff=206</id>
		<title>File:Example2 2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Example2_2.png&amp;diff=206"/>
		<updated>2024-03-19T14:53:19Z</updated>

		<summary type="html">&lt;p&gt;Jon: Example layout of two elements A and B with an overall width of 256 pixels.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Example layout of two elements A and B with an overall width of 256 pixels.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Example2_1.png&amp;diff=205</id>
		<title>File:Example2 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Example2_1.png&amp;diff=205"/>
		<updated>2024-03-19T14:52:44Z</updated>

		<summary type="html">&lt;p&gt;Jon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Example layout of three elements: A, an anonymous spacer, and B, with an overall width of 320 pixels.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Example2_1.png&amp;diff=204</id>
		<title>File:Example2 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Example2_1.png&amp;diff=204"/>
		<updated>2024-03-19T14:52:23Z</updated>

		<summary type="html">&lt;p&gt;Jon: Example layout of three elements: A, and anonymous spacer, and B, with an overall width of 320 pixels.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Example layout of three elements: A, and anonymous spacer, and B, with an overall width of 320 pixels.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Example1_3.png&amp;diff=203</id>
		<title>File:Example1 3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Example1_3.png&amp;diff=203"/>
		<updated>2024-03-19T14:51:42Z</updated>

		<summary type="html">&lt;p&gt;Jon: Example layout of two elements A and B with an overall width of 640 pixels.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Example layout of two elements A and B with an overall width of 640 pixels.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Example1_2.png&amp;diff=202</id>
		<title>File:Example1 2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Example1_2.png&amp;diff=202"/>
		<updated>2024-03-19T14:51:00Z</updated>

		<summary type="html">&lt;p&gt;Jon: Example layout showing a single element A with an overall width of 128 pixels.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Example layout showing a single element A with an overall width of 128 pixels.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Example1_1.png&amp;diff=201</id>
		<title>File:Example1 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Example1_1.png&amp;diff=201"/>
		<updated>2024-03-19T14:50:21Z</updated>

		<summary type="html">&lt;p&gt;Jon: Example layout for two elements A and B with an overall width of 320 pixels.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Example layout for two elements A and B with an overall width of 320 pixels.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Positioning_2.png&amp;diff=200</id>
		<title>File:Positioning 2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Positioning_2.png&amp;diff=200"/>
		<updated>2024-03-19T14:48:39Z</updated>

		<summary type="html">&lt;p&gt;Jon: Diagram of an element named Item positioned within its parent container. Surrounding elements A, B, C, and D fill the space between Item and the edges of the container.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Diagram of an element named Item positioned within its parent container. Surrounding elements A, B, C, and D fill the space between Item and the edges of the container.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Positioning_1.png&amp;diff=199</id>
		<title>File:Positioning 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Positioning_1.png&amp;diff=199"/>
		<updated>2024-03-19T14:47:12Z</updated>

		<summary type="html">&lt;p&gt;Jon: Diagram of an element named Item arbitrarily positioned within its parent container.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Diagram of an element named Item arbitrarily positioned within its parent container.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Box_layout.png&amp;diff=198</id>
		<title>File:Box layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Box_layout.png&amp;diff=198"/>
		<updated>2024-03-19T14:45:43Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for Box, detailing the arrangement of border, padding, and body elements.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for Box, detailing the arrangement of border, padding, and body elements.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Box_preview.png&amp;diff=197</id>
		<title>File:Box preview.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Box_preview.png&amp;diff=197"/>
		<updated>2024-03-19T14:44:38Z</updated>

		<summary type="html">&lt;p&gt;Jon: Preview of Box component, showing its usage in various components including TextBox and LabelButton.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Preview of Box component, showing its usage in various components including TextBox and LabelButton.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:LayoutExamples.png&amp;diff=196</id>
		<title>File:LayoutExamples.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:LayoutExamples.png&amp;diff=196"/>
		<updated>2024-03-19T14:43:23Z</updated>

		<summary type="html">&lt;p&gt;Jon: Examples of layout elements with color-encoded constraints applied.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Examples of layout elements with color-encoded constraints applied.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:LayoutColorSemantics.png&amp;diff=195</id>
		<title>File:LayoutColorSemantics.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:LayoutColorSemantics.png&amp;diff=195"/>
		<updated>2024-03-19T14:42:15Z</updated>

		<summary type="html">&lt;p&gt;Jon: Overview of color encoding of elements and their semantics within a layout.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Overview of color encoding of elements and their semantics within a layout.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:LayoutSpecificity.png&amp;diff=194</id>
		<title>File:LayoutSpecificity.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:LayoutSpecificity.png&amp;diff=194"/>
		<updated>2024-03-19T14:41:34Z</updated>

		<summary type="html">&lt;p&gt;Jon: Overview of constraint specificity for elements within a layout.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Overview of constraint specificity for elements within a layout.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Element_Basics.png&amp;diff=193</id>
		<title>File:Element Basics.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Element_Basics.png&amp;diff=193"/>
		<updated>2024-03-19T14:40:30Z</updated>

		<summary type="html">&lt;p&gt;Jon: Diagram of basic element properties within a layout.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Diagram of basic element properties within a layout.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Slider_layout_Slider.png&amp;diff=192</id>
		<title>File:Slider layout Slider.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Slider_layout_Slider.png&amp;diff=192"/>
		<updated>2024-03-19T14:39:44Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout section for Slider.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout section for Slider.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Slider_layout_Box.body.png&amp;diff=191</id>
		<title>File:Slider layout Box.body.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Slider_layout_Box.body.png&amp;diff=191"/>
		<updated>2024-03-19T14:38:04Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for the body of Box sub-component of Slider.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for the body of Box sub-component of Slider.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Slider_layout_Track.body.png&amp;diff=190</id>
		<title>File:Slider layout Track.body.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Slider_layout_Track.body.png&amp;diff=190"/>
		<updated>2024-03-19T14:37:34Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for the body of Track sub-component of Slider.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for the body of Track sub-component of Slider.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Slider_layout_Thumb.png&amp;diff=189</id>
		<title>File:Slider layout Thumb.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Slider_layout_Thumb.png&amp;diff=189"/>
		<updated>2024-03-19T14:36:46Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for Thumb sub-component of Slider.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for Thumb sub-component of Slider.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Slider_components.png&amp;diff=188</id>
		<title>File:Slider components.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Slider_components.png&amp;diff=188"/>
		<updated>2024-03-19T14:35:49Z</updated>

		<summary type="html">&lt;p&gt;Jon: Definition cards for Slider's children from components.xd.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Definition cards for Slider's children from components.xd.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Slider_preview.png&amp;diff=187</id>
		<title>File:Slider preview.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Slider_preview.png&amp;diff=187"/>
		<updated>2024-03-19T14:33:53Z</updated>

		<summary type="html">&lt;p&gt;Jon: Preview for Slider component.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Preview for Slider component.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Animations&amp;diff=186</id>
		<title>Animations</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Animations&amp;diff=186"/>
		<updated>2024-01-30T20:41:31Z</updated>

		<summary type="html">&lt;p&gt;Jon: Created page with &amp;quot;Animations in Spire follow a philosophy of enhancing clarity and communication without embellishment or impedance to the user.  In CSS there are transitions, in Spire an anima...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Animations in Spire follow a philosophy of enhancing clarity and communication without embellishment or impedance to the user.&lt;br /&gt;
&lt;br /&gt;
In CSS there are transitions, in Spire an animation is just a value. This means that a property value such as &amp;lt;code&amp;gt;background_color&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;border_color&amp;lt;/code&amp;gt; can be directly set to an animation value to achieve a property value that changes over time.&lt;br /&gt;
&lt;br /&gt;
== Example: Rejected Style for InputBox ==&lt;br /&gt;
&lt;br /&gt;
[[File:TextBox_Rejected.gif|720px|Animation of TextBox Rejected style]]&lt;br /&gt;
&lt;br /&gt;
When the InputBox is in the &amp;lt;code&amp;gt;rejected&amp;lt;/code&amp;gt; state, an animation plays. The animation can be defined as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;background_color: chain(timeout(#FFF1F1, 250ms), linear(#FFF1F1, revert, 300ms))&lt;br /&gt;
border_color: chain(timeout(#B71C1C, 550ms), revert)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In this case the value says:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Chain together two styles, the first style is a value of &amp;lt;code&amp;gt;#FFF1F1&amp;lt;/code&amp;gt; that times out after 250ms, the second value is a linear interpolation from &amp;lt;code&amp;gt;#FFF1F1&amp;lt;/code&amp;gt; to whatever the style was before (that’s what &amp;lt;code&amp;gt;revert&amp;lt;/code&amp;gt; does), over 300ms.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Border color is styled as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Chain two styles, the first is the color &amp;lt;code&amp;gt;#B71C1C&amp;lt;/code&amp;gt; that expires after 550ms and then reverts to whatever it was previously.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
This is reflected in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; for InputBox.&lt;br /&gt;
&lt;br /&gt;
[[File:InputBox_components.png|720px|Definition card for Box in InputBox]]&lt;br /&gt;
&lt;br /&gt;
When the InputBox is &amp;lt;code&amp;gt;rejected&amp;lt;/code&amp;gt;, property declarations are made for the &amp;lt;code&amp;gt;background_color&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;color&amp;lt;/code&amp;gt; that are animation values. Whenever the InputBox is put into the &amp;lt;code&amp;gt;rejected&amp;lt;/code&amp;gt; state, the animations will play.&lt;br /&gt;
&lt;br /&gt;
Each property value is independent, and there is no necessary connection between the timing used for the animation values for each property.&lt;br /&gt;
&lt;br /&gt;
== Example: Uptick/Downtick Style for DecimalBox ==&lt;br /&gt;
&lt;br /&gt;
[[File:DecimalBox_Uptick_Downtick.gif|720px|Uptick and downtick animation style on DecimalBox]]&lt;br /&gt;
&lt;br /&gt;
When the DecimalBox uses the uptick/downtick styling, its background color flashes when its value changes, reflecting whether the value increased or decreased.&lt;br /&gt;
&lt;br /&gt;
When the value increases, it is uptick:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;background_color: linear(#EBFFF0, revert, 550ms)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
When the value decreases, it is downtick:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;background_color: linear(#FFF1F1, revert, 550ms)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functions ==&lt;br /&gt;
&lt;br /&gt;
Unlike static values, animation values use functions that allow them to change over time. The list of functions that have been used are as follows: &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
  ! Function!! Decription&lt;br /&gt;
|-&lt;br /&gt;
  | &amp;lt;code&amp;gt;chain(X, Y, *ARGS)&amp;lt;/code&amp;gt; || An animation that applies &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; until &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; ends, then applies &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; until &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; ends, and so on for any additional arguments.&lt;br /&gt;
|-&lt;br /&gt;
  | &amp;lt;code&amp;gt;timeout(X, Y)&amp;lt;/code&amp;gt; || Applies &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; for a period of &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. &lt;br /&gt;
|- &lt;br /&gt;
  | &amp;lt;code&amp;gt;linear(X, Y, Z)&amp;lt;/code&amp;gt; || Linearly interpolates from &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; over a period &amp;lt;code&amp;gt;Z&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;linear = cubic_bezier(0.0, 0.0, 1.0, 1.0)&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
  | &amp;lt;code&amp;gt;ease(X, Y, Z)&amp;lt;/code&amp;gt; || Interpolates from &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; over a period &amp;lt;code&amp;gt;Z&amp;lt;/code&amp;gt; using the &amp;lt;code&amp;gt;ease&amp;lt;/code&amp;gt; timing function. &amp;lt;code&amp;gt;ease = cubic_bezier(0.25, 0.1, 0.25, 1.0)&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additional functions may be added provided they have a clear use case and are documented.&lt;br /&gt;
&lt;br /&gt;
== Keywords ==&lt;br /&gt;
&lt;br /&gt;
Values within functions may be literal values (e.g. a color value or a time in milliseconds), or they may be a keyword with a defined meaning.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 ! Keyword!! Decription&lt;br /&gt;
|-&lt;br /&gt;
  | &amp;lt;code&amp;gt;revert&amp;lt;/code&amp;gt; || Applies whatever style would have otherwise been applied.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Web/CSS/easing-function Easing Functions] &lt;br /&gt;
* [https://easings.net/ Easing Functions Cheat Sheet]&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TextBox_Rejected.gif&amp;diff=185</id>
		<title>File:TextBox Rejected.gif</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TextBox_Rejected.gif&amp;diff=185"/>
		<updated>2024-01-30T20:40:32Z</updated>

		<summary type="html">&lt;p&gt;Jon: Rejected animation style for TextBox.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Rejected animation style for TextBox.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:DecimalBox_Uptick_Downtick.gif&amp;diff=184</id>
		<title>File:DecimalBox Uptick Downtick.gif</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:DecimalBox_Uptick_Downtick.gif&amp;diff=184"/>
		<updated>2024-01-30T20:40:02Z</updated>

		<summary type="html">&lt;p&gt;Jon: Uptick and Downtick animation style for DecimalBox.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Uptick and Downtick animation style for DecimalBox.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:DecimalBox_Uptick_Downtick.webp&amp;diff=183</id>
		<title>File:DecimalBox Uptick Downtick.webp</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:DecimalBox_Uptick_Downtick.webp&amp;diff=183"/>
		<updated>2024-01-30T19:32:32Z</updated>

		<summary type="html">&lt;p&gt;Jon: Uptick and downtick animations for DecimalBox.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Uptick and downtick animations for DecimalBox.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TextBox_Rejected.webp&amp;diff=182</id>
		<title>File:TextBox Rejected.webp</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TextBox_Rejected.webp&amp;diff=182"/>
		<updated>2024-01-30T19:07:27Z</updated>

		<summary type="html">&lt;p&gt;Jon: Rejected animation for TextBox&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Rejected animation for TextBox&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:InputBox_components.png&amp;diff=181</id>
		<title>File:InputBox components.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:InputBox_components.png&amp;diff=181"/>
		<updated>2024-01-30T18:55:05Z</updated>

		<summary type="html">&lt;p&gt;Jon: Definition card for Box from components.xd for InputBox&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Definition card for Box from components.xd for InputBox&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
</feed>