Support » Plugin: AMP » Custom CSS for AMP

  • Is there any plugins or way to add your own CSS into amp? I know AMP can get touchy about custom CSS but the CSS I wish to modify deals with referencing fonts on third party websites. I was wondering if there is a way I could reference fonts locally rather then rely on fonts.google.com as it states in the following line within google validator

    <link href=”https://fonts.googleapis.com/css?family=Merriweather:400,400italic,700,700italic|Open+Sans:400,700,400italic,700italic” rel=”stylesheet” type=”text/css”>

    Also as a bonus it would be nice to move “https://cdn.ampproject.org/v0.js” locally too.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mohammad Jangda

    (@batmoo)

    v0.4 restores the use of Google Fonts. I would not recommend moving moving these locally though for two reasons:

    1) The pages may not longer validate correctly.
    2) You lose any of the benefits that using the AMP/Google CDNs provide.

    Your recommendation is noted and I thank you for your response. You do great work with this plugin and it has helped tremendously. However, I think even Google misses the point as to why people host their own content which can be summed up into one word:

    “Control”

    You state that the pages may not validate correctly. I’m willing to take that risk.

    You state that I will loose all benefits of Googles CDN. If they are that power hungry then I no longer care about Googles CDN. AMP was designed to be a minimalist version of my website which can be accessed by mobile phones quickly. If Google can’t get out of its own way in terms of doing multiple DNS lookups for fonts and for the .js files. Then I will make Google get out of its own way.

    If you are constantly reliant on third party servers and services in order to host your content. Then why even host it at all? Just go to blogspot. or disappear into the Facebook cloud.

    It’s obvious that custom CSS will not be available for your plugin. Which means I’ll have to modify the plugin myself or find an AMP plugin that includes such features.

    Once again, I thank you for your response, and understand that you must conform to the standards of Google. I guess I refuse to conform.

    – S

    Plugin Author Mohammad Jangda

    (@batmoo)

    Fair enough 🙂

    There are hooks and filters within the plugin that you could use to point to the scripts to domain of your choice that you control. It will likely mean that Google will no longer link to your AMP page (as they will not validate) but other services/apps like Nuzzel might.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.