Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Separate styles for Macs?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #33778
    LowEndMac
    Member

    I want to try using some vintage Apple fonts on my website, including Chicago and Charcoal, which are already heavy fonts, so I don’t want to bold them in my headers. I can’t see any way to create header styles that will bold some fonts but not others, so I’m thinking that I might have to create a separate style sheet just for Macs – which would be a nuisance.

    I’m hoping someone here can help me figure this one out. Thanks!

    Dan Knight, LowEndMac.com

    #84421
    TheDoc
    Member

    Hey Dan,

    You could use something like this to put a new id on the body:

    http://www.stoimen.com/blog/2009/07/16/jquery-browser-and-os-detection-plugin/

    Then you can target it differently via CSS.

    #84453
    shazdeh
    Member

    I prefer to do this on the server, not because JS may be disabled and blah blah, but because it can speed up the loading time by removing the need for a jQuery plugin.
    If you’re using WordPress, drop this in your theme’s functions, which adds a ‘mac’ class to your body element (nice, no need for an extra HTTP request):


    function mac_body_class( $classes ) {
    if ( preg_match( "/Mac/", $_SERVER[ 'HTTP_USER_AGENT' ] ) )
    $classes[] = 'mac';
    return $classes;
    }
    add_filter( 'body_class', 'mac_body_class' );

    Or, do it like this:





    #88499
    LowEndMac
    Member

    I’ve decided against going in this directiont. Thanks for your suggestions.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.