【问题标题】:Using a SASS variable as a value for CSS `content` property使用 SASS 变量作为 CSS `content` 属性的值
【发布时间】:2012-09-29 17:38:31
【问题描述】:

你好!

这可能是我对 SASS/Compass 缺乏了解造成的。

我正在尝试使用以下 SASS 代码输出网格宽度:

$total-columns        : 4
$column-width         : 4em                 // each column is 4em wide
$gutter-width         : $column-width / 2   // 1em gutters between columns
$grid-padding         : $gutter-width / 2   // grid-padding equal to gutters

#page
  +container
  +susy-grid-background

  #block-block-3
    div.content
      p:first-of-type:after
        content: columns-width()

块 3 中没有打印任何内容。:(

我也试过content: columns-width($total-columns),还是不行。如果我这样做content: "foo",“foo”会被打印出来。

我做错了什么?我如何查看 susy 计算的网格宽度?还有,可以打印在compass watch输出吗?

【问题讨论】:

    标签: compass-sass susy-compass


    【解决方案1】:

    好的,解决方法是使用interpolation

    content: "#{columns-width($total-columns)}"
    

    【讨论】:

      猜你喜欢
      • 2013-02-23
      • 2014-07-21
      • 1970-01-01
      • 2013-12-01
      • 2018-01-11
      • 1970-01-01
      • 2018-01-22
      • 2018-02-04
      相关资源
      最近更新 更多