This article will introduce to you how to use Less without configuration in VSCode. I hope it will be helpful to everyone!
Less
During the production process of the front-end page, if there are many elements in the page and the hierarchical structure is complex, it will cause The CSS
we wrote is particularly redundant and not easy to maintain. [Recommended learning: "vscode tutorial"]
So there are many extensions to CSS
, such as Less
,Sass
etcCSS
preprocessor.
Generally speaking, when using these CSS
extension languages, you will first use npm to download them, and then configure them in webpack
.
Although you can also import less directly into the browser, you must first introduce the clean-css plug-in.
But if you want the fastest way to style using less
, the way I found is to use the plugin in vs code
and let vs code
directly helps you compile a css. This method is also what I commonly use now.
Easy Less
Here we recommend a plug-in called Easy Less
.
Easy Less
It will take effect after being installed directly in the extension store of vs code. Now we can create a less file and then use less in it Write the style code in the following way. After saving, you will find that a css file with the same name will be generated in the less folder at the same level.
Contents in the Less file:
@setColor:{ 1: #ff0000; 2: #ff0; 3: #f0f; 4: #0ff; 5: #00f; } #app { .ul { each(@setColor, { .li@{key} { background-color: @value; width: 100px; height: 20px; } }) } }
Generated CSS code:
#app .ul .li1 { background-color: #ff0000; width: 100px; height: 20px; } #app .ul .li2 { background-color: #ff0; width: 100px; height: 20px; } #app .ul .li3 { background-color: #f0f; width: 100px; height: 20px; } #app .ul .li4 { background-color: #0ff; width: 100px; height: 20px; } #app .ul .li5 { background-color: #00f; width: 100px; height: 20px; }
In this way, when introducing the page, you can directly introduce this CSS files without having to do extra conversion work. In fact, in vs code
, there are not only less
simplified tools, but also sass
tool plug-ins. If you are interested, you can try it.
For more programming-related knowledge, please visit: Introduction to Programming! !
The above is the detailed content of How to omit configuration in VSCode to quickly use Less. For more information, please follow other related articles on the PHP Chinese website!

The difference between VisualStudioProfessional and Enterprise is in the functionality and target user groups. The Professional version is suitable for professional developers and provides functions such as code analysis; the Enterprise version is for large teams and has added advanced tools such as test management.

VisualStudio is suitable for large projects, VSCode is suitable for projects of all sizes. 1. VisualStudio provides comprehensive IDE functions, supports multiple languages, integrated debugging and testing tools. 2.VSCode is a lightweight editor that supports multiple languages through extension, has a simple interface and fast startup.

VisualStudio is a powerful IDE developed by Microsoft, supporting multiple programming languages and platforms. Its core advantages include: 1. Intelligent code prompts and debugging functions, 2. Integrated development, debugging, testing and version control, 3. Extended functions through plug-ins, 4. Provide performance optimization and best practice tools to help developers improve efficiency and code quality.

The differences in pricing, licensing and availability of VisualStudio and VSCode are as follows: 1. Pricing: VSCode is completely free, while VisualStudio offers free community and paid enterprise versions. 2. License: VSCode uses a flexible MIT license, and the license of VisualStudio varies according to the version. 3. Usability: VSCode is supported across platforms, while VisualStudio performs best on Windows.

VisualStudio supports the entire process from code writing to production deployment. 1) Code writing: Provides intelligent code completion and reconstruction functions. 2) Debugging and testing: Integrate powerful debugging tools and unit testing framework. 3) Version control: seamlessly integrate with Git to simplify code management. 4) Deployment and Release: Supports multiple deployment options to simplify the application release process.

VisualStudio offers three license types: Community, Professional and Enterprise. The Community Edition is free, suitable for individual developers and small teams; the Professional Edition is annually subscribed, suitable for professional developers who need more functions; the Enterprise Edition is the highest price, suitable for large teams and enterprises. When selecting a license, project size, budget and teamwork needs should be considered.

VisualStudio is suitable for large-scale project development, while VSCode is suitable for projects of all sizes. 1. VisualStudio provides comprehensive development tools, such as integrated debugger, version control and testing tools. 2.VSCode is known for its scalability, cross-platform and fast launch, and is suitable for fast editing and small project development.

VisualStudio is suitable for large projects and Windows development, while VSCode is suitable for cross-platform and small projects. 1. VisualStudio provides a full-featured IDE, supports .NET framework and powerful debugging tools. 2.VSCode is a lightweight editor that emphasizes flexibility and extensibility, and is suitable for various development scenarios.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Atom editor mac version download
The most popular open source editor

Dreamweaver CS6
Visual web development tools
