Skip Navigation
Instance MethodMethod

flattened(prefix:dark:)

Flattens the value into custom property suffixes and values.

func flattened(
    prefix: String,
    dark: Bool
) -> [(name: String, value: String)]

Parameters

prefix

The name accumulated so far (without the leading --).

dark

Whether to pick the dark value of light and dark pairs.

Return Value

The flattened entries, sorted by name.

Discussion

Nested keys are joined with -, exactly like swift-docc-render’s objectToCustomProperties(). For example, {"code": {"border-width": "2px"}} flattened with the prefix code yields ("code-border-width", "2px").