Giter VIP home page Giter VIP logo

Comments (11)

kelyvin avatar kelyvin commented on May 16, 2024 1

Thanks for reporting this issue! I'll take a look at this over the weekend and try to get a fix in for the short term.

As for the refactor, you are 100% correct. I've been meaning to refactor and do an overhaul of the entire codebase when I had some free time (i.e. integrate ES6, get off bower, fix the build-tooling, etc). Been working on other projects so time has been a little harder to find recently :( I'll see what I can do.

from ghost-caffeine-theme.

Prochitaem avatar Prochitaem commented on May 16, 2024

So @kelyvin, is there any way to compile modified theme? (Basically, I changed only fonts).

from ghost-caffeine-theme.

kelyvin avatar kelyvin commented on May 16, 2024

Hi @Prochitaem,

Huge apologies for the super late reply, finally have a moment to take a look at this.

I actually did a fresh checkout and didn't run into any compile/build issues. Which version of nodejs are you running?

Unfortunately, this project is fairly old and still uses bower, which is responsible for bringing in the bourbon assets. Can you also make sure you have bower installed globally and try running bower install? It should auto run when you run npm install, but run it separately just in case.

For context, on my machine I am running on the following:

node v8.9.4
bower v1.8.2
npm v5.6.0

from ghost-caffeine-theme.

Prochitaem avatar Prochitaem commented on May 16, 2024

Hi @kelyvin My config is:
node v6.13.1
bower v1.8.2
npm 3.10.10

I was able to compile it by manually providing required files - but that broke the resulting css and js.
Had to roll back to the original files.

from ghost-caffeine-theme.

kelyvin avatar kelyvin commented on May 16, 2024

@Prochitaem when you say "broke the resulting css and js", what do you mean by that?

I'm guessing you're trying to run the compiled assets as a theme against Ghost, what kind of errors are you seeing on your browser tools? Also what version of Ghost are you running?

from ghost-caffeine-theme.

Prochitaem avatar Prochitaem commented on May 16, 2024

Uncaught TypeError: w.FontFaceObserver is not a constructor
at caffeine-theme.js?v=0db24c18ba:8
at caffeine-theme.js?v=0db24c18ba:8
It shows site header part but no posts are visible :(

from ghost-caffeine-theme.

kelyvin avatar kelyvin commented on May 16, 2024

These are with your font changes? or without?

from ghost-caffeine-theme.

Prochitaem avatar Prochitaem commented on May 16, 2024

This is with them:
_fonts.scss:

// Optimize css delivery
// @import url(https://fonts.googleapis.com/css?family=Raleway:400,700|Roboto+Slab:300,400);
// @import '../../vendor/font-awesome/scss/font-awesome';
@import url(https://use.fontawesome.com/releases/v5.0.8/css/all.css);
@import url(https://fonts.googleapis.com/css?family=Kurale|Roboto);
 
and in _variables.scss


$sans-font             : 'Kurale', sans-serif;
$sans-font-fallback    : Geneva, sans-serif;
$serif-font            : 'Roboto', Georgia, serif;


Those are the only changes I`ve made. I am a little bit suspicious about font-awesome part.

from ghost-caffeine-theme.

kelyvin avatar kelyvin commented on May 16, 2024

Okay perfect thanks for sending me that! I definitely know the issue.

You are correct, the issue lies within the following line:
@import url(https://use.fontawesome.com/releases/v5.0.8/css/all.css);

If you go to that CSS file directly, you'll see that it's trying to load the web fonts directly through lines of code that look like this: url(../webfonts/fa-solid-900.woff). However, the problem with this is that the browser tries to resolve this path and expects the font to exist within this path (which it doesn't).

So how can you fix this? There are many ways to do this. Probably the most straightforward way is to do the following: you can download Font Awesome 5 directly from their website, add the font faces to the fonts directory (which you'll see that I did the same for font awesome 4), and follow the instructions detailed here: https://fontawesome.com/how-to-use/web-fonts-with-css#less-and-sass. That should resolve your font face issue. Can you give that a try?

from ghost-caffeine-theme.

Prochitaem avatar Prochitaem commented on May 16, 2024

No luck :(
What I did:

  • changed _font.scss to
    -- @import '../../vendor/font-awesome/scss/fontawesome.scss';
    -- @import '../../vendor/font-awesome/scss/fa-solid.scss';
    (prior to that, copied sccs directory from fa distribution to that location)
  • added $fa-font-path: "../webfonts"; to the theme _variables.scss
  • added fonts to the webfonts dir

from ghost-caffeine-theme.

kelyvin avatar kelyvin commented on May 16, 2024

Closing due to my own inactivity and because I want to redo the entire build system so that this is no longer an issue. See #62

from ghost-caffeine-theme.

Related Issues (20)

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.