Coder Social home page Coder Social logo

dan503 / font-face-generator Goto Github PK

View Code? Open in Web Editor NEW
43.0 43.0 4.0 229 KB

An @font-face generating Sass mixin to make adding custom fonts to websites much easier.

License: MIT License

CSS 58.08% JavaScript 4.36% SCSS 37.56%
font-face font-face-generator font-family font-weights generator mixin mixins scss

font-face-generator's People

Contributors

burdulixda avatar dan503 avatar vincentdevreede avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

font-face-generator's Issues

Unexpected token: $fonts: () !default;

I'm trying to get your npm package to work, and it continues to throw an error derived from the mixin.scss file in the package. The specific error is:

F:\Web\Standard Assets>gulp fontface
F:\Web\Standard Assets\node_modules\font-face-generator\mixin.scss:2
$fonts: () !default;
         ^

SyntaxError: Unexpected token )
    at Module._compile (internal/modules/cjs/loader.js:721:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (F:\Web\Standard Assets\gulpfile.js:4:13)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)

Please note that the error also occurs if you attempt to declare the $font property as described in your instructions.
The details of my setup:

  • Server: Apache 2.4
  • Operating System: Windows 10 Pro
  • Gulp v. 4.0.2, CLI c. 2.2.0
  • Node 10.15.0

Clearly, your package requires a version of JS that allows $variable = (). I've seen hashmaps and similar structures expressed at $variable = [] and $variable = {}, but never $variable = ().

If you need it, I can send the code that I did, but it clearly looks like the error is in your mixins.scss file.

Font family with spaces are not wrapped by quotes

I'm using the following example:

@include font-face((
  'Open Sans' : (
    300 : 'open-sans-light'
  )
));

and got this result:

@font-face {
  font-family: Open Sans;
  font-style: normal;
  font-weight: 300;
  src: local("☺"), url(../fonts/Open-Sans/open-sans-light.woff) format("woff");
}

As you can see, the font-family is not wrapped with quotes.

Am I doing something wrong? I'm using the documentation example by the way.

EDIT:

Everything is fine, it was related to my CSS optimiser 😅

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.