website: fix for safari and ms edge

This commit is contained in:
Rasmus Andersson 2018-10-11 10:41:10 -07:00
parent c10bbc8a18
commit 098f2aaf32
3 changed files with 18 additions and 12 deletions

View file

@ -59,13 +59,19 @@ endfor
<meta property="og:type" content="product"> <meta property="og:type" content="product">
<meta property="og:locale" content="en_US" /> <meta property="og:locale" content="en_US" />
</head> </head>
<script> <script>
(function(u){ (function(u){
if (u.indexOf('Safari/') != -1 && u.indexOf('Chrome/') == -1 && u.indexOf('Chromium/') == -1) { if (
document.documentElement.classList.add('safari') ( u.indexOf('Safari/') != -1 &&
u.indexOf('Chrome/') == -1 &&
u.indexOf('Chromium/') == -1 ) ||
u.indexOf('Edge/') != -1
) {
// Use alternate variable font for Safari and MS Edge
document.documentElement.classList.add('vf-alt')
} }
})(navigator.userAgent); })(navigator.userAgent);
</script> </script>
<body> <body>
<div id="hud-notification"><div class="msg">Hello</div></div> <div id="hud-notification"><div class="msg">Hello</div></div>
<script src="{{url_root}}res/base.js?v={{ base_js_v }}"></script> <script src="{{url_root}}res/base.js?v={{ base_js_v }}"></script>

View file

@ -18,11 +18,11 @@ body {
scroll-behavior: smooth; scroll-behavior: smooth;
font-kerning: normal; font-kerning: normal;
-moz-font-feature-settings:"kern" 1, "liga" 1; -moz-font-feature-settings: "calt" 1, "kern" 1, "liga" 1;
-ms-font-feature-settings:"kern" 1, "liga" 1; -ms-font-feature-settings: "calt" 1, "kern" 1, "liga" 1;
-o-font-feature-settings:"kern" 1, "liga" 1; -o-font-feature-settings: "calt" 1, "kern" 1, "liga" 1;
-webkit-font-feature-settings:"kern" 1, "liga" 1; -webkit-font-feature-settings: "calt" 1, "kern" 1, "liga" 1;
font-feature-settings:"kern" 1, "liga" 1; font-feature-settings: "calt" 1, "kern" 1, "liga" 1;
} }
/* Font style classifiers used by samples and dynmetrics */ /* Font style classifiers used by samples and dynmetrics */
@ -44,8 +44,8 @@ body {
body { body {
font-family: 'Inter UI var', system-ui, sans-serif; font-family: 'Inter UI var', system-ui, sans-serif;
} }
html.safari body { html.vf-alt body {
font-family: 'Inter UI var safari-fix', system-ui, sans-serif; font-family: 'Inter UI var alt', system-ui, sans-serif;
} }
} }

View file

@ -126,7 +126,6 @@ tt {
</style> </style>
</head> </head>
<body>
<script> <script>
(function(u){ (function(u){
if (u.indexOf('Safari/') != -1 && u.indexOf('Chrome/') == -1 && u.indexOf('Chromium/') == -1) { if (u.indexOf('Safari/') != -1 && u.indexOf('Chrome/') == -1 && u.indexOf('Chromium/') == -1) {
@ -136,6 +135,7 @@ if (u.indexOf('Safari/') != -1 && u.indexOf('Chrome/') == -1 && u.indexOf('Chrom
} }
})(navigator.userAgent); })(navigator.userAgent);
</script> </script>
<body>
<div class="intro"> <div class="intro">
<h1>Inter UI variable font test</h1> <h1>Inter UI variable font test</h1>
<p> <p>