我有4个sass文件
main.sass
,
_fonts.sass
,
_variables.sass
,
_home.sass
.
主.sass
@import 'fonts'
@import 'variables'
@import 'home'
_字体.sass
@font-face
font-family: "FontAwesome"
font-weight: normal
font-style: normal
src: url("https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/fonts/fontawesome-webfont.eot?v=4.3.0")
src: url("https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/fonts/fontawesome-webfont.eot?#iefix&v=4.3.0") format("embedded-opentype"), url("https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/fonts/fontawesome-webfont.woff2?v=4.3.0") format("woff2"), url("https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/fonts/fontawesome-webfont.woff?v=4.3.0") format("woff"), url("https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/fonts/fontawesome-webfont.ttf?v=4.3.0") format("truetype"), url("https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/fonts/fontawesome-webfont.svg?v=4.3.0#fontawesomeregular") format("svg")
_变量.sass
$yellow: #fce001
_主页.sass
.container
color: $yellow
text-align: right
.another-container
color: $yellow
text-align: center
&:after
content: '\f0b0'
font-family: FontAwesome
font-style: normal
font-weight: normal
text-decoration: inherit
position: absolute
right: 20px
display: inline-block
font-size: 1.1em
这是我的HTML示例
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>hello</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="style.css" />
</head>
<body>
<div class="container">
container
</div>
<div class="another-container">
another-container
</div>
</body>
</html>
我正在使用以下命令编译sass文件:
sass --watch main.sass:style.css
当我检查我的google chrome inspect元素时
container
或
another-container
,它指向
_变量.sass
不是
_主页.sass
.
_变量.sass
只包含变量。我想指出
_主页.sass
.
@更新
我设法查明是什么导致了这个错误,在
_主页.sass
在里面
content: '\f0b0'
,如果删除此项,源映射将指向正确的行,为什么会导致该错误?