TypeScript API Documentation for LIBADWAITA
API Version: 1
Library Version: 1.9.0
Generated with TypeDoc via ts-for-gir v4.0.0-beta.40
Since 1.4
Parses a condition from a string.
Length conditions are specified as <type>: <value>[<unit>], where:
<type>: <value>[<unit>]
<type>
min-width
max-width
min-height
max-height
<value>
<unit>
px
pt
sp
If the unit is omitted, px is assumed.
See BreakpointCondition.new_length.
Examples:
min-width: 500px
min-height: 400pt
max-width: 100sp
max-height: 500
Ratio conditions are specified as <type>: <width>[/<height>], where:
<type>: <width>[/<height>]
min-aspect-ratio
max-aspect-ratio
<width>
<height>
See BreakpointCondition.new_ratio.
The ratio is represented as <width> divided by <height>.
If <height> is omitted, it's assumed to be 1.
min-aspect-ratio: 4/3
max-aspect-ratio: 1
The logical operators and, or can be used to compose a complex condition as follows:
and
or
<condition> and <condition>
<condition>
<condition> or <condition>
min-width: 400px and max-aspect-ratio: 4/3
max-width: 360sp or max-width: 360px
Conditions can be further nested using parentheses, for example:
min-width: 400px and (max-aspect-ratio: 4/3 or max-height: 400px)
If parentheses are omitted, the first operator takes priority.
the string specifying the condition
the parsed condition
1.4
Parses a condition from a string.
Length conditions are specified as
<type>: <value>[<unit>], where:<type>can bemin-width,max-width,min-heightormax-height<value>is a fractional number<unit>can bepx,ptorspIf the unit is omitted,
pxis assumed.See BreakpointCondition.new_length.
Examples:
min-width: 500pxmin-height: 400ptmax-width: 100spmax-height: 500Ratio conditions are specified as
<type>: <width>[/<height>], where:<type>can bemin-aspect-ratioormax-aspect-ratio<width>and<height>are integer numbersSee BreakpointCondition.new_ratio.
The ratio is represented as
<width>divided by<height>.If
<height>is omitted, it's assumed to be 1.Examples:
min-aspect-ratio: 4/3max-aspect-ratio: 1The logical operators
and,orcan be used to compose a complex condition as follows:<condition> and <condition>: the condition is true when both<condition>s are true, same as when using BreakpointCondition.new_and<condition> or <condition>: the condition is true when either of the<condition>s is true, same as when using BreakpointCondition.new_orExamples:
min-width: 400px and max-aspect-ratio: 4/3max-width: 360sp or max-width: 360pxConditions can be further nested using parentheses, for example:
min-width: 400px and (max-aspect-ratio: 4/3 or max-height: 400px)If parentheses are omitted, the first operator takes priority.