It takes a couple of days, but the wait is totally worth it.
In a plastic container with a lid, stir together the sugar, salt, and vinegar until the sugar has mostly dissolved. Place the cucumbers and onion in the solution and stir them around to coat. Put the cover on the container and leave it in the fridge for at least 2 days, stirring occasionally.