abbreviated syntax for @include and @extend

1,575 views
Skip to first unread message

mongo296

unread,
May 23, 2011, 12:18:30 PM5/23/11
to Sass
Any chance we'll see shortcut syntax for @include and @extend?

when i first heard sass was creating scss (following less' suit, no?)
i thought great! but when i see '@include' everywhere it seems verbose
all of a sudden.

otherwise, love it!

thanks

Chris Eppstein

unread,
May 23, 2011, 3:57:08 PM5/23/11
to sass...@googlegroups.com
I'm not opposed to adding shorthand syntax in .sass files (@include is already + there and @mixin is already = there). But in .scss files a shortcut syntax is a unnecessary violation of the CSS3 parsing specification which would limit our compatibility with existing css3 based tools.

Chris


--
You received this message because you are subscribed to the Google Groups "Sass" group.
To post to this group, send email to sass...@googlegroups.com.
To unsubscribe from this group, send email to sass-lang+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sass-lang?hl=en.


David Oliver

unread,
Jul 5, 2011, 5:33:00 AM7/5/11
to Sass
I'd love a shorthand symbol for @extend. Or is there one already?

Kendall Totten

unread,
Dec 12, 2013, 3:38:46 PM12/12/13
to sass...@googlegroups.com, davidoliver...@googlemail.com
I've always wanted this and just figured out a quick way to do so. I have one mixin for extend that looks like this:

@mixin ext($name)
  @extend .#{$name} !optional

then I may extend other classes in a shorter format:

.foo
  background: red

.bar
  +ext("foo")

result:
.foo, .bar {
  background: red;

Loed Idzinga

unread,
Aug 23, 2014, 5:28:30 AM8/23/14
to sass...@googlegroups.com, davidoliver...@googlemail.com
Cool trick! Use it a lot, the past few days. Thanks!

Op donderdag 12 december 2013 21:38:46 UTC+1 schreef Kendall Totten:
Reply all
Reply to author
Forward
0 new messages