css/prefer-logical-properties
Recommend CSS logical properties for better i18n support.
| Default severity | Presets | Automatic fix | Options |
|---|---|---|---|
warning |
opinionated, nuxt |
No | None |
Applies to: CSS, SCSS, Sass, Less and Stylus style blocks, as written (not preprocessed). Within one Stylus block, use either braced or indented syntax consistently; mixed syntax is read as braced Stylus.
Bad
margin-left fixes the margin to a physical side regardless of writing direction.
<style scoped>
.panel {
margin-left: 1rem;
}
</style>
Good
margin-inline-start follows the start of the inline direction instead.
<style scoped>
.panel {
margin-inline-start: 1rem;
}
</style>
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({}).withVue({
linter: {
"preset": "incremental",
"rules": {
"css/prefer-logical-properties": "warn"
}
},
});
Then run vp run lint.