Measure the onion, vinegar, mayonnaise, pepper, and sugar into a jar and shake to combine (or mix in a small bowl). Refrigerate, covered up to 2 days.
Slice the green cabbage into very thin shreds. Toss with the dressing. Season with salt. Sprinkle the red cabbage and carrot shreds on top, and serve.