Some idioms, such as by and large, contain syntactic violations; these are often completely fixed and hence can be listed in a lexicon as "words with spaces" (Sag et al., 2002).
among those idioms that are syntactically well-formed, some exhibit limited morphosyntactic flexibility, while others may be more syntactically flexible.