Instance MethodMethodflattened(prefix:
flattened(prefix:dark:)
Flattens the value into custom property suffixes and values.
func flattened(
prefix: String,
dark: Bool
) -> [(name: String, value: String)]Parameters
prefixThe name accumulated so far (without the leading
--).darkWhether 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 object. For example, {"code": {"border-width": "2px"}} flattened with the prefix code yields ("code-border-width", "2px").