Wash the zucchini, trim off the ends, and slice into thin rounds. Thinly slice the onion.
Place both in a colander set over a bowl and sprinkle with the salt. Toss well and let sit for 30 minutes to draw out excess moisture.
Make the brine:
While the zucchini and onions are soaking, combine the vinegar, water, sugar, mustard seeds, celery seeds, turmeric, and peppercorns in a medium saucepan.
Bring to a simmer over medium heat, stirring until the sugar dissolves. Remove from heat and let cool slightly.
Pack the jars:
Rinse the zucchini and onions well under cool running water and pat dry. Add them to a clean quart jar (or divide between two pint jars).
Pour the warm brine over the vegetables, making sure they’re completely submerged.
Cool and refrigerate:
Cover the jar and let it cool to room temperature for about 1 hour before transferring to the refrigerator.
The pickles will be flavorful in about 24 hours, but taste best after 2 to 3 days. Store in the fridge and use within 2 to 3 months.