Closed kripod closed 1 year ago
Fallback values should be readonly to support assigning ["fallback", "values"] as const, e.g.:
readonly
["fallback", "values"] as const
import type { PropertiesFallback as CSSProperties } from "csstype"; export function placeContent< Align extends CSSProperties["alignContent"], Justify extends CSSProperties["justifyContent"] = Align >( align: Align, justify: Justify = (align as unknown) as Justify, ): { alignContent: Align; justifyContent: Justify; } { return { alignContent: align, justifyContent: justify, }; } const longhands = placeContent(["space-around", "space-evenly"] as const); // Type should be inferred as: // { // alignContent: readonly ["space-around", "space-evenly"]; // justifyContent: readonly ["space-around", "space-evenly"]; // }
Fallback values should be
readonly
to support assigning["fallback", "values"] as const
, e.g.: