Multicolor inside borders for polygons in QGIS 3

The process is simple. You need to do the following:

  • Load the polygon layer and create a duplicate, by right-click the original layer -> Duplicate Layer

enter image description here

  • Make the top layer a a single symbol with transparent fill. Click on Simple fill -> Fill Color -> Transparent.

enter image description here

  • For the second layer, the duplicate layer, Simple Fill and change the Symbol layer type to Shapeburst fill. Select the color for the top fill and transparent color for the second fill, and change the Set distance to 3 for example.

enter image description here

  • Last Step, Change the layer style from Single symbol to Categorized, and select the field to categorize. In this example, Id field was used, and click on Classify.

enter image description here

Here is the result:

enter image description here

Update

If you want to avoid creating a duplicate layer, change Categorized to Rule-based Style, then Add Symbol using the Green plus at the bottom, double click the symbol, select Simple fill, and finally select Transparent fill.

enter image description here

You will have the same effect.

enter image description here


You can make this with an outline symbole and an offset

enter image description here