1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-27 17:00:54 +01:00

Replaced use of flat() and max() math function for compatibility

This commit is contained in:
squidfunk 2022-01-06 20:26:34 +01:00
parent c45265d860
commit 0a25f757f4
7 changed files with 15 additions and 10 deletions

View File

@ -34,7 +34,7 @@
{% endif %}
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.4aa5fe16.min.css' | url }}">
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.43b2f457.min.css' | url }}">
{% if config.theme.palette %}
{% set palette = config.theme.palette %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.e6a45f82.min.css' | url }}">
@ -213,7 +213,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.a59c8768.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.9e2e17ab.min.js' | url }}"></script>
{% for path in config["extra_javascript"] %}
<script src="{{ path | url }}"></script>
{% endfor %}

View File

@ -27,6 +27,7 @@ import {
SearchResultItem
} from "~/integrations/search"
import { h, truncate } from "~/utilities"
import { ComponentChild, ComponentChildren } from "preact"
/* ----------------------------------------------------------------------------
* Helper types
@ -61,8 +62,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

@ -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;