V
V
vasIvas2016-01-21 11:47:36
HTML
vasIvas, 2016-01-21 11:47:36

Why might class nesting not work in sass?

There is a lot of working code in sass. I decided to rewrite it a bit, to make the classes nested.
That is, there is .container> .rect markup for which there are styles

.container
    ...
.rect
    ...

I rewrite as in the code below, but the code stops working -
.container
    ...
    .rect
        ...

.container
    ...
.container .rect
    ...

I thought that template engines break the sequence, but I checked it in the browser itself and it can be seen that the nesting of html elements is correct. I tried to recreate on a thumbnail, but the error disappears and everything works. Does anyone have any ideas for this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2016-01-21
@vasIvas

CSS
SCSS

.container {
    > .rect {}
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question