CSS字符串规范

字符串、URL 应该始终被单引号(‘)所包裹,initialsans-serif 的专用名词无须引用起来

1
2
3
4
5
// Yep
$direction: 'left';

// Nope
$direction: left;
1
2
3
4
5
6
7
8
9
// Yep
.foo {
background-image: url('/images/kittens.jpg');
}

// Nope
.foo {
background-image: url(/images/kittens.jpg);
}
1
2
3
4
5
6
7
8
// Yep
$font-type: sans-serif;

// Nope
$font-type: 'sans-serif';

// Okay I guess
$font-type: unquote('sans-serif');
1
2
3
4
5
// Okay
@warn 'You can\'t do that.';

// Okay
@warn "You can't do that.";
坚持原创技术分享,您的支持将鼓励我继续创作!