It is not the quantity of dangerous goods packed inside but it is the capacity (size) of the package.
UN specification packages to contain solids or inner packagings carry the maximum allowable gross weight. You can be guided by this maximum allowable gross weight as capacity. For packages to directly contain liquids, since the volume of 1L is equal to 10 cubic centimeters, you can measure the exterior dimensions of the package and arrive at an approximate workable Litre capacity.
However, this rule is set as a guideline and does not mean to reject a shipment when the height of the markings was 11.5mm, 0.5mm shy of the standard. It means to use common sense and avoid a tiny entry that you would need a magnifying glass to read the UN numbers.