Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 1.23 KB

File metadata and controls

40 lines (26 loc) · 1.23 KB

ember/template-no-inline-styles

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

Name Type Default Description
allowDynamicStyles boolean true When true, allows dynamic style values (e.g. style={{...}} or style="{{...}}").

Related Rules

References