Crush the candy canes: place the candy canes in a zip-top bag, seal it, and crush with a rolling pin or meat mallet until you have a mix of fine shards and small pieces. Set aside 1/2 cup. Line a rimmed baking sheet (quarter-sheet pan or 9x13-inch pan) with parchment paper.
Melt the dark chocolate: place the chopped dark chocolate in a dry microwave-safe bowl. Microwave in 30-second bursts, stirring well between each, until smooth and just melted — about 90 seconds total. Stir in the peppermint extract. (Or melt in a double boiler over barely simmering water.)
Spread the dark layer: pour the dark chocolate onto the parchment and spread it into an even rectangle about 1/4 inch thick. Refrigerate for 15 to 20 minutes, until the surface is set but still feels slightly cool and tacky when you press it with a fingertip — not liquid, not rock-hard.
Melt the white chocolate: while the dark layer chills, melt the white chocolate the same way — 30-second microwave bursts, stirring between each, until just smooth. Do not overheat white chocolate; it seizes easily. If it thickens, stir in 1 teaspoon of neutral oil.
Spread the white layer: pour the white chocolate over the dark layer and spread it quickly and evenly to the edges. Immediately scatter the crushed candy canes over the top and press them in very gently with the back of a spoon. Sprinkle with flaky sea salt, if using.
Chill until firm: refrigerate for 30 to 45 minutes, until completely firm and cold to the touch. Do not freeze it — freezing makes the layers separate when you break it.
Break and serve: lift the bark out by the parchment, let it sit at room temperature for 5 minutes, then break it into irregular pieces with your hands or cut it with a large sharp knife. Store in an airtight container or a gift tin lined with parchment.