How to Import CSS Files into LESS Files?

Patricia Arquette
Release: 2024-10-30 23:38:29
Original
426 people have browsed it

How to Import CSS Files into LESS Files?

How to Import .CSS Files into .LESS Files

Importing .CSS files into .LESS files is possible, but requires specifying an option to force the interpretation of the file as CSS.

Solution:

To import a .CSS file into a .LESS file, use the following syntax:

@import (css) "path/to/style.css";
Copy after login

This will instruct LESS to interpret the specified file as CSS. For example:

@import (css) "../style.css";

.small {
    font-size:60%;
    .type;
}
Copy after login

After specifying the import option, the .LESS file will successfully reference classes and styles defined in the imported .CSS file.

Additional Note:

Keep in mind that you can also specify a different file extension when using the import option, such as:

@import (less) "lib.css";
Copy after login

This will import the lib.css file and treat its contents as LESS.

The above is the detailed content of How to Import CSS Files into LESS Files?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!