Skip to content
On this page

FireStylus 扩展用于 Firebug

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

截图

使用

首先,你需要安装 FirebugFireStylus 扩展

然后,在生成 CSS 时简单地启用 Stylus 的 firebug 选项。

命令行使用:

bash
$ stylus -f <>
$ stylus --firebug <>
$ stylus -f <>
$ stylus --firebug <>

JavaScript 使用:

css
var stylus = require('stylus');

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

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

Connect / Express:

css
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 应该适用于 Firefox 3.0 及以上版本,以及 Firebug 1.4 及以上版本。

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

限制

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

FireStylus(像 FireSass 一样)只在 Firebug 的 HTML 面板中工作。其他面板(如 CSS 面板)由于 Firebug 的限制而无法工作。

Released under the MIT License.