S
S
someden2015-02-26 19:21:58
css
someden, 2015-02-26 19:21:58

How to insert css file into stylus?

There is a style.style file

@import './styles/reset.styl';
@import './styles/grid.styl';
@import './scripts/vendor/fontawesome/css/font-awesome.min.css';
@import './styles/main.styl';

Well, everything seems to be clear, first we connect all sorts of resets and normalizations, grids and bootstraps, then the styles of third-party libraries, in my case it is the fontawesome icon font, and at the end all the other styles.
The problem is that when compiling, all stylus files are copied to this file, and the line
@import './scripts/vendor/fontawesome/css/font-awesome.min.css';
it will remain so and, accordingly, import connection is possible only at the beginning, but in the middle of the css file it will not work and font-awesome.min.css will not be connected.
Is it possible to do in stylus that when compiling to css, lines like
@import './scripts/vendor/fontawesome/css/font-awesome.min.css';
inserted css from a file, and did not remain an import?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
someden, 2015-03-31
@someden

Understood. When compiling, just specify 'include css': true

.pipe(stylus({
      'include css': true
}))

S
Sergeyj, 2015-02-26
@sayber

First you collect .styl into css file(s), then using another plugin, glue all css into one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question