Slice cucumbers and onions thinly (about ¼-inch thick). Place in a large bowl, sprinkle with salt, and toss. Let sit for 1 hour, then drain and rinse.
In a saucepan, combine vinegar, sugars, mustard seeds, celery seeds, turmeric, and peppercorns. Bring to a boil, then reduce heat and simmer for 5 minutes until slightly thickened.
Add drained cucumbers and onions to the brine. Simmer for 2 minutes.
Pack the mixture into sterilized jars, leaving ½-inch headspace. Seal tightly.
Let cool to room temperature, then refrigerate for at least 24 hours before eating.
Stores for up to 1 month in the fridge.