我今天正在尝试新的东西...... SASS对我来说都是新的.谁能告诉我这个错误是什么原因造成的?
/*
Error: Invalid CSS after " margin:": expected pseudoclass or pseudoelement, was "0px"
on line 5 of /Users/kishorechandra/S-ERP/sass/styles.scss
1: @import "compass";
2: @import "partials/variables";
3:
4: .ui.menu
5: margin:0px
6: background: rgba(255, 255, 255, 0)
7: font-family: 'Roboto Slab', serif
8:
9: .ui.icon.menu .active.item
10: color: #FFB300
Backtrace:
/Users/kishorechandra/S-ERP/sass/styles.scss:5
Run Code Online (Sandbox Code Playgroud)
小智 6
您使用哪种SASS-Sytnax,Sass(没有花括号)或SCSS(带花括号,更像css的样子)?
编译器将"margin:"解释为element(<margin></margin>),因为冒号后没有空格,并且for尝试将其作为状态(如:hover,:active)或pseudoelement(:: after,:: before)处理.
切换到SCSS青睐,或只是在冒号后面添加一个空格.
我更喜欢SCSS语法,因为大多数其他人使用它,并且它比经典Sass更不容易出错.