# no-static-inline-styles

Rule `vue/no-static-inline-styles`. Disallow static inline `style` attributes

- Source: vue
- Technologies: Vue
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #2072 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/no-static-inline-styles` | no | no | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/no-static-inline-styles.html) |

## Code examples

### Incorrect: the rule reports this

```vue
  <div style="color: pink;"></div>
  <div :style="{ color: 'pink' }"></div>
  <div :style="[{ color: 'pink' }, { 'font-size': '85%' }]"></div>
  <div :style="{ backgroundImage, color: 'pink' }"></div>
</template>
```

```vue
  <div style="transform: scale(0.5);"></div>
</template>
```

### Correct: the rule accepts this

```vue
<div :style="styleObject"></div>
<div :style="{ backgroundImage: 'url(' + img + ')' }"></div>
```

```vue
<div :style="{ transform: 'scale(0.5)' }"></div>
<div :style="[{ transform: 'scale(0.5)' }, { 'user-select': 'none' }]"></div>
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import vue from "eslint-plugin-vue";

export default [
  {
    plugins: { vue },
    rules: {
      "vue/no-static-inline-styles": "error",
    },
  },
];
```

## Related rules

- [vue/no-restricted-static-attribute](https://lintradar.dev/rules/vue/no-restricted-static-attribute.md): Disallow specific attribute
- [vue/no-undef-components](https://lintradar.dev/rules/vue/no-undef-components.md): Disallow use of undefined components in `<template>`
- [vue/no-restricted-props](https://lintradar.dev/rules/vue/no-restricted-props.md): Disallow specific props
- [vue/no-unsupported-features](https://lintradar.dev/rules/vue/no-unsupported-features.md): Disallow unsupported Vue.js syntax on the specified version
- [vue/no-restricted-custom-event](https://lintradar.dev/rules/vue/no-restricted-custom-event.md): Disallow specific custom event
- [vue/no-unused-properties](https://lintradar.dev/rules/vue/no-unused-properties.md): Disallow unused properties

---

Web page: https://lintradar.dev/rules/vue/no-static-inline-styles. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
