New logic: directive with body that contains something referenced (for example by extend) will be shown in output too. @Media works with the same logic - it shows up in output if it contains something visible. Related to: #2359