> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CheckoutLength

> Swift Enumeration

**Enumeration**

A CSS length, such as a font size, a corner radius, or a spacing unit.

```swift theme={null}
enum CheckoutLength
```

Use `CheckoutLength.px(_:)`, `CheckoutLength.rem(_:)`, or `CheckoutLength.em(_:)` for the common units. Use `CheckoutLength.custom(_:)` for a different CSS value. A number literal is a length in CSS pixels, so `12` is the same as `.px(12)`. In the checkout, one CSS pixel is one point.

## Enumeration Cases

| Case | Description |
| - | - |
| `custom(_:)` | A CSS length value, for example `"clamp(14px, 4vw, 18px)"`. |
| `em(_:)` | A length relative to the font size of the parent element. |
| `px(_:)` | A length in CSS pixels. |
| `rem(_:)` | A length relative to the font size of the root element. |

## Initializers

### init(floatLiteral:)

Creates a length in CSS pixels from a floating-point literal.

```swift theme={null}
init(floatLiteral value: Double)
```

### init(from:)

Inherited from `Decodable.init(from:)`.

```swift theme={null}
init(from decoder: Decoder) throws
```

### init(integerLiteral:)

Creates a length in CSS pixels from an integer literal.

```swift theme={null}
init(integerLiteral value: Int)
```

## Instance Methods

### encode(to:)

Inherited from `Encodable.encode(to:)`.

```swift theme={null}
func encode(to encoder: Encoder) throws
```
