https://drafts.csswg.org/css-values-5/#ident
can be used to manually construct <custom-ident> values from several parts.
Well, the spec doesn't define how. If these parts are <ident> then I'm inferring from the examples that they are just concatenated.
But for <string> it's less clear. E.g. what is ident(" a ")?