diff --git a/technical-reports/format/types.md b/technical-reports/format/types.md index aa60e46..b7c3d74 100644 --- a/technical-reports/format/types.md +++ b/technical-reports/format/types.md @@ -51,12 +51,12 @@ $translucent-shadow: hsla(300, 100%, 50%, 0.5); ## Dimension -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. +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 both `value` and `unit` keys. | Key | Type | Required | Description | | :------ | :------: | :------: | :----------------------------------------------------------------- | | `value` | `number` | Y | An integer or floating-point value representing the numeric value. | -| `unit` | `string` | Y | A string specifying the units of measurement | +| `unit` | `string` | Y | Specify `"px"` or `"rem"`. | For example: @@ -85,8 +85,9 @@ For example: ### Validation -- `$value.unit` may be any string. It is up to tooling to translate units into the appropriate platform. -- `$value.unit` may NOT be an empty string (`""`). +- `$value.unit` may only be `"px"` or `"rem"`. + - **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. + - **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. - `$value.unit` is still requird even if `$value.value` is `0`. ## Font family