Skip to content

Commit

Permalink
[css-values-5] Defined <fraction> more clearly
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianZ committed Nov 23, 2023
1 parent 5de176e commit c4ed916
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions css-values-5/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,18 @@ Other Quantities</h2>
-->

<h3 id="fractions">
Flexible lengths: the <<fraction>> type</h3>

Fraction values are denoted by <dfn id="flex-value">&lt;fraction></dfn>,
and indicate a value that is some fraction of another reference value.
A fraction is a <<dimension>>.
Its unit identifier is <dfn value for="<flex>" lt="fr|fr unit">fr</dfn>.

These values specify
<dfn export lt="flexible length">flexible lengths</dfn>.
Each length defines a portion of a given space
which is specified by the context the type is used in.

The allowed range of <<fraction>>> values
Proportional Fractions: the <<fraction>> type</h3>

<dfn id=flex-fraction>Proportional fractions</dfn> are denoted by <dfn id="fr-value"><<fraction>></dfn>,
which is a <<dimension>> with the <dfn value for="<fraction>" lt="fr|fr unit">fr</dfn> unit.
They represent a fraction of a reference value
(typically a length)
as a proportion in relation to other [=flex fractions=] referencing that same value,
i.e. a value of ''<var>N</var>fr'' represents <var>N</var> / max(<var>sum of all ''fr'' values</var>, 1).
For example, leftover space in [=grid layout=]
is distributed to a ''1fr'' track and a ''2fr'' track in a 1:2 ratio.

The allowed range of <<fraction>> values
<em>always</em> excludes negative values,
in addition to any explicit ranges that might be specified.

Expand Down

0 comments on commit c4ed916

Please sign in to comment.