something like `@import (reference)` from Less?
See original GitHub issuehi.
is it possible to have this http://lesscss.org/features/#import-options-reference functionality?
for example I want to import vars.css
file that contains only vars declarations to 100 other css files without inlining but using it as a reference to resolve vars.
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Reference Imports in LESS (are kinda cool) - CSS-Tricks
Concatenating files is a vitally important feature of preprocessors. A (reference) import doesn't do that. In fact, it doesn't put anything at ...
Read more >css - LESS import - reference vs once - Stack Overflow
The principle of once is to only import a file once. For example, you may have an import for mixins.less in both of...
Read more >Features In-Depth | Less.js
Use @import (inline) to include external files, but not process them. Released v1.5.0. Example: @import (inline) "not-less-compatible.css";. You will use this ...
Read more >When using an @import (reference), mixins that contain an ...
When I import a less file with the (reference) directive, I expect to see no CSS output from that file. However, I am...
Read more >@import in CSS, SCSS, and LESS. @import rule ... - rohin bisht
import rule is present in CSS as well as popular preprocessor like ... they have anything yet comparable to the reference imports in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@deepsweet do you want to write your own plugin for this case? It is very easy.
I saw two API:
I prefer second API, because:
postcss-import
is a big plugin with many logic inside. Copy all of its code is not a good idea.@filter
at-rule is more flexile way, which van be used in many cases.postcss-simple-vars don’t produce any specific output, so you vars.css should not produce anything. You just need to use postcss-import before any other plugin + import your vars.css before other imports.