跳至内容
在此页面上

适用于 Firebug 的 FireStylus 扩展

FireStylus 是一个 Firebug 扩展,它使 Firebug 显示 Stylus 生成的 CSS 样式的文件名和行号,而不是生成的 CSS 的文件名和行号。

Screenshot

用法

首先,你需要安装 FirebugFireStylus 扩展

然后在生成 CSS 时,只需启用 Stylus 的 firebug 选项即可。

命令行用法

$ stylus -f <path>
$ stylus --firebug <path>
$ stylus -f <path>
$ stylus --firebug <path>

Javascript 用法

var stylus = require('stylus');

stylus(str)
  .set('firebug', true)
  .render(function(err, css){
  // logic
  });
var stylus = require('stylus');

stylus(str)
  .set('firebug', true)
  .render(function(err, css){
  // logic
  });

Connect / Express

var stylus = require('stylus');

var server = connect.createServer(
    stylus.middleware({
        src: __dirname
      , dest: __dirname + '/public'
      , firebug: true
    })
  , connect.static(__dirname + '/public')
);
var stylus = require('stylus');

var server = connect.createServer(
    stylus.middleware({
        src: __dirname
      , dest: __dirname + '/public'
      , firebug: true
    })
  , connect.static(__dirname + '/public')
);

兼容性

FireStylus 应适用于 3.0 及更高版本的 Firefox,以及 1.4 及更高版本的 Firebug。

  • Firefox 3+(也适用于版本 5)
  • Firebug 1.4+

限制

FireStylus 和 FireSass 不兼容。你不能同时启用它们。

FireStylus(与 FireSass 一样)仅适用于 Firebug 的 HTML 窗格。其他窗格(例如 CSS 窗格)由于 Firebug 的限制而无法使用。