hammygoonan
hammygoonan

Reputation: 2225

Foundation generating duplicate CSS

Ok, so I know there's plenty out there about this already but I can't seem to find the answer for my specific circumstances.

I'm using Foundation 5.4.7, SASS 3.4.7 and Compass 1.0.1

When I compile the SASS it is giving me a heap of duplicate entries and what should be a reasonably lean CSS file is now massive.

All the advice suggests that the problem lies around line 10 of the foundation/_functions.scss file:

$modules: () !default;
@mixin exports($name) {
  $module_index: index($modules, $name);
  @if (($module_index == null) or ($module_index == false)) {
    $modules: append($modules, $name);
    @content;
  }
}

Specifically, people are suggesting adding !global to the end of $modules: append($modules, $name);

However this isn't working for me. Suggestions welcome

Upvotes: 1

Views: 184

Answers (2)

hammygoonan
hammygoonan

Reputation: 2225

The answer, as it turns out, was simply to add !global

$modules: () !default;
@mixin exports($name) {
  $module_index: index($modules, $name);
  @if (($module_index == null) or ($module_index == false)) {
    $modules: append($modules, $name) !global;
    @content;
  }
}

Upvotes: 1

cport1
cport1

Reputation: 1160

I modified mine to this:::

$modules: () !default;
@mixin exports($name) {
  @if (index($modules, $name) == false) {
    $modules: append($modules, $name);
    @content;
  }
}

Upvotes: 0

Related Questions