Skip to content

Commit

Permalink
Remove type="text/css" from stylesheet links
Browse files Browse the repository at this point in the history
MDN directly recommends this in
<https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link>, since "CSS
is the only stylesheet language used on the web."

Like <rust-lang/rust#101023>, but for docs.rs.
  • Loading branch information
notriddle committed Sep 13, 2022
1 parent 4abe7e9 commit cc5266d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{%- block meta -%}{%- endblock meta -%}

{# Docs.rs styles #}
<link rel="stylesheet" href="/-/static/vendored.css?{{ docsrs_version() | slugify }}" type="text/css" media="all" />
<link rel="stylesheet" href="/-/static/style.css?{{ docsrs_version() | slugify }}" type="text/css" media="all" />
<link rel="stylesheet" href="/-/static/vendored.css?{{ docsrs_version() | slugify }}" media="all" />
<link rel="stylesheet" href="/-/static/style.css?{{ docsrs_version() | slugify }}" media="all" />

<link rel="search" href="/-/static/opensearch.xml" type="application/opensearchdescription+xml" title="Docs.rs" />

Expand Down
1 change: 0 additions & 1 deletion templates/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
var link = document.createElement("link");
link.rel = "stylesheet";
link.href = stylesheet;
link.type = "text/css";
link.media = "all";
document.head.appendChild(link);
</script>
Expand Down
2 changes: 1 addition & 1 deletion templates/rustdoc/head.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- import "macros.html" as macros -%}
<link rel="stylesheet" href="/-/static/{{metadata.rustdoc_css_file}}?{{ docsrs_version() | slugify }}" type="text/css" media="all" />
<link rel="stylesheet" href="/-/static/{{metadata.rustdoc_css_file}}?{{ docsrs_version() | slugify }}" media="all" />

<link rel="search" href="/-/static/opensearch.xml" type="application/opensearchdescription+xml" title="Docs.rs" />

Expand Down
2 changes: 1 addition & 1 deletion templates/rustdoc/vendored.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<link rel="stylesheet" href="/-/static/vendored.css?{{ docsrs_version() | slugify }}" type="text/css" media="all" />
<link rel="stylesheet" href="/-/static/vendored.css?{{ docsrs_version() | slugify }}" media="all" />

0 comments on commit cc5266d

Please sign in to comment.