Question

I have been having no end of difficulties in trying to set up Foundation 5 so that I can customise it using SASS. According to Zurb Foundation using SASS is the easiest way to customise it but for some reason there isn't any useful documentation on this.

I have searched everywhere and found bits and peices of inforamtion and have finally managed to get something working so that when I amend the main SCSS file it creates a corresponding CSS file. However, whatever variables I add to my SCSS file to try and amend the colours etc, it seems to have no effect. I read somewhere to copy the variables you want to change from the _settings.scss file and enter them into your own scss file and then amend the values. Can anyone please help me with this, its driving me insane. My Folder / file set up is:

/MyProject/
 /CSS/
    /foundation/
     - foundation.css
     - normalise.css
     - myfile.css
 /SCSS/
     /foundation/
            /components/ 
                 -- _accordion.scss
                 -- _etc.scss (and the rest ofthe files in components)
            -- _functions.scss
            -- _settings.scss
     - foundation.scss
     - normalise.scss
     - myfile.scss
  - index.html 

In myfile.scss I have:

@import 'foundation.scss';
@import 'normalize.scss';


 $body-bg: #ccc;
 $body-font-color: #000;
// $body-font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
// $body-font-weight: normal;
// $body-font-style: normal;

myfile.css always remains the same regardless of what I change in the above file:

body {
  background: white;
  color: #222222;
  padding: 0;
  margin: 0;
  font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  position: relative;
  cursor: default; }

The error message I receive is:

DEPRECATION WARNING: The return value of index() will change from "false" to
"null" in future versions of Sass. For compatibility, avoid using "== false" on
the return value. For example, instead of "@if index(...) == false", just write
"@if not index(...)".
        on line  of C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\foundation\_functions.scss, in `exports'
        from line 296 of C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\foundation\components\_global.scss
        from line 5 of C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\foundation\components\_accordion.scss
        from line 10 of C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\foundation.scss
        from line 11 of C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\store.scss
DEPRECATION WARNING on line 13 of C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\foundation\_functions.scss:
Assigning to global variable "$modules" by default is deprecated.
In future versions of Sass, this will create a new local variable.
If you want to assign to the global variable, use "$modules: append($modules, $name) !global" instead.
Note that this will be incompatible with Sass 3.2.

DEPRECATION WARNING on line 18 of C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\foundation\components\_block-grid.scss:
Assigning to global variable "$block-grid-default-spacing" by default is deprecated.
In future versions of Sass, this will create a new local variable.
If you want to assign to the global variable, use "$block-grid-default-spacing: $column-gutter !global" instead.
Note that this will be incompatible with Sass 3.2.

Done.
Était-ce utile?

La solution

Your variables need to be set first:

 $body-bg: #ccc;
 $body-font-color: #000;
// $body-font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
// $body-font-weight: normal;
// $body-font-style: normal;

@import 'foundation.scss';
@import 'normalize.scss';

Deprecated warnings are nothing to worry about since it is unrelated to your problem (they are something should be fixed by the Foundation maintainers).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top