ember/template-no-inline-styles

April 20, 2026 ยท View on GitHub

๐Ÿ’ผ This rule is enabled in the ๐Ÿ“‹ template-lint-migration config.

Inline styles are not the best practice because they are hard to maintain and usually make the overall size of the project bigger. This rule forbids inline styles. Use CSS classes instead.

Examples

This rule forbids the following:

<template><div style='width:900px'></div></template>

This rule allows the following:

<template><div class='wide-element'></div></template>
<template>
  {{! allowed when `allowDynamicStyles` is enabled  }}
  <div style={{html-safe (concat 'background-image: url(' url ')')}}></div>
</template>

Options

NameTypeDefaultDescription
allowDynamicStylesbooleantrueWhen true, allows dynamic style values (e.g. style={{...}} or style="{{...}}").

References