You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Represents an amount of distance in a single dimension in the UI, such as a position, width, height, radius, or thickness. The `$type` property MUST be set to the string `dimension`. The value MUST be an object with `value` and `unit`keys.
54
+
Represents an amount of distance in a single dimension in the UI, such as a position, width, height, radius, or thickness. The `$type` property MUST be set to the string `dimension`. The value MUST be an object containing a numeric `value`(integer or floating-point) and `unit`of measurement (`"px"` or `"rem"`).
|`value`|`number`| Y | An integer or floating-point value representing the numeric value. |
59
-
|`unit`|`string`| Y |A string specifying the units of measurement |
59
+
|`unit`|`string`| Y |Unit of distance. Supported values: `"px"`, `"rem"`.|
60
60
61
61
For example:
62
62
@@ -85,8 +85,9 @@ For example:
85
85
86
86
### Validation
87
87
88
-
-`$value.unit` may be any string. It is up to tooling to translate units into the appropriate platform.
89
-
-`$value.unit` may NOT be an empty string (`""`).
88
+
-`$value.unit` may only be `"px"` or `"rem"`.
89
+
-**px**: Represents an idealized pixel on the viewport. The equivalent in Android is `dp` and iOS is `pt`. Translation tools SHOULD therefore convert to these or other equivalent units as needed.
90
+
-**rem**: Represents a multiple of the system's default font size (which MAY be configurable by the user). 1rem is 100% of the default font size. The equivalent of 1rem on Android is 16sp. Not all platforms have an equivalent to rem, so translation tools MAY need to do a lossy conversion to a fixed px size by assuming a default font size (usually 16px) for such platforms.
90
91
-`$value.unit` is still requird even if `$value.value` is `0`.
91
92
92
93
## Font family
@@ -160,12 +161,12 @@ Example:
160
161
161
162
## Duration
162
163
163
-
Represents the length of time in milliseconds an animation or animation cycle takes to complete, such as 200 milliseconds. The `$type` property MUST be set to the string `duration`. The value MUST be an object containin a numeric `value` (either integer or floating-point) and optionally a `unit`to specify milliseconds (`"ms"`) or seconds (`"s"`). A millisecond is a unit of time equal to one thousandth of a second.
164
+
Represents the length of time in milliseconds an animation or animation cycle takes to complete, such as 200 milliseconds. The `$type` property MUST be set to the string `duration`. The value MUST be an object containing a numeric `value` (either integer or floating-point) and a `unit`of milliseconds (`"ms"`) or seconds (`"s"`). A millisecond is a unit of time equal to one thousandth of a second.
0 commit comments