diff --git a/docs/reference/gtk/css-properties.xml b/docs/reference/gtk/css-properties.xml index 3b80b4ae8e..dc87af55cb 100644 --- a/docs/reference/gtk/css-properties.xml +++ b/docs/reference/gtk/css-properties.xml @@ -53,10 +53,10 @@ We use for syntax productions, and each line is put in a The following basic datatypes are used throughout: -〈length〉 = 〈number〉 [ px | pt | em | ex |rem | pc | in | cm | mm ] -〈percentage〉 = 〈number〉 % -〈angle〉 = 〈number〉 [ deg | grad | turn ] -〈time〉 = 〈number〉 [ s | ms ] +〈length〉 = 〈number〉 [ px | pt | em | ex |rem | pc | in | cm | mm ] | 〈calc expression〉 +〈percentage〉 = 〈number〉 % | 〈calc expression〉 +〈angle〉 = 〈number〉 [ deg | grad | turn ] | 〈calc expression〉 +〈time〉 = 〈number〉 [ s | ms ] | 〈calc expression〉 @@ -70,6 +70,20 @@ We use for syntax productions, and each line is put in a not quite the same as the CSS definition of rem. +〈calc expression〉 = calc( 〈calc sum〉 ) +〈calc sum〉 = 〈calc product〉 [ [ + | - ] 〈calc product〉 ]* +〈calc product〉 = 〈calc value〉 [ * 〈calc value〉 | / 〈number〉 ]* +〈calc value〉 = 〈number〉 | 〈length〉 | 〈percentage〉 | 〈angle〉 | 〈time〉 | ( 〈calc sum〉 ) + + + + The calc() notation adds considerable expressive power. There are limits + on what types can be combined in such an expression (e.g. it does not make + sense to add a number and a time). For the full details, see the + CSS3 Values and + Units spec. + + A common pattern among shorthand properties (called 'four sides') is one where one to four values can be specified, to determine a value for each