How do I represent a direct descendent CSS rule in SASS?
Ex.
body > div { ... }
Couldn't seem to find it in the docs: http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html
In the HTML file in your content make sure that you are placing child tags or having child tags inside a parent tag. Once you are done with the HTML tag then use ” & ” and ” > ” in the SCSS file to style the direct children.
Selector Combinators permalinkSelector Combinators You can nest selectors that use combinators as well. You can put the combinator at the end of the outer selector, at the beginning of the inner selector, or even all on its own in between the two.
The & is a special selector invented by SCSS which is used in nested selectors to refer to the outer selector . It simply means that it will be replaced with the outer selector when compiling to CSS.
You should just be able to
body >div property:value
You may have to escape the >
with a backslash \
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With