Factorio.com|Forums|Wiki|Mod Portal|API Docs Prototype|Runtime|Auxiliary

# Factorio Prototype Docs Version 2.0.7

## BaseStyleSpecification :: struct - abstract Example code

The abstract base of all StyleSpecifications.

Children ActivityBarStyleSpecification DropDownStyleSpecification EmptyWidgetStyleSpecification CameraStyleSpecification MinimapStyleSpecification FlowStyleSpecification FrameStyleSpecification GlowStyleSpecification GraphStyleSpecification HorizontalFlowStyleSpecification ImageStyleSpecification LabelStyleSpecification LineStyleSpecification ListBoxStyleSpecification ProgressBarStyleSpecification ScrollBarStyleSpecification HorizontalScrollBarStyleSpecification VerticalScrollBarStyleSpecification ScrollPaneStyleSpecification SliderStyleSpecification DoubleSliderStyleSpecification SpeechBubbleStyleSpecification StyleWithClickableGraphicalSetSpecification ButtonStyleSpecification TechnologySlotStyleSpecification CheckBoxStyleSpecification RadioButtonStyleSpecification TabStyleSpecification SwitchStyleSpecification TabbedPaneStyleSpecification TableStyleSpecification TextBoxStyleSpecification VerticalFlowStyleSpecification

## Properties

- default
- sorted

parent optional | :: string | Name of a StyleSpecification. [...]
Name of a StyleSpecification. [...]
horizontal_align optional | :: HorizontalAlign |
vertical_align optional | :: VerticalAlign |
ignored_by_search optional | :: bool |
never_hide_by_search optional | :: bool |
horizontally_stretchable optional | :: StretchRule |
vertically_stretchable optional | :: StretchRule |
horizontally_squashable optional | :: StretchRule |
vertically_squashable optional | :: StretchRule |
natural_size optional | :: uint32 or {uint32, uint32} | If this is a tuple, the first member sets `natural_width` and the second sets `natural_height`. [...]
If this is a tuple, the first member sets `natural_width` and the second sets `natural_height`. [...]
size optional | :: uint32 or {uint32, uint32} | If this is a tuple, the first member sets `width`, and the second sets `height`. [...]
If this is a tuple, the first member sets `width`, and the second sets `height`. [...]
width optional | :: uint32 | Sets `minimal_width`, `maximal_width` and `natural_width` to the same value.
Sets `minimal_width`, `maximal_width` and `natural_width` to the same value.
minimal_width optional | :: uint32 | Minimal width ensures that the widget will never be smaller than than that size. [...]
Minimal width ensures that the widget will never be smaller than than that size. [...]
maximal_width optional | :: uint32 | Maximal width ensures that the widget will never be bigger than than that size. [...]
Maximal width ensures that the widget will never be bigger than than that size. [...]
natural_width optional | :: uint32 | Natural width specifies the width of the element tries to have, but it can still be squashed/stretched to have a different size.
Natural width specifies the width of the element tries to have, but it can still be squashed/stretched to have a different size.
height optional | :: uint32 | Sets `minimal_height`, `maximal_height` and `natural_height` to the same value.
Sets `minimal_height`, `maximal_height` and `natural_height` to the same value.
minimal_height optional | :: uint32 | Minimal height ensures that the widget will never be smaller than than that size. [...]
Minimal height ensures that the widget will never be smaller than than that size. [...]
maximal_height optional | :: uint32 | Maximal height ensures that the widget will never be bigger than than that size. [...]
Maximal height ensures that the widget will never be bigger than than that size. [...]
natural_height optional | :: uint32 | Natural height specifies the height of the element tries to have, but it can still be squashed/stretched to have a different size.
Natural height specifies the height of the element tries to have, but it can still be squashed/stretched to have a different size.
padding optional | :: int16 | Sets `top_padding`, `right_padding`, `bottom_padding` and `left_padding` to the same value.
Sets `top_padding`, `right_padding`, `bottom_padding` and `left_padding` to the same value.
top_padding optional | :: int16 |
right_padding optional | :: int16 |
bottom_padding optional | :: int16 |
left_padding optional | :: int16 |
margin optional | :: int16 | Sets `top_margin`, `right_margin`, `bottom_margin` and `left_margin` to the same value.
Sets `top_margin`, `right_margin`, `bottom_margin` and `left_margin` to the same value.
top_margin optional | :: int16 |
right_margin optional | :: int16 |
bottom_margin optional | :: int16 |
left_margin optional | :: int16 |
effect optional | :: union | Name of a custom GUI effect, which are hard-coded in the game's engine. [...]
Name of a custom GUI effect, which are hard-coded in the game's engine. [...]
effect_opacity optional | :: float |
tooltip optional | :: LocalisedString |

bottom_margin optional | :: int16 |
bottom_padding optional | :: int16 |
effect optional | :: union | Name of a custom GUI effect, which are hard-coded in the game's engine. [...]
Name of a custom GUI effect, which are hard-coded in the game's engine. [...]
effect_opacity optional | :: float |
height optional | :: uint32 | Sets `minimal_height`, `maximal_height` and `natural_height` to the same value.
Sets `minimal_height`, `maximal_height` and `natural_height` to the same value.
horizontal_align optional | :: HorizontalAlign |
horizontally_squashable optional | :: StretchRule |
horizontally_stretchable optional | :: StretchRule |
ignored_by_search optional | :: bool |
left_margin optional | :: int16 |
left_padding optional | :: int16 |
margin optional | :: int16 | Sets `top_margin`, `right_margin`, `bottom_margin` and `left_margin` to the same value.
Sets `top_margin`, `right_margin`, `bottom_margin` and `left_margin` to the same value.
maximal_height optional | :: uint32 | Maximal height ensures that the widget will never be bigger than than that size. [...]
Maximal height ensures that the widget will never be bigger than than that size. [...]
maximal_width optional | :: uint32 | Maximal width ensures that the widget will never be bigger than than that size. [...]
Maximal width ensures that the widget will never be bigger than than that size. [...]
minimal_height optional | :: uint32 | Minimal height ensures that the widget will never be smaller than than that size. [...]
Minimal height ensures that the widget will never be smaller than than that size. [...]
minimal_width optional | :: uint32 | Minimal width ensures that the widget will never be smaller than than that size. [...]
Minimal width ensures that the widget will never be smaller than than that size. [...]
natural_height optional | :: uint32 | Natural height specifies the height of the element tries to have, but it can still be squashed/stretched to have a different size.
Natural height specifies the height of the element tries to have, but it can still be squashed/stretched to have a different size.
natural_size optional | :: uint32 or {uint32, uint32} | If this is a tuple, the first member sets `natural_width` and the second sets `natural_height`. [...]
If this is a tuple, the first member sets `natural_width` and the second sets `natural_height`. [...]
natural_width optional | :: uint32 | Natural width specifies the width of the element tries to have, but it can still be squashed/stretched to have a different size.
Natural width specifies the width of the element tries to have, but it can still be squashed/stretched to have a different size.
never_hide_by_search optional | :: bool |
padding optional | :: int16 | Sets `top_padding`, `right_padding`, `bottom_padding` and `left_padding` to the same value.
Sets `top_padding`, `right_padding`, `bottom_padding` and `left_padding` to the same value.
parent optional | :: string | Name of a StyleSpecification. [...]
Name of a StyleSpecification. [...]
right_margin optional | :: int16 |
right_padding optional | :: int16 |
size optional | :: uint32 or {uint32, uint32} | If this is a tuple, the first member sets `width`, and the second sets `height`. [...]
If this is a tuple, the first member sets `width`, and the second sets `height`. [...]
tooltip optional | :: LocalisedString |
top_margin optional | :: int16 |
top_padding optional | :: int16 |
vertical_align optional | :: VerticalAlign |
vertically_squashable optional | :: StretchRule |
vertically_stretchable optional | :: StretchRule |
width optional | :: uint32 | Sets `minimal_width`, `maximal_width` and `natural_width` to the same value.
Sets `minimal_width`, `maximal_width` and `natural_width` to the same value.

## Properties

### parent :: string optional

Name of a StyleSpecification. This style inherits all property values from its parent.

Styles without a parent property default to the root style for their type. The exception to this are the root styles themselves, as they cannot have a parent set. Due to this, for root styles, some style properties are mandatory and behavior may be unexpected, such as an element not showing up because its size defaults to `0`.

### horizontal_align :: HorizontalAlign optional

Default: `"left"`

### vertical_align :: VerticalAlign optional

Default: `"top"`

### ignored_by_search :: bool optional

### never_hide_by_search :: bool optional

### horizontally_stretchable :: StretchRule optional

Default: `"auto"`

### vertically_stretchable :: StretchRule optional

Default: `"auto"`

### horizontally_squashable :: StretchRule optional

Default: `"auto"`

### vertically_squashable :: StretchRule optional

Default: `"auto"`

### natural_size :: uint32 or {uint32, uint32} optional

If this is a tuple, the first member sets `natural_width` and the second sets `natural_height`. Otherwise, both `natural_width` and `natural_height` are set to the same value.

### size :: uint32 or {uint32, uint32} optional

If this is a tuple, the first member sets `width`, and the second sets `height`. Otherwise, both `width` and `height` are set to the same value.

### width :: uint32 optional

Sets `minimal_width`, `maximal_width` and `natural_width` to the same value.

### minimal_width :: uint32 optional

Default: `0`

Minimal width ensures that the widget will never be smaller than than that size. It can't be squashed to be smaller.

### maximal_width :: uint32 optional

Default: `0`

Maximal width ensures that the widget will never be bigger than than that size. It can't be stretched to be bigger.

### natural_width :: uint32 optional

Default: `0`

Natural width specifies the width of the element tries to have, but it can still be squashed/stretched to have a different size.

### height :: uint32 optional

Sets `minimal_height`, `maximal_height` and `natural_height` to the same value.

### minimal_height :: uint32 optional

Default: `0`

Minimal height ensures that the widget will never be smaller than than that size. It can't be squashed to be smaller.

### maximal_height :: uint32 optional

Default: `0`

Maximal height ensures that the widget will never be bigger than than that size. It can't be stretched to be bigger.

### natural_height :: uint32 optional

Default: `0`

Natural height specifies the height of the element tries to have, but it can still be squashed/stretched to have a different size.

### padding :: int16 optional

Sets `top_padding`, `right_padding`, `bottom_padding` and `left_padding` to the same value.

### top_padding :: int16 optional

Default: `0`

### right_padding :: int16 optional

Default: `0`

### bottom_padding :: int16 optional

Default: `0`

### left_padding :: int16 optional

Default: `0`

### margin :: int16 optional

Sets `top_margin`, `right_margin`, `bottom_margin` and `left_margin` to the same value.

### top_margin :: int16 optional

Default: `0`

### right_margin :: int16 optional

Default: `0`

### bottom_margin :: int16 optional

Default: `0`

### left_margin :: int16 optional

Default: `0`

### effect :: union optional

Name of a custom GUI effect, which are hard-coded in the game's engine. Only has one option currently.

#### Union members

`"compilatron-hologram"` |

### effect_opacity :: float optional

Default: `1.0`

### tooltip :: LocalisedString optional

## Example

    -- Adding a custom frame_style-type style via GuiStyle
    data.raw["gui-style"]["default"]["custom_style_for_a_frame"] =
    {
      type = "frame_style",
      parent = "frame",
      use_header_filler = false,
      drag_by_title = false
    }