(self, *, attrs=None)
| 187 | ] |
| 188 | |
| 189 | def render_css(self, *, attrs=None): |
| 190 | # To keep rendering order consistent, we can't just iterate over |
| 191 | # items(). We need to sort the keys, and iterate over the sorted list. |
| 192 | media = sorted(self._css) |
| 193 | return chain.from_iterable( |
| 194 | [ |
| 195 | ( |
| 196 | path.render(attrs=attrs) |
| 197 | if isinstance(path, MediaAsset) |
| 198 | else ( |
| 199 | path.__html__() |
| 200 | if hasattr(path, "__html__") |
| 201 | else Stylesheet(path, media=medium).render(attrs=attrs) |
| 202 | ) |
| 203 | ) |
| 204 | for path in self._css[medium] |
| 205 | ] |
| 206 | for medium in media |
| 207 | ) |
| 208 | |
| 209 | def absolute_path(self, path): |
| 210 | """ |
nothing calls this directly
no test coverage detected