Registry / gcp / ember-cli-google-fonts

ember-cli-google-fonts

JSON →
library2.16.2jsnpmunverified

An Ember addon (v2.16.2) that lazily adds Google Fonts to an Ember application by injecting font declarations into the `content-for: head` hook, avoiding inclusion in CSS files. Supports Ember projects targeting Node 4.5+, 6.*, or 7.*. Follows Ember 2.x versioning. Differentiators: minimal configuration via environment.js, automatic Content Security Policy updates, and lazy loading without blocking render.

npm install ember-cli-google-fonts
INSTALL
IMPORT
SIG · EMBER-CLI-GOOGLE-F
E
ember-cli-google-fonts
gcpjavascriptv2.16.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

googleFonts config
// in config/environment.js googleFonts: ['Open+Sans:300,400,700']
googleFonts: 'Open+Sans:300,400,700'
Configuration is an array of strings, not a single string. Each font family with optional weights/styles.
contentSecurityPolicy
// in config/environment.js contentSecurityPolicy: { 'font-src': "'self' fonts.gstatic.com", 'style-src': "'self' fonts.googleapis.com" }
contentSecurityPolicy: { 'font-src': 'fonts.gstatic.com' }
Missing 'self' and style-src can break CSP. Must include both font-src and style-src with correct origins.
ember install
ember install ember-cli-google-fonts
npm install ember-cli-google-fonts --save-dev
Use ember install to ensure blueprint runs. Manual npm install may miss addon registration.

Installs the addon and configures Google Fonts with Content Security Policy in an Ember project.

ember install ember-cli-google-fonts // config/environment.js module.exports = function(environment) { var ENV = { googleFonts: [ 'Open+Sans:300,400,700', 'Roboto:300' ], contentSecurityPolicy: { 'font-src': "'self' fonts.gstatic.com", 'style-src': "'self' fonts.googleapis.com" } }; return ENV; };
Debug
Known issues
gotchaGoogle requires an API key for usage; this addon does not handle key authentication. Public fonts work without key, but new projects may require key.
fix
Set environment variable GOOGLE_FONTS_API_KEY or use API key in config.
affects: >=2.0
breakingIn v2.0.0, the configuration property name changed from 'googleFonts' to 'googleFonts' (same), but the format changed from a string to an array.
fix
Update config to use array format: ['Open+Sans:300,400,700'] instead of 'Open+Sans:300,400,700'.
affects: >=2.0
gotchaThe addon does not lazy load fonts as of v2.16.2; fonts are loaded synchronously in head. Future versions may support lazy loading.
fix
Manually add loading='lazy' attribute if asynchronous loading is needed.
affects: <3.0
Errors
Common errors & fixes
Refused to load the font '<URL>' because it violates the following Content Security Policy directive: 'font-src 'self''.
Missing fonts.gstatic.com in font-src CSP.
fix
Add 'font-src': "'self' fonts.gstatic.com" to contentSecurityPolicy.
Error: Could not find module 'ember-cli-google-fonts' imported from 'my-app/components/my-component'
Addon not properly installed or registered.
fix
Run 'ember install ember-cli-google-fonts' again or add to package.json and run npm install. Ensure ember-cli-build.js includes it.
TypeError: googleFonts.split is not a function
googleFonts config is a string instead of an array.
fix
Change 'googleFonts: "Open+Sans:300,400,700"' to 'googleFonts: ["Open+Sans:300,400,700"]' in config/environment.js.
Upgrade
Version history
2.16.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
44 hits · last 30 days
node
36
OpenAI (training)
2
Resources
ember-cli-google-fonts — npm install ember-cli-google-fonts · libregistry