MeltingDog MeltingDog - 11 months ago 54
Sass (Sass) Question

What is the right way to style an element with multiple selectors in SASS?

I have some elements as such:

<div class="logo">
<a href="#">LOGO HERE</a>

Considering the
tag is the only element within
is it still appropriate to write the SASS as:

.logo {
a {

Or is normal css ok here? Eg:

.logo a {

Both ways work, of course, but is there a preferred way when working with SASS?

Answer Source

Both will work fine in SASS. Traditionally, for readability, it's better to nest the elements, as you've listed in the first example.