tags:

views:

28

answers:

1

I need to change all the CSS into SASS... and find that

margin:10px

working in CSS and failing in SASS somewhat disturbing...

It is easy to miss one and you don't what you are missing (what is not working in the final CSS but you don't know)

Pretty much I am grep for /:\S/ (colon by followed by a non-whitespace) to see if there are such cases, using TextMate (a Mac text editor)... but those a:hover also shows up as well.

+1  A: 

In Sass you can define nested selectors, and these can have pseudoclasses such as :hover. It doesn't see your margin as an attribute but as another element with a pseudoclass.

.stylin
  display: block
  margin:10px
  a:hover
    color: red

The above will recognize display: block correctly, but it will see margin:10px and a:hover as the same kind of pattern.

Andrew Vit
but I think if the CSS parser is smart enough to tell the difference, the SASS parser should be able to too
動靜能量