1

我正在尝试合并此 sass 代码,但它没有发生,请让我知道如何实现它的过程。

@charset "utf-8";
/* CSS Document */

h1 { color:#0ec3f7;}

$divColor : #f8f9be;
$borderStyle : dotted;
$width : 700px;
$height : 200px;

#first {background-color:divColor; border:1px borderStyle #F00; width:width; height:height;}

这是html文件

<html xmlns="http://www.w3.org/1999/xhtml">
<head>    
<title>css-saas-less</title>
<link rel="stylesheet" href="sasstemp.scss"  />    
</head>    
<body>   
<h1> CSS preprocessors </h1>

<div id="first">welcome to sass.....
</div></body>
</html>
4

2 回答 2

1
<link rel="stylesheet" href="sasstemp.scss"  />

这假设是

<link rel="stylesheet" href="sasstemp.css"  />

否则,您需要在系统上安装 ruby​​,然后您需要安装 sass gem。查看http://sass-lang.com/tutorial.html以获得帮助。

于 2013-06-18T06:25:18.487 回答
1

您必须使用应用程序将您的 sass 代码传输到 css

fe http://mhs.github.io/scout-app/(免费,windows)或 http://compass.handlino.com/(windows

你的代码应该是这样的

样式表.sass:

$divColor: #f8f9be
$borderStyle: dotted
$width: 700px
$height: 200px

#first 
    background-color: $divColor
    border: 1px $borderStyle #F00
    width: $width
    height: $height

没有 {} 或 ;

欲了解更多信息,请访问http://sass-lang.com/tutorial.html

或来自 Jeffrey Way 的精彩视频教程:http: //net.tutsplus.com/sessions/mastering-sass/

于 2013-06-17T12:24:55.090 回答