diff options
| author | Claude Paroz <claude@2xlibre.net> | 2022-01-21 15:46:37 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2022-01-22 16:38:14 +0100 |
| commit | 7c4f3965098baad2396e24501e09237425a7bd6f (patch) | |
| tree | 278ceb3d95a513df3d74941eeb46b927a04224a3 /docs/topics/forms | |
| parent | 9dc65263d47a5b8857492c10ce151bab83cfe672 (diff) | |
Stopped including type="text/css" attributes for CSS link tags.
Diffstat (limited to 'docs/topics/forms')
| -rw-r--r-- | docs/topics/forms/media.txt | 37 |
1 files changed, 21 insertions, 16 deletions
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> |
