# StyleQuery

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/StyleQuery/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/StyleQuery

Instance used to set conditions such as `"MaxSize"` and `"PreferredInput"` for a [`StyleRule`](https://rapi.sleaze.dev/classes/StyleRule.md).

## Properties

### IsActive

```luau
StyleQuery.IsActive: boolean = false
```

- Tags: Read only, Capabilities: UI, Save only

A boolean that determines whether a [`StyleRule.Selector`](https://rapi.sleaze.dev/classes/StyleRule.md) of `@` will match the [`StyleQuery`](https://rapi.sleaze.dev/classes/StyleQuery.md) name.

### AspectRatioRange

```luau
StyleQuery.AspectRatioRange: NumberRange = 0 inf
```

- Tags: Not replicated, Not scriptable, Read: Roblox engine security, Read capabilities: UI

### MaxSize

```luau
StyleQuery.MaxSize: Vector2 = INF, INF
```

- Tags: Not replicated, Not scriptable, Read: Roblox engine security, Read capabilities: UI

### MinSize

```luau
StyleQuery.MinSize: Vector2 = Vector2.zero
```

- Tags: Not replicated, Not scriptable, Read: Roblox engine security, Read capabilities: UI

### PreferredInput

```luau
StyleQuery.PreferredInput: Enum.PreferredInput = Enum.PreferredInput.KeyboardAndMouse
```

- Tags: Not replicated, Not scriptable, Read: Roblox engine security, Read capabilities: UI

### PreferredTextSize

```luau
StyleQuery.PreferredTextSize: Enum.PreferredTextSize = Enum.PreferredTextSize.Medium
```

- Tags: Not replicated, Not scriptable, Read: Roblox engine security, Read capabilities: UI

### ReducedMotionEnabled

```luau
StyleQuery.ReducedMotionEnabled: boolean = false
```

- Tags: Not replicated, Not scriptable, Read: Roblox engine security, Read capabilities: UI

### ViewportDisplaySize

```luau
StyleQuery.ViewportDisplaySize: Enum.DisplaySize = Enum.DisplaySize.Small
```

- Tags: Not replicated, Not scriptable, Read: Roblox engine security, Read capabilities: UI

### ConditionsSerialize

```luau
StyleQuery.ConditionsSerialize: string = ""
```

- Tags: Hidden, Not scriptable, Roblox engine security, Read capabilities: UI

## Methods

### GetCondition

```luau
StyleQuery:GetCondition(name: string): any
```

- Tags: Capabilities: UI

Returns the value of a specific condition in the [`StyleQuery`](https://rapi.sleaze.dev/classes/StyleQuery.md).

Parameters:

- `name`: String name of the condition, for example `"MaxSize"` or `"ViewportDisplaySize"`.

Returns: Value of the condition.

### GetConditions

```luau
StyleQuery:GetConditions(): { [string]: any }
```

- Tags: Capabilities: UI

Returns a dictionary of key-value pairs describing the conditoins set on the [`StyleQuery`](https://rapi.sleaze.dev/classes/StyleQuery.md).

Returns: Dictionary of key-value pairs describing the conditions set on the [`StyleQuery`](https://rapi.sleaze.dev/classes/StyleQuery.md).

### SetCondition

```luau
StyleQuery:SetCondition(name: string, value: any)
```

- Tags: Capabilities: UI

Parameters:

- `name`: Condition name to set, for example `"MinSize"`.
- `value`: Condition value to set, for example `Vector2.new(100, 0)`.

### SetConditions

```luau
StyleQuery:SetConditions(conditions: { [string]: any })
```

- Tags: Capabilities: UI

Lets you declare and set multiple conditions of the [`StyleQuery`](https://rapi.sleaze.dev/classes/StyleQuery.md) at once.

Parameters:

- `conditions`: Dictionary of key-value pairs defining the conditions to set.

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
