To trip the light fantastic is a playful expression of “to dance”. It originates in several other idiomatic expressions referring to dancing in our not too distant past. A passage in Milton’s poem L’Allegro (1632) goes like this:
“Haste thee, Nymph, and bring with thee
Jest, and youthful Jollity,
Sport that wrinkled Care derides,
And Laughter holding both his sides.
Come, and trip it as you go,
On the light fantastick toe.”
Milton was, indeed, describing the highly nimble (fantastick) footwork of a jig or some other fast dance. For years after Milton the expression “the light fantastic toe” appeared frequently in literature.
Milton’s concept was apparently an extension of the phrase “tripping it on the toe”, an expression referring to dancing used as far back as Shakespeare himself. In Act IV, scene I of The Tempest, Ariel says:
“Before you can say ‘come’ and ‘go,’
And breathe twice and cry ‘so, so,’
Each one, tripping on his toe,
Will be here with mop and mow [moue].
Do you love me, master? No?
As the years ground by, “toe” was lost and the phrase was smoothed down to “tripping the light fantastic”.