All rules

Sheath rule

native-no-style-attribute

NativePHP elements must use class utilities instead of ignored style attributes.
Package
NativePHP
Category
Native
Default severity
warning by default
Auto-fix
Manual fix

#Why

Native element style builders do not consume browser CSS from style="...". The attribute is ignored even when the CSS would work in HTML.

#Examples

#Bad

{{-- Native element builders ignore browser CSS in style. --}}
<native:column style="padding-top: 16px">
<native:text>Account</native:text>
</native:column>

#Good

{{-- pt-4 produces native padding. --}}
<native:column class="pt-4">
<native:text>Account</native:text>
</native:column>

#Notes

Raw HTML inside a registered webview is not checked. A registered plugin element or child component that declares its own style support is also left unchanged.

Conditional and repeated attributes follow their final effective value on each reachable render path.

#Options

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

#See Also

Related rules validate class support and targets: