Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 从给定文件夹及其子文件夹编译所有手写笔文件_Css_Stylus - Fatal编程技术网

Css 从给定文件夹及其子文件夹编译所有手写笔文件

Css 从给定文件夹及其子文件夹编译所有手写笔文件,css,stylus,Css,Stylus,例如编译此文件夹结构 x.styl |--abc/ |--|--a.styl |--efg/ |--|--b.styl 到 使用手写笔编译器(从文件夹及其子文件夹编译手写笔文件)您可以在构建和定位整个文件夹时使用--out参数,它将保留您的结构,首先可以定位文件或文件夹,然后在定位完要编译css的文件夹或文件名之后 stylus-c./project/stylus-out./myfolder/css 用于: 这将导致如下结果: |css |--abc/ |--|--a.css |--efg/

例如编译此文件夹结构

x.styl
|--abc/
|--|--a.styl
|--efg/
|--|--b.styl

使用手写笔编译器(从文件夹及其子文件夹编译手写笔文件)

您可以在构建和定位整个文件夹时使用--out参数,它将保留您的结构,首先可以定位文件或文件夹,然后在定位完要编译css的文件夹或文件名之后

stylus-c./project/stylus-out./myfolder/css

用于:

这将导致如下结果:

|css
|--abc/
|--|--a.css
|--efg/
|--|--b.css

我在比赛中迟到了,但我相信我有一个不是最优的解决方案,但对你的情况是可行的

根据您的示例,保持相同的文件/文件夹结构

x、 styl
|--abc/
|--|--a、 styl
|--efg/
|--|--b、 斯蒂尔

但也包括一个“composition.styl”文件在它自己的单独文件夹中。现在你有了:

x、 styl
|--abc/
|--|--a、 styl
|--efg/
|--|--b、 styl
|--所有手写笔/
|--|--组合柱

在combination.styl内部,您应该导入所有单独的.styl文件,因此对于我们的示例

// combination.styl  
@import '../x.styl'  
@import '../abc/a.styl'  
//etc...
然后,你可以输出一个大的css文件,无论你想在哪里

运行此命令的命令应该是:
手写笔/手写笔-输出。/css


我知道它没有给你你想要的输出文件/文件夹结构,但是我想它可以帮助你一次将所有的手写笔编译成css

这方面有点晚了,我希望这可能会帮助像它这样的其他人帮助我,但我找到了使用该软件包的解决方案

触针扼流器

只是稍微修改了stylus CLI,它以递归方式构建文件列表,并使用chokidar监视>它们(如果提供了--watch)

始终启用递归,不支持全局模式


有了它,您可以递归地编译手写笔文件(每个组件将存储它们自己的CSS/手写笔文件)。

很高兴我在一年前回答了这个问题——终于又找到了——有趣的是,我试着给自己投票
|css
|--abc/
|--|--a.css
|--efg/
|--|--b.css
// combination.styl  
@import '../x.styl'  
@import '../abc/a.styl'  
//etc...