stylus

Webpack && stylus-loader incorrectly resolve url paths

本小妞迷上赌 提交于 2019-11-30 09:46:52
Let's say I have home.styl menu/ menu.styl image.svg home.styl is required from an entry point or JS. Then: home.styl imports menu/menu.styl menu/menu.styl has url(image.svg) . The problem is that image.svg is not found. It exists in the same folder as menu.styl , but is not resolved. The loaders are: loaders: [{ test: /\.styl$/, loader: 'style!css!stylus' }, { test: /\.(png|jpg|svg|ttf|eot|woff|woff2)$/, loader: 'file?name=[path][name].[ext]' }] Below are my ideas why that fails. Hope to get an answer how to fix that. =========== If url(image.svg) is required from menu.styl , it should be

Setting up auto compile for Stylus

半腔热情 提交于 2019-11-30 04:46:07
I have installed node.js/stylus/nib on my mac and I can manually compile .styl file to .css on the command line. I also know there is this stylus.middleware() things that keeps coming up when I search for how to setup auto-compiling when the .styl changes, however I have no idea how I am supposed to implement it (I have never used node.js before). What file do I put that code in? How do I start this code so it is always run? I think I am missing a few things on the node side to be able to set this up. k3liutZu From the command line you can use: stylus -w folder/ or just for another example:

Stylus and Express - stylesheets are not re-compiled when modified

女生的网名这么多〃 提交于 2019-11-30 03:02:15
I am running latest version of Node on Mac OS X. I've installed Express together with Stylus. Also the latest versions. Stylus is not re-compiling my .styl files, when I modify them. How can I fix this? The only solution to getting my .styl files re-compiled, is to delete the compiled .css files... re-starting my application, or doing a clear-cache-refresh (CMD + Shift + R) is not resulting a re-compile. Here's a dump of my application configuration. It's basically the same as when you create a new express application with the executable... app.configure(function () { this.set("views", _

CSS 预编译stylus

有些话、适合烂在心里 提交于 2019-11-30 03:01:46
stylus是css的预编译语言,用于去掉css中的冒号和分好,例如 .style{ position fixed width 100% z-index 10 }   vue的使用方式是需要安装 npm install stylus stylus-loader --save-dev    来源: https://www.cnblogs.com/wjw-/p/11548874.html

How to use a Stylus variable in calc?

匆匆过客 提交于 2019-11-30 01:10:47
In Stylus, how do I use a variable in a calc expression? For example, the following doesn't work ( arrow-size being a variable): arrow-size = 5px left calc(50% - arrow-size) In order to use a Stylus variable inside a calc expression, one must employ the string % operator : arrow-size = 5px left "calc(50% - %s)" % arrow-size To use multiple variables (not just one) in calc (or with other functions), i use sprintf as you used, but with tuples: arrow-size = 5px measure = 50% left "calc(%s - %s)" % (measure arrow-size) Remember that interepolation in Stylus is supported through {} and it's used

Expressjs not loading stylesheets on heroku, giving 500 error

落爺英雄遲暮 提交于 2019-11-29 15:50:50
问题 I'm running an Expressjs installation on heroku, and it's not loading the stylesheets. I hit ctrl+u and then click on the stylesheet link, and get this error: TypeError: Object #<SendStream> has no method 'on' at Object.static [as handle] (/app/node_modules/express/node_modules/connect/lib/middleware/static.js:75:8) at next (/app/node_modules/express/node_modules/connect/lib/proto.js:190:15) When I go to the url '/stylesheets/style.css' I get this error: Express 500 TypeError: Object #

How to use a Stylus variable in calc?

我只是一个虾纸丫 提交于 2019-11-28 21:56:12
问题 In Stylus, how do I use a variable in a calc expression? For example, the following doesn't work ( arrow-size being a variable): arrow-size = 5px left calc(50% - arrow-size) 回答1: In order to use a Stylus variable inside a calc expression, one must employ the string % operator: arrow-size = 5px left "calc(50% - %s)" % arrow-size 回答2: To use multiple variables (not just one) in calc (or with other functions), i use sprintf as you used, but with tuples: arrow-size = 5px measure = 50% left "calc(

8.1 管道符| 使用技巧

雨燕双飞 提交于 2019-11-27 02:45:58
1. vue中管道操作符(|)的使用 //自定义过滤器,通过管道操作符|改变列表单元格的值 <el-table-column prop="status" label="状态" align="center" width="80"> <template slot-scope="scope"> {{scope.row.status | getStatus}} </template> </el-table-column> <script> export default { data() { return {......} }, filters: { getStatus: function(num){ let str = '' if (num == 1){ str = '启用' } else { str = '禁用' } return str; } }, methods: { list(){......}, }, } </script> View Code 参考: 自定义过滤器 2. $refs获取指定元素 $refs的作用类似于以前jquery的 $('#id')获取指定的元素 使用方法:       <section class="login_message"> <input type="text" maxlength="11" placeholder="验证码" v-model=

8. vue实战

最后都变了- 提交于 2019-11-27 02:44:36
安装stylus依赖包: stylus:是将stylus的代码转译为css的代码; stylus loader:是让webpack来理解stylus,从而让stylus编译stylus转换为css(webpack本身只能理解js模块); 来源: https://www.cnblogs.com/shiyun32/p/11234881.html