You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a look at the Code (Codepen) you might notice ".test2 > .test1__item" and ".test2 > .test3__item" don't exist (and won't exist in future). I know why this happens (SASS doesn't know my HTML structure), but i'm wondering if there is a "fix" or at least a workaround? The only workaround i can think of is using silent classes only for widths, pull and push classes and use a HTML structure like this instead
Although not a perfect solution, you could try nesting your generation of the items inside each appropriate parent class to restrict Sass just a little. It does seem to get a little confused with the direct > parenting generation.
However, what Sass is doing seems to be generally correct - you have X parents and Y children, so it has to generate for all possibilities.
Thanks, i will give it a try. I also came up with a different approach which could work. I'll try to get rid of most of those parent selectors and use silent classes like "%grid__item--bottom" (rather than "%grid--bottom") and so on. That way Sass doesn't have to generate for all possibilities, but just one.
If you use silent classes, SASS outputs strange CSS (http://codepen.io/anon/pen/CuFsE)
I created three divs (.test1, .test2, .test3) and applied some silent classes to them:
The CSS output looks like this:
If you have a look at the Code (Codepen) you might notice ".test2 > .test1__item" and ".test2 > .test3__item" don't exist (and won't exist in future). I know why this happens (SASS doesn't know my HTML structure), but i'm wondering if there is a "fix" or at least a workaround? The only workaround i can think of is using silent classes only for widths, pull and push classes and use a HTML structure like this instead
This could work, but probably this is a known issue and somebody came up with a better workaround.
Thanks in advance
The text was updated successfully, but these errors were encountered: