Allow media queries for custom CSS

This commit is contained in:
squidfunk 2020-02-25 16:19:43 +01:00
parent ca50ed8200
commit b623010993

View File

@ -94,17 +94,12 @@
<!-- Theme-related stylesheets --> <!-- Theme-related stylesheets -->
{% block styles %} {% block styles %}
<link <link rel="stylesheet" href="{{ 'assets/stylesheets/app.scss' | url }}" />
rel="stylesheet"
type="text/css"
href="{{ 'assets/stylesheets/app.scss' | url }}"
/>
<!-- Extra color palette --> <!-- Extra color palette -->
{% if palette.primary or palette.accent %} {% if palette.primary or palette.accent %}
<link <link
rel="stylesheet" rel="stylesheet"
type="text/css"
href="{{ 'assets/stylesheets/app-palette.scss' | url }}" href="{{ 'assets/stylesheets/app-palette.scss' | url }}"
/> />
{% endif %} {% endif %}
@ -130,7 +125,6 @@
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin /> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin />
<link <link
rel="stylesheet" rel="stylesheet"
type="text/css"
href="https://fonts.googleapis.com/css?family={{ href="https://fonts.googleapis.com/css?family={{
font.text | replace(' ', '+') + ':300,400,400i,700%7C' + font.text | replace(' ', '+') + ':300,400,400i,700%7C' +
font.code | replace(' ', '+') font.code | replace(' ', '+')
@ -153,15 +147,19 @@
{% if config.extra.manifest %} {% if config.extra.manifest %}
<link <link
rel="manifest" rel="manifest"
type="application/manifest+json"
href="{{ config.extra.manifest | url }}" href="{{ config.extra.manifest | url }}"
crossorigin="use-credentials" crossorigin="use-credentials"
/> />
{% endif %} {% endif %}
<!-- Custom stylesheets --> <!-- Custom stylesheets, might contain media query after URL -->
{% for path in config["extra_css"] %} {% for file in config["extra_css"] %}
<link rel="stylesheet" type="text/css" href="{{ path | url }}" /> {% set path,media = file.split(" ", 1) %}
{% if media %}
<link rel="stylesheet" href="{{ path | url }}" media="{{ media }}" />
{% else %}
<link rel="stylesheet" href="{{ path | url }}" />
{% endif %}
{% endfor %} {% endfor %}
<!-- Analytics --> <!-- Analytics -->