All rules

Sheath rule

native-typography-target

NativePHP text utilities must target an element that consumes the resulting style.
Package
NativePHP
Category
Native
Default severity
warning by default
Auto-fix
Manual fix

#Why

Native text styles do not inherit from layout containers. A valid typography class on column, row, image, or another non-text consumer has no effect on descendant text.

#Examples

#Bad

{{-- Text styles on column do not inherit into native:text. --}}
<native:column class="text-white font-bold">
<native:text>Account</native:text>
</native:column>

#Good

{{-- native:text consumes the typography utilities directly. --}}
<native:column>
<native:text class="text-white font-bold">Account</native:text>
</native:column>

Icons and activity indicators consume color. Buttons consume their supported text styles directly.

#Checked Styles

Checked styles include font size, color, weight, style, family, decoration, transform, spacing, line height, and alignment. Dark text color and font size are included.

Registered plugin elements outside the known consumer model are skipped.

#Options

All NativePHP rules accept nativeViewPaths. The default is ['views/native/']. See Native View Detection for path configuration.

#See Also

Related rules validate whether the class itself is usable: