Coder Social home page Coder Social logo

Comments (5)

seven-phases-max avatar seven-phases-max commented on May 31, 2024

In less file this fails:

How exactly does it fail? Any specific error message? Note that importing a *.css file requires (css) option (w/o it the statement is supposed to stay as-is to be processed by a browser).

from less-plugin-npm-import.

wmyers avatar wmyers commented on May 31, 2024

Thanks for response.

With the .css the @import will stay as-is, without the .css it will embed it correctly.

Interestingly, if using (css) option, it fails to embed (stays as-is) either with or without the .css.

So it only works for me without the (css) option and without .css suffix.

I'm using node 4.1.2 npm 2.14.4.

from less-plugin-npm-import.

seven-phases-max avatar seven-phases-max commented on May 31, 2024

With the .css the @import will stay as-is, without the .css it will embed it correctly.

Without css extension the file is treated as a less file and imported accordingly.

Interestingly, if using (css) option, it fails to embed (stays as-is) either with or without the .css.

My mistake above, sorry (actually you could notice it by reading the docs I pointed to ;). -
css option only stresses the file is .css one and the import stays as is.
To include a .css file you need either less or inline option (yet again all this is documented at http://lesscss.org/features/#import-directives-feature).

from less-plugin-npm-import.

wmyers avatar wmyers commented on May 31, 2024

Thanks for clarification, makes sense when reading the less docs :)

Perhaps worth adding a second example lessc usage to your README, before where you say "css/less extensions not necessary"

@import (less) "npm://packagename/path/to/file.css";

from less-plugin-npm-import.

SomMeri avatar SomMeri commented on May 31, 2024

I will close this, since it is not a but and the question is answered.

@wmyers We will gladly merge in pull request with a new example :). But if you do not have time for it, you can open a new issue in less-docs repo. It will take longer time till someone adds it through in that case.

from less-plugin-npm-import.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.