maxmx / bootstrap-stylus

Port of Bootstrap to Stylus
MIT License
585 stars 113 forks source link

@extend .clearfix in mixins #108

Closed Makvagabo closed 8 years ago

Makvagabo commented 8 years ago

Sass @include != Stylus @extend Example

container-fixed($gutter = $grid-gutter-width)
  margin-right auto
  margin-left auto
  padding-left ($gutter / 2)
  padding-right ($gutter / 2)
  @extend .clearfix

I think it must be that

container-fixed($gutter = $grid-gutter-width)
  margin-right auto
  margin-left auto
  padding-left ($gutter / 2)
  padding-right ($gutter / 2)
  clearfix()
jeremyben commented 8 years ago

Actually, the less version of Bootstrap uses extends and the sass version uses mixins (in the case of the clearfix hack). Maxime probably chose to use extends in the stylus version to avoid code duplication inherent to mixins.

I thought that extends were better than mixins for performance and compaction reasons, but that article changed my mind.

maxmx commented 8 years ago

Extend also has a few caveats, I'm all for mixins as well.

I'm not super active on developing bootstrap stylus but I do take pull requests and merge them when they make sense.

Blackskyliner commented 8 years ago

As this issue already got an merged patch, I guess it can be closed.