logging - Sass:打印到终端

标签 logging console sass

有没有办法让 Sass 将变量打印到终端?

最佳答案

Sass 3.3 及更早版本

有 2 个与错误相关的指令:

@debug

The @debug directive prints the value of a SassScript expression to the standard error output stream.

@debug 10em + 12em;

输出:

Line 1 DEBUG: 22em

@warn

The @warn directive prints the value of a SassScript expression to the standard error output stream. It's useful for libraries that need to warn users of deprecations or recovering from minor mixin usage mistakes.

@warn 'This is a warning';

Sass 3.4 及更高版本

@error

The @error directive throws the value of a SassScript expression as a fatal error, including a nice stack trace. It’s useful for validating arguments to mixins and functions. For example:

@error 'This is an error';

.foo {
  background: red;
}

关于logging - Sass:打印到终端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18729192/

相关文章:

logging - 如何解决特定的循环依赖: DAL & Logging

ruby - WEBrick 以某种方式接管了我的 Sinatra 应用程序启动,如何关闭它?

c# - Visual Studio 2017 - 如何在 IDE 中配置命令终端?

javascript - 如何让 console.log 显示对象的当前状态?

javascript - node-sass 安装问题

python - Django 开发将 HttpResponses 记录到开发服务器

python - 什么写入日志文件?

javascript - 使用命令清除控制台

node.js - SyntaxError : Block-scoped declarations (let, const, function, class) 在严格模式之外还不支持安装SASS Node 包

css - 尝试使用 SASS 引用动态命名的变量