rscss icon indicating copy to clipboard operation
rscss copied to clipboard

Question: Are these examples for SASS only?

Open jlap opened this issue 10 years ago • 7 comments

Hello!

I was wondering if the examples in this repo are meant for SASS only. I never tried it so I can't recognize its syntax, but the nesting, classes beginning with "&." and things like that don't seem like regular CSS (Although it might simply be things I didn't know about !)

Thanks

jlap avatar Feb 09 '15 18:02 jlap

& is something that exists in Sass, Stylus and Less. @extend exists in Sass and Stylus. :-)

rstacruz avatar Feb 09 '15 19:02 rstacruz

Ah ok thank you. I was reading it and it wasn't clear the examples weren't in pure css so it got me confused.

jlap avatar Feb 09 '15 19:02 jlap

Ah yes... definitely needs some annotations. I'm leaving this open for now until I get some time to clarify it.

rstacruz avatar Feb 10 '15 05:02 rstacruz

any similiar feature like @extend in SASS?

lijunle avatar Feb 10 '15 14:02 lijunle

@lijunle Mixins and Functions etc. For full list check http://sass-lang.com/documentation/file.SASS_REFERENCE.html

visualcookie avatar Feb 10 '15 21:02 visualcookie

I suppose the @extend will modify the DOM class. After read its document, I find I am wrong. LESS mixin and function is the same thing to this.

On Tuesday, February 10, 2015, Dean Hidri [email protected] wrote:

@lijunle https://github.com/lijunle Mixins and Functions etc. For full list check http://sass-lang.com/documentation/file.SASS_REFERENCE.html

— Reply to this email directly or view it on GitHub https://github.com/rstacruz/rscss/issues/3#issuecomment-73784811.

lijunle avatar Feb 11 '15 02:02 lijunle

Just to clarify for OP (@jlap), & refers to the parent selector. For instance, say we have this:

.foo-bar {
  // styles #1 ...

  &.-baz {
    // styles #2 ...
  }
}

It would compile to (or something similar to):

.foo-bar {
  /* styles #1 ... */
}

.foo-bar.-baz {
  /* styles #2 ... */
}

I think RSCSS is more about the structure rather than how you type it. So both are valid ways to practice RSCSS .

jamen avatar Nov 13 '15 18:11 jamen