Announcement

Collapse
No announcement yet.

CSS question...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    CSS question...

    I really like that lato font. I made it work by slapping in css by adding

    Code:
    @font-face {
      font-family: 'Lato';
      font-style: normal;
      font-weight: 400;
      src: local('Lato Regular'), local('Lato-Regular'), url(https://fonts.gstatic.com/s/lato/v11/9k-RPmcnxYEPm8CNFsH2gg.woff) format('woff');
    }
    @font-face {
      font-family: 'Lato';
      font-style: normal;
      font-weight: 700;
      src: local('Lato Bold'), local('Lato-Bold'), url(https://fonts.gstatic.com/s/lato/v11/wkfQbvfT_02e2IWO3yYueQ.woff) format('woff');
    }
    @font-face {
      font-family: 'Lato';
      font-style: italic;
      font-weight: 400;
      src: local('Lato Italic'), local('Lato-Italic'), url(https://fonts.gstatic.com/s/lato/v11/oUan5VrEkpzIazlUe5ieaA.woff) format('woff');
    }
    @font-face {
      font-family: 'Lato';
      font-style: italic;
      font-weight: 700;
      src: local('Lato Bold Italic'), local('Lato-BoldItalic'), url(https://fonts.gstatic.com/s/lato/v11/HkF_qI1x_noxlxhrhMQYED8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
    }
    had to add the https to it all the strings or it would create insecure checkout. So all works set that way and it doesn't appear to be causing issues. But the question is if its ok to call in https via the global css like that.
    Dan

    Girlfriends Lingerie - "Keeping It Sexy!"
    Sexy Lingerie - Twitter - Facebook- Pinterest - YouTube

    #2
    Re: CSS question...

    There are no "problems" with this implementation, but there is a slightly minor server overhead when you call in secure elements on non secure pages.

    You can use the protocol relative URL which will choose the right version to use:

    Code:
    src: local('Lato Regular'), local('Lato-Regular'), url(//fonts.gstatic.com/s/lato/v11/9k-RPmcnxYEPm8CNFsH2gg.woff) format('woff');
    However an even better way to do this, would be use a service like google fonts, which you make a single call to and it calls the different font files needed behind the scenes.

    Last edited by Brennan; 11-06-14, 10:49 AM.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: CSS question...

      Thanks Brennan. Ill probably slap in the relative for now. What about adding them to the site locally. Any advantages to doing it that way? Thanks
      Dan

      Girlfriends Lingerie - "Keeping It Sexy!"
      Sexy Lingerie - Twitter - Facebook- Pinterest - YouTube

      Comment


        #4
        Re: CSS question...

        Having the file locally on the server will usually be faster since it does not have to make a call out to google across the internet to get the file. There are several hundred mili-seconds you can gain.

        However, it is common practice to serve files like this from Google and other CDNs. Think of jQuery. This used to be recommended to be served locally, but now it is better to use a CDN. The reason being that if all sites use a CDN, there is a good chance that the visitor to your site already has the file cached, and will not have to download it at all which will actually save time.

        So it is a trade off. I can tell you here, we usually pull fonts from Google vs serving them locally.
        Brennan Heyde
        VP Product
        Miva, Inc.
        [email protected]
        https://www.miva.com

        Comment


          #5
          Re: CSS question...

          Awesome. Thank you so much Brennan.
          Dan

          Girlfriends Lingerie - "Keeping It Sexy!"
          Sexy Lingerie - Twitter - Facebook- Pinterest - YouTube

          Comment

          Working...
          X