Menu icon Foundation
Get rid of open sans import

For some reason this line of code always happens in the top of my app.css file when I save any changes in my _settings.scss

@import url("//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,700");

How can I get rid of it?

open sanstypographyappcssscss

For some reason this line of code always happens in the top of my app.css file when I save any changes in my _settings.scss

@import url("//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,700");

How can I get rid of it?

Karl Ward over 5 years ago

Find the $include-open-sans setting in _settings.scss, uncomment it, and set it to false:

$include-open-sans: false;

Robin Cox over 5 years ago

Could not find it in _settings.scss, so I pasted it in at the bottom of the document. Thanks alot :)

Karl Ward over 5 years ago

I think they added this setting in 5.0.2, so maybe your settings file is from 5.0.1 ...

Charlie Schliesser over 5 years ago

Even with this variable set to false, _type.scss sets $header-font-family to use Open Sans. You must set $header-font-family: $body-font-family in your _settings.scss to combat this. I think it's a bad idea to hand-code font names like this in _type.scss.

Ben Hutchings over 5 years ago

For me, setting $header-font-family: $body-font-family in _settings.scss results in the error:

Syntax error: Undefined variable: "$body-font-family" on line 6 of /my/path/to/scss/_settings.scss

I found I need to also define the variable in _settings.scss like so:

$include-open-sans: false;
$body-font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif !default;
$header-font-family: $body-font-family;

$body-font-family is usually set in '_global.scss' and I guess _settings.scss loads first? Chicken egg I suppose.

Rafi Benkual over 5 years ago

@Charlie and @Ben, if you update to 5.0.3 all the typography variables are not in _settings.scss.

As part of 5.1 which will be the next release, we are making the inclusion of the font optional.

Ben Hutchings over 5 years ago

Thanks Rafi, I updated and it looks like Open Sans isn't loaded anywhere now. This is fine with me :)

Is $include-open-sans variable used at all now? If not I guess it should be removed from /bower_components/foundation/scss/foundation/_settings.scss also.

EDIT: Ok just checked and it's already been removed from the repo. great!

Cheers!
Ben