Improved browser compatibility

Improve browser compatibility
This commit is contained in:
Martin Donath 2022-01-09 11:42:16 +01:00 committed by GitHub
commit 48bb814c5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 271 additions and 98 deletions

View File

@ -1 +1 @@
last 2 years
last 4 years

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -34,7 +34,7 @@
{% endif %}
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.bb3983ee.min.css' | url }}">
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.8002f318.min.css' | url }}">
{% if config.theme.palette %}
{% set palette = config.theme.palette %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.e6a45f82.min.css' | url }}">
@ -184,7 +184,7 @@
"base": base_url,
"features": features,
"translations": {},
"search": "assets/javascripts/workers/search.361d90f1.min.js" | url
"search": "assets/javascripts/workers/search.b6ff8c07.min.js" | url
} -%}
{%- if config.extra.version -%}
{%- set _ = app.update({ "version": config.extra.version }) -%}
@ -213,7 +213,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.2feb5f25.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.5e13d264.min.js' | url }}"></script>
{% for path in config["extra_javascript"] %}
<script src="{{ path | url }}"></script>
{% endfor %}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
{"version":3,"sources":["src/overrides/assets/stylesheets/main/_typeset.scss","../../../../src/overrides/assets/stylesheets/main.scss","src/assets/stylesheets/utilities/_break.scss","src/overrides/assets/stylesheets/main/layout/_banner.scss","src/overrides/assets/stylesheets/main/layout/_hero.scss","src/overrides/assets/stylesheets/main/layout/_icon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ULyKR,CKhKE,oCACE,eLkKJ,CK9JE,sEAEE,eLgKJ","file":"main.css"}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
{"version":3,"sources":["src/overrides/assets/stylesheets/main/_typeset.scss","../../../../src/overrides/assets/stylesheets/main.scss","src/assets/stylesheets/utilities/_break.scss","src/overrides/assets/stylesheets/main/layout/_banner.scss","src/overrides/assets/stylesheets/main/layout/_hero.scss","src/overrides/assets/stylesheets/main/layout/_iconsearch.scss","src/overrides/assets/stylesheets/main/layout/_sponsorship.scss"],"names":[],"mappings":"AA2BA,6BACE,cAIE,kBC7BF,CDgCA,QAEE,qBC/BF,CACF,CDoBA,qBACE,cAIE,kBC7BF,CDgCA,QAEE,qBC/BF,CACF,CD0CE,qBACE,aCxCJ,CD4CE,uBACE,UC1CJ,CD6CI,8BAGE,QAAA,CACA,sBAAA,CAHA,iBAAA,CACA,UCzCN,CD+CI,8BAOE,WAAA,CAFA,WAAA,CAFA,MAAA,CAGA,eAAA,CALA,iBAAA,CACA,KAAA,CAEA,UC1CN,CDkDE,uBACE,uCAAA,CAAA,+BChDJ,CDoDE,0BACE,aClDJ,CDsDE,+BACE,cAAA,CACA,uBCpDJ,CDuDI,0EAEE,WCtDN,CD0DI,oCAGE,2CAAA,CADA,gCAAA,CADA,aCtDN,CD6DE,4BACE,UAAA,CACA,uBC3DJ,CD8DI,2EAEE,SC7DN,CDqEI,wDAEE,cAAA,CAAA,cCnEN,CC2JI,wCF1FA,wDAMI,oBAAA,CAAA,eClEN,CACF,CDsEI,4BACE,8BAAA,CAAA,kBCpEN,CDyEE,wBACE,YAAA,CACA,gBCvEJ,CD0EI,4BAEE,kBAAA,CADA,WCvEN,CD+EM,sCACE,aAAA,CACA,kBC7ER,CDiFM,+BACE,aC/ER,CEnDE,mDAGE,kBFsDJ,CElDE,kBACE,kBFoDJ,CEhDE,8BACE,gBFkDJ,CEnDE,8BACE,iBFkDJ,CGlEA,eAEE,uYACE,CAFF,gBHsEF,CG3DE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A,CACA,UAAA,CAFA,aLqLR,CK9KI,mCAOE,kBAAA,CANA,aAAA,CACA,UAAA,CAEA,aAAA,CACA,YAAA,CACA,eAAA,CAEA,kBAAA,CACA,sCACE,CAPF,YLsLN,CK3KM,kFAEE,oBL4KR,CKzKQ,0FACE,mBL2KV,CKtKM,4CAME,+CAAA,CALA,yCAAA,CAEA,eAAA,CADA,eAAA,CAEA,kBAAA,CACA,iBLyKR,CKpKM,uCACE,aAAA,CAGA,mCAAA,CADA,WAAA,CAEA,uBAAA,CAHA,ULyKR,CKhKE,oCACE,eLkKJ,CK9JE,sEAEE,eLgKJ","file":"main.css"}

View File

@ -3,7 +3,7 @@
-#}
{% extends "base.html" %}
{% block extrahead %}
<link rel="stylesheet" href="{{ 'overrides/assets/stylesheets/main.d8956580.min.css' | url }}">
<link rel="stylesheet" href="{{ 'overrides/assets/stylesheets/main.de86b20e.min.css' | url }}">
{% endblock %}
{% block announce %}
<a href="https://twitter.com/squidfunk">
@ -16,5 +16,5 @@
{% endblock %}
{% block scripts %}
{{ super() }}
<script src="{{ 'overrides/assets/javascripts/bundle.337c27cf.min.js' | url }}"></script>
<script src="{{ 'overrides/assets/javascripts/bundle.83314047.min.js' | url }}"></script>
{% endblock %}

View File

@ -1,4 +1,4 @@
{#-
This file was automatically generated - do not edit
-#}
<script>var palette=__md_get("__palette");if(palette&&"object"==typeof palette.color)for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)</script>
<script>var palette=__md_get("__palette");if(palette&&"object"==typeof palette.color)for(var key of Object.keys(palette.color))document.body.setAttribute("data-md-color-"+key,palette.color[key])</script>

20
package-lock.json generated
View File

@ -1163,6 +1163,11 @@
"integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=",
"dev": true
},
"array-flat-polyfill": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/array-flat-polyfill/-/array-flat-polyfill-1.0.1.tgz",
"integrity": "sha512-hfJmKupmQN0lwi0xG6FQ5U8Rd97RnIERplymOv/qpq8AoNKPPAnxJadjFA23FNWm88wykh9HmpLJUUwUtNU/iw=="
},
"array-includes": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz",
@ -7467,6 +7472,11 @@
"integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
"dev": true
},
"resize-observer-polyfill": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
"integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg=="
},
"resolve": {
"version": "1.20.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
@ -9487,6 +9497,11 @@
"which-boxed-primitive": "^1.0.2"
}
},
"unfetch": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/unfetch/-/unfetch-4.2.0.tgz",
"integrity": "sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA=="
},
"unherit": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.3.tgz",
@ -9735,6 +9750,11 @@
"prepend-http": "^2.0.0"
}
},
"url-polyfill": {
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/url-polyfill/-/url-polyfill-1.1.12.tgz",
"integrity": "sha512-mYFmBHCapZjtcNHW0MDq9967t+z4Dmg5CJ0KqysK3+ZbyoNOWQHksGCTWwDhxGXllkWlOc10Xfko6v4a3ucM6A=="
},
"use": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",

View File

@ -38,13 +38,17 @@
"upgrade:install": "npm install"
},
"dependencies": {
"array-flat-polyfill": "^1.0.1",
"clipboard": "^2.0.8",
"escape-html": "^1.0.3",
"focus-visible": "^5.2.0",
"fuzzaldrin-plus": "^0.6.0",
"lunr": "^2.3.9",
"lunr-languages": "^1.9.0",
"rxjs": "^7.5.1"
"resize-observer-polyfill": "^1.5.1",
"rxjs": "^7.5.1",
"unfetch": "^4.2.0",
"url-polyfill": "^1.1.12"
},
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.15.4",

View File

@ -20,6 +20,7 @@
* IN THE SOFTWARE.
*/
import ResizeObserver from "resize-observer-polyfill"
import {
NEVER,
Observable,

View File

@ -20,7 +20,11 @@
* IN THE SOFTWARE.
*/
import "array-flat-polyfill"
import "focus-visible"
import "unfetch/polyfill"
import "url-polyfill"
import {
EMPTY,
NEVER,
@ -78,6 +82,7 @@ import {
patchScrollfix,
patchScrolllock
} from "./patches"
import "./polyfills"
/* ----------------------------------------------------------------------------
* Application

View File

@ -117,8 +117,7 @@ export function mountPalette(
/* Set color palette */
for (const [key, value] of Object.entries(palette.color))
if (typeof value === "string")
document.body.setAttribute(`data-md-color-${key}`, value)
document.body.setAttribute(`data-md-color-${key}`, value)
/* Toggle visibility */
for (let index = 0; index < inputs.length; index++) {

View File

@ -22,6 +22,8 @@
import lunr from "lunr"
import "~/polyfills"
import { Search, SearchIndexConfig } from "../../_"
import {
SearchMessage,

View File

@ -0,0 +1,96 @@
/*
* Copyright (c) 2016-2021 Martin Donath <martin.donath@squidfunk.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
/* ----------------------------------------------------------------------------
* Polyfills
* ------------------------------------------------------------------------- */
/* Polyfill `Object.entries` */
if (!Object.entries)
Object.entries = function (obj: object) {
const data: [string, string][] = []
for (const key of Object.keys(obj))
// @ts-expect-error - ignore property access warning
data.push([key, obj[key]])
/* Return entries */
return data
}
/* Polyfill `Object.values` */
if (!Object.values)
Object.values = function (obj: object) {
const data: string[] = []
for (const key of Object.keys(obj))
// @ts-expect-error - ignore property access warning
data.push(obj[key])
/* Return values */
return data
}
/* ------------------------------------------------------------------------- */
/* Polyfills for `Element` */
if (typeof Element !== "undefined") {
/* Polyfill `Element.scrollTo` */
if (!Element.prototype.scrollTo)
Element.prototype.scrollTo = function (
x?: ScrollToOptions | number, y?: number
): void {
if (typeof x === "object") {
this.scrollLeft = x.left!
this.scrollTop = x.top!
} else {
this.scrollLeft = x!
this.scrollTop = y!
}
}
/* Polyfill `Element.replaceWith` */
if (!Element.prototype.replaceWith)
Element.prototype.replaceWith = function (
...nodes: Array<string | Node>
): void {
const parent = this.parentNode
if (parent) {
if (nodes.length === 0)
parent.removeChild(this)
/* Replace children and create text nodes */
for (let i = nodes.length - 1; i >= 0; i--) {
let node = nodes[i]
if (typeof node !== "object")
node = document.createTextNode(node)
else if (node.parentNode)
node.parentNode.removeChild(node)
/* Replace child or insert before previous sibling */
if (!i)
parent.replaceChild(node, this)
else
parent.insertBefore(this.previousSibling!, node)
}
}
}
}

View File

@ -20,6 +20,8 @@
* IN THE SOFTWARE.
*/
import { ComponentChild } from "preact"
import { feature, translation } from "~/_"
import {
SearchDocument,
@ -61,8 +63,9 @@ function renderSearchDocument(
/* Render missing query terms */
const missing = Object.keys(document.terms)
.filter(key => !document.terms[key])
.map(key => [<del>{key}</del>, " "])
.flat()
.reduce<ComponentChild[]>((list, key) => [
...list, <del>{key}</del>, " "
], [])
.slice(0, -1)
/* Assemble query string for highlighting */

View File

@ -102,9 +102,13 @@
}
}
// Hide native details marker - Safari (iOS and macOS) does not seem to
// like :is() on details elements, so just go with a selector list.
&::marker,
// Hide native details marker - modern
&::marker {
display: none;
}
// Hide native details marker - legacy, must be split into a seprate rule,
// so older browsers don't consider the selector list as invalid
&::-webkit-details-marker {
display: none;
}

View File

@ -583,8 +583,13 @@
background-color: var(--md-accent-fg-color--transparent);
}
// Hide native details marker
&::marker,
// Hide native details marker - modern
&::marker {
display: none;
}
// Hide native details marker - legacy, must be split into a seprate rule,
// so older browsers don't consider the selector list as invalid
&::-webkit-details-marker {
display: none;
}

View File

@ -172,6 +172,9 @@
top: 0.025em;
left: -0.126em;
z-index: -1;
// Hack: the first property is used as a fallback for older browsers
// which don't support the min/max/clamp math functions.
width: calc(100% + 1.2ch);
width: max(2.2ch, 100% + 1.2ch);
height: 2.2ch;
margin: 0 -0.4ch;

View File

@ -24,6 +24,6 @@
<script>
var palette = __md_get("__palette")
if (palette && typeof palette.color === "object")
for (var [key, value] of Object.entries(palette.color))
document.body.setAttribute("data-md-color-" + key, value)
for (var key of Object.keys(palette.color))
document.body.setAttribute("data-md-color-" + key, palette.color[key])
</script>

View File

@ -23,7 +23,7 @@
import { createHash } from "crypto"
import { build as esbuild } from "esbuild"
import * as path from "path"
import postcss from "postcss"
import postcss, { Plugin, Rule } from "postcss"
import {
EMPTY,
Observable,
@ -82,6 +82,36 @@ function digest(file: string, data: string): string {
}
}
/**
* Custom PostCSS plugin to polyfill newer CSS features
*
* @returns PostCSS plugin
*/
function plugin(): Plugin {
const rules = new Set<Rule>()
return {
postcssPlugin: 'mkdocs-material',
Root (root) {
/* Fallback for :is() */
root.walkRules(/:is\(/, rule => {
if (!rules.has(rule)) {
rules.add(rule)
/* Add prefixed versions */
for (const pseudo of [":-webkit-any(", ":-moz-any("])
rule.cloneBefore({
selectors: rule.selectors.map(selector => (
selector.replace(/:is\(/g, pseudo)
))
})
}
})
}
}
}
plugin.postcss = true
/* ----------------------------------------------------------------------------
* Functions
* ------------------------------------------------------------------------- */
@ -110,6 +140,7 @@ export function transformStyle(
require("autoprefixer"),
require("postcss-logical"),
require("postcss-dir-pseudo-class"),
plugin,
require("postcss-inline-svg")({
paths: [
`${base}/.icons`