Versus Terran the idea is to go gateway, robo, gateway, support bay, gateway.
Against protoss you can afford to cut the third gateway and instead get your colossi and range upgrades out as quickly as possible.
Against Terran, if you do this, it's more risky as they pressure your ramp more than protoss can, and stimmed marauders annihilate Protoss ground so effectively you need the extra meat shield production capabilities. To pay for the third gateway, against Terran, you can drop the range upgrade usually, as if they are three rax expanding the colossi lets you expand with them and they will probably waste money on a bunch of vikings to counter the colossi. A post expansion switch to blink and templar tech is quite powerful.
You use blink to keep their bio blob mostly at home (rather than asserting map control) and then you just have to deal with shuttle drops. Once you have storm and amulet, you're pretty good to go.