zgabievi/sass-bem

[Proposal] Add support for both: before and after at the same time.

Closed this issue · 10 comments

We have both, but we have separately:

@include b('list') {
    @include before {
        color: black;
    }
}

and

@include b('list') {
    @include after {
        color: black;
    }
}

Can we create new mixin like this?

@include b('list') {
    @include before_after {
        color: black;
    }
}

Or usage like this would be awesome:

@include b('list') {
    @include before, after {
        color: black;
    }

 # or like this
  @include before,
  @include after {
     color:black;
  }
}

Sass have no support to use mixins separated by comma, if you want to write before and after in one mixin, you can use parse like this:

@include b('list') {
    @include parse(':before', ':after') {
        color: black;
    }
}

It's too long to write. Then make a new mixin and call it around. Or more semantic name.

What about ab? :D It's short, simple, It's brilliant.
image

I will make something easier ;)

For example ?

You will be able to define shortcut for several mixins at the same time

<3

When ? <3

I'm working on it now

Now you can use shortcodes ability to make progress faster ;) Also you can use p instead of parse. We have both, but to write less, you can use that short way. I'll add shortcodes usage in documentation

There you go. Check new documentation for version 2.5.0