Logical CSSA production-quality Visual Studio Code extension that helps developers write RTL-friendly and CSS Logical Property–aware styles by analyzing CSS/SCSS and providing diagnostics, quick fixes, and optional auto-fixes. Features
InstallationFrom Visual Studio Marketplace
From .vsix File
UsageDiagnosticsThe extension automatically analyzes your CSS files and highlights physical properties:
Quick FixesWhen you see a diagnostic, press
Hover InformationHover over any physical property to see the suggested logical alternative:
Ignore CommentsUse ignore comments to suppress diagnostics for specific lines:
SettingslogicalCss.enable
logicalCss.enableQuickFix
logicalCss.severity
logicalCss.ignoreProperties
Example:
logicalCss.ignoreValues
Example:
logicalCss.enableHover
logicalCss.enableStatusBar
logicalCss.autoFixOnSave
logicalCss.checkBlockProperties
logicalCss.checkSizeProperties
logicalCss.checkShorthands
CommandsLogical CSS: Scan WorkspaceScans all CSS files in the current workspace and reports the total number of issues. Logical CSS: Scan Current FileScans the currently active file and reports issues. Logical CSS: Scan FolderScans all stylesheets ( Supported PropertiesInline / Horizontal Properties (Default)
Block / Vertical Properties (Opt-in via
|
| Physical | Logical |
|---|---|
margin-top |
margin-block-start |
margin-bottom |
margin-block-end |
padding-top |
padding-block-start |
padding-bottom |
padding-block-end |
top |
inset-block-start |
bottom |
inset-block-end |
border-top |
border-block-start |
border-bottom |
border-block-end |
border-top-width / style / color |
border-block-start-* |
border-bottom-width / style / color |
border-block-end-* |
scroll-margin-top / bottom |
scroll-margin-block-start / end |
scroll-padding-top / bottom |
scroll-padding-block-start / end |
overflow-y |
overflow-block |
Sizing Properties (Opt-in via logicalCss.checkSizeProperties)
| Physical | Logical |
|---|---|
width |
inline-size |
height |
block-size |
min-width |
min-inline-size |
max-width |
max-inline-size |
min-height |
min-block-size |
max-height |
max-block-size |
Direction-Sensitive Values
| Property | Physical Value | Logical Value |
|---|---|---|
text-align |
left |
start |
text-align |
right |
end |
float |
left |
inline-start |
float |
right |
inline-end |
clear |
left |
inline-start |
clear |
right |
inline-end |
caption-side |
left / right |
inline-start / inline-end |
resize |
horizontal / vertical |
inline / block |
Why Logical Properties?
Logical properties are a modern CSS feature that automatically adapt to the document's writing direction and mode. This makes it much easier to build internationalized (i18n) applications that support both left-to-right (LTR) and right-to-left (RTL) languages.
Benefits
- RTL Support: Automatically works in RTL languages (Arabic, Hebrew, etc.)
- Writing Mode Support: Works with vertical writing modes
- Less Code: No need for separate RTL stylesheets
- Maintainability: Easier to reason about layout direction
- Future-Proof: Follows modern CSS best practices
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Lint code
npm run lint
# Fix linting issues
npm run lint:fix
# Format code
npm run format
# Package extension
npm run package
License
MIT License - see LICENSE file for details.
Changelog
See CHANGELOG.md for a list of changes in each version.
Support
- Issues: GitHub Issues
- Documentation: GitHub Wiki
Acknowledgments
- Built with PostCSS
- Inspired by the CSS Logical Properties specification
- Thanks to all contributors
Made with ❤️ for the international web