summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2022-01-21 15:46:37 +0100
committerClaude Paroz <claude@2xlibre.net>2022-01-22 16:38:14 +0100
commit7c4f3965098baad2396e24501e09237425a7bd6f (patch)
tree278ceb3d95a513df3d74941eeb46b927a04224a3 /docs
parent9dc65263d47a5b8857492c10ce151bab83cfe672 (diff)
Stopped including type="text/css" attributes for CSS link tags.
Diffstat (limited to 'docs')
-rw-r--r--docs/_theme/djangodocs/layout.html2
-rw-r--r--docs/intro/tutorial06.txt2
-rw-r--r--docs/ref/templates/builtins.txt2
-rw-r--r--docs/releases/4.1.txt3
-rw-r--r--docs/topics/forms/media.txt37
5 files changed, 27 insertions, 19 deletions
diff --git a/docs/_theme/djangodocs/layout.html b/docs/_theme/djangodocs/layout.html
index c8770173aa..487c2b4922 100644
--- a/docs/_theme/djangodocs/layout.html
+++ b/docs/_theme/djangodocs/layout.html
@@ -72,7 +72,7 @@
</script>
{% endif %}
{%- if include_console_assets -%}
-<link rel="stylesheet" href="{{ pathto('_static/console-tabs.css', 1) }}" type="text/css" />
+<link rel="stylesheet" href="{{ pathto('_static/console-tabs.css', 1) }}">
{%- endif -%}
{% endblock %}
diff --git a/docs/intro/tutorial06.txt b/docs/intro/tutorial06.txt
index c3df546cae..f0087f8905 100644
--- a/docs/intro/tutorial06.txt
+++ b/docs/intro/tutorial06.txt
@@ -74,7 +74,7 @@ Next, add the following at the top of ``polls/templates/polls/index.html``:
{% load static %}
- <link rel="stylesheet" type="text/css" href="{% static 'polls/style.css' %}">
+ <link rel="stylesheet" href="{% static 'polls/style.css' %}">
The ``{% static %}`` template tag generates the absolute URL of static files.
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index 1fcfa1fa88..08c1ca47e2 100644
--- a/docs/ref/templates/builtins.txt
+++ b/docs/ref/templates/builtins.txt
@@ -2637,7 +2637,7 @@ It is also able to consume standard context variables, e.g. assuming a
``user_stylesheet`` variable is passed to the template::
{% load static %}
- <link rel="stylesheet" href="{% static user_stylesheet %}" type="text/css" media="screen">
+ <link rel="stylesheet" href="{% static user_stylesheet %}" media="screen">
If you'd like to retrieve a static URL without displaying it, you can use a
slightly different call::
diff --git a/docs/releases/4.1.txt b/docs/releases/4.1.txt
index 8a531039ef..cf4eb07b35 100644
--- a/docs/releases/4.1.txt
+++ b/docs/releases/4.1.txt
@@ -366,6 +366,9 @@ Miscellaneous
:attr:`~django.contrib.admin.ModelAdmin.inlines` attributes now default to an
empty tuple rather than an empty list to discourage unintended mutation.
+* The ``type="text/css"`` attribute is no longer included in ``<link>`` tags
+ for CSS :doc:`form media </topics/forms/media>`.
+
.. _deprecated-features-4.1:
Features deprecated in 4.1
diff --git a/docs/topics/forms/media.txt b/docs/topics/forms/media.txt
index 34bc70dcc5..6ca7c66fde 100644
--- a/docs/topics/forms/media.txt
+++ b/docs/topics/forms/media.txt
@@ -71,7 +71,7 @@ can be retrieved through this property::
>>> w = CalendarWidget()
>>> print(w.media)
- <link href="http://static.example.com/pretty.css" type="text/css" media="all" rel="stylesheet">
+ <link href="http://static.example.com/pretty.css" media="all" rel="stylesheet">
<script src="http://static.example.com/animations.js"></script>
<script src="http://static.example.com/actions.js"></script>
@@ -114,9 +114,14 @@ requirements::
If this last CSS definition were to be rendered, it would become the following HTML::
- <link href="http://static.example.com/pretty.css" type="text/css" media="screen" rel="stylesheet">
- <link href="http://static.example.com/lo_res.css" type="text/css" media="tv,projector" rel="stylesheet">
- <link href="http://static.example.com/newspaper.css" type="text/css" media="print" rel="stylesheet">
+ <link href="http://static.example.com/pretty.css" media="screen" rel="stylesheet">
+ <link href="http://static.example.com/lo_res.css" media="tv,projector" rel="stylesheet">
+ <link href="http://static.example.com/newspaper.css" media="print" rel="stylesheet">
+
+.. versionchanged:: 4.1
+
+ In older versions, the ``type="text/css"`` attribute is included in CSS
+ links.
``js``
------
@@ -145,8 +150,8 @@ example above::
>>> w = FancyCalendarWidget()
>>> print(w.media)
- <link href="http://static.example.com/pretty.css" type="text/css" media="all" rel="stylesheet">
- <link href="http://static.example.com/fancy.css" type="text/css" media="all" rel="stylesheet">
+ <link href="http://static.example.com/pretty.css" media="all" rel="stylesheet">
+ <link href="http://static.example.com/fancy.css" media="all" rel="stylesheet">
<script src="http://static.example.com/animations.js"></script>
<script src="http://static.example.com/actions.js"></script>
<script src="http://static.example.com/whizbang.js"></script>
@@ -165,7 +170,7 @@ an ``extend=False`` declaration to the ``Media`` declaration::
>>> w = FancyCalendarWidget()
>>> print(w.media)
- <link href="http://static.example.com/fancy.css" type="text/css" media="all" rel="stylesheet">
+ <link href="http://static.example.com/fancy.css" media="all" rel="stylesheet">
<script src="http://static.example.com/whizbang.js"></script>
If you require even more control over inheritance, define your assets using a
@@ -228,7 +233,7 @@ was ``None``::
>>> w = CalendarWidget()
>>> print(w.media)
- <link href="/css/pretty.css" type="text/css" media="all" rel="stylesheet">
+ <link href="/css/pretty.css" media="all" rel="stylesheet">
<script src="http://uploads.example.com/animations.js"></script>
<script src="http://othersite.com/actions.js"></script>
@@ -236,7 +241,7 @@ But if :setting:`STATIC_URL` is ``'http://static.example.com/'``::
>>> w = CalendarWidget()
>>> print(w.media)
- <link href="/css/pretty.css" type="text/css" media="all" rel="stylesheet">
+ <link href="/css/pretty.css" media="all" rel="stylesheet">
<script src="http://static.example.com/animations.js"></script>
<script src="http://othersite.com/actions.js"></script>
@@ -245,7 +250,7 @@ Or if :mod:`~django.contrib.staticfiles` is configured using the
>>> w = CalendarWidget()
>>> print(w.media)
- <link href="/css/pretty.css" type="text/css" media="all" rel="stylesheet">
+ <link href="/css/pretty.css" media="all" rel="stylesheet">
<script src="https://static.example.com/animations.27e20196a850.js"></script>
<script src="http://othersite.com/actions.js"></script>
@@ -268,12 +273,12 @@ operator to filter out a medium of interest. For example::
>>> w = CalendarWidget()
>>> print(w.media)
- <link href="http://static.example.com/pretty.css" type="text/css" media="all" rel="stylesheet">
+ <link href="http://static.example.com/pretty.css" media="all" rel="stylesheet">
<script src="http://static.example.com/animations.js"></script>
<script src="http://static.example.com/actions.js"></script>
>>> print(w.media['css'])
- <link href="http://static.example.com/pretty.css" type="text/css" media="all" rel="stylesheet">
+ <link href="http://static.example.com/pretty.css" media="all" rel="stylesheet">
When you use the subscript operator, the value that is returned is a
new ``Media`` object -- but one that only contains the media of interest.
@@ -300,7 +305,7 @@ specified by both::
>>> w1 = CalendarWidget()
>>> w2 = OtherWidget()
>>> print(w1.media + w2.media)
- <link href="http://static.example.com/pretty.css" type="text/css" media="all" rel="stylesheet">
+ <link href="http://static.example.com/pretty.css" media="all" rel="stylesheet">
<script src="http://static.example.com/animations.js"></script>
<script src="http://static.example.com/actions.js"></script>
<script src="http://static.example.com/whizbang.js"></script>
@@ -356,7 +361,7 @@ are part of the form::
>>> f = ContactForm()
>>> f.media
- <link href="http://static.example.com/pretty.css" type="text/css" media="all" rel="stylesheet">
+ <link href="http://static.example.com/pretty.css" media="all" rel="stylesheet">
<script src="http://static.example.com/animations.js"></script>
<script src="http://static.example.com/actions.js"></script>
<script src="http://static.example.com/whizbang.js"></script>
@@ -375,8 +380,8 @@ CSS for form layout -- add a ``Media`` declaration to the form::
>>> f = ContactForm()
>>> f.media
- <link href="http://static.example.com/pretty.css" type="text/css" media="all" rel="stylesheet">
- <link href="http://static.example.com/layout.css" type="text/css" media="all" rel="stylesheet">
+ <link href="http://static.example.com/pretty.css" media="all" rel="stylesheet">
+ <link href="http://static.example.com/layout.css" media="all" rel="stylesheet">
<script src="http://static.example.com/animations.js"></script>
<script src="http://static.example.com/actions.js"></script>
<script src="http://static.example.com/whizbang.js"></script>