CSS-On-Line is a Visual Studio Code extension that transforms your CSS into a neatly organized format, ensuring one rule per line. This enhances code readability and maintains a professional coding style, making your CSS easier to manage and understand.
- Clean Formatting: Converts CSS rules into a one-rule-per-line structure.
- Multi-Language Support: Works with CSS, HTML, and PHP files containing
<style>...</style>tags. - Keyboard Shortcut: Quickly format selected text with Ctrl + Cmd + L.
- Go to the Visual Studio Code Marketplace.
- Search for CSS-On-Line.
- Click Install to add it to your editor.
- Open a CSS file in Visual Studio Code.
- Right-click within the file.
- Select "Format Document With" and choose CSS-On-Line.
- Highlight the CSS code you want to format.
- Right-click and choose "Format Selection With".
- Select CSS-On-Line to apply the formatting.
- Highlight the CSS code you want to format.
- Press Ctrl + Cmd + L.
- The selected text is instantly formatted into a one-rule-per-line structure.
.container {
max-width: 960px;
margin: 0 auto;
padding: 0 20px;
}
.header {
background-color: #333;
color: #fff;
padding: 20px 0;
text-align: center;
}
.nav {
background-color: #fff;
padding: 10px 0;
border-bottom: 1px solid #ddd;
}
@media (min-width: 70em) { /* 70em=1120px */
.container {
max-width: 1120px;
}
.content {
display: flex; /* Example: Implement a two-column layout */
gap: 20px;
}
.sidebar { /* Assuming you have a sidebar */
flex: 1;
}
.main-content { /* Assuming you have a main content area */
flex: 2;
}
}.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.header { background-color: #333; color: #fff; padding: 20px 0; text-align: center; }
.nav { background-color: #fff; padding: 10px 0; border-bottom: 1px solid #ddd; }
@media (min-width: 70em) {
.container { max-width: 1120px; }
.content { display: flex; gap: 20px; }
.sidebar { flex: 1; }
.main-content { flex: 2; }
}Feel free to submit issues or feature requests on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for details.