Using Rule Based Rendering
In the past, if you wanted to apply a wildly different style to more than one type of data in the same source, the only way to do this was to duplicate or subset a layer. With Rule Based Rendering, you now just have to create rules that are applied on-the-fly. This opens a huge door on cartographic possibilities with different features in the same layer not only having different colors but also different fill types, transparency, line type, and all manner of other customizations. Extending from categorized symbology, rules also allow for mixing and inheritance, allowing for intermediate categories or some shared properties and reducing the amount of work to create elegant symbology.
Getting ready
Rule Based Rendering is built-in to vector symbology. So, you'll need a good complicated vector layer to fully utilize its potential. A road layer is often a good use case, but for this example we'll go slightly simpler with busroutesall.shp
.