#11129 closed enhancement (fixed)
Handle CSS as text/css type — at Version 5
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.2 |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | ethan.jucovy@…, Christian Boos, olemis+trac@… | Branch: | |
Release Notes: | |||
API Changes: |
CSS templates are transferred with the proper content type. |
||
Internal Changes: |
Description
I have a plugin that implements IRequestHandler
and returns CSS from process_request
like:
def process_request(self, req): myColors = [ ('a', '#3a3'), ('b', '#fff'), ('c', '#ada'), ('d', '#888') ] ... return 'myplugin.css', {'myColors': myColors}, 'text/css'
but the CSS doesn't get the correct mime type without patching chrome.py
as attached.
Change History (7)
by , 11 years ago
Attachment: | chrome.diff added |
---|
follow-up: 2 comment:1 by , 11 years ago
Cc: | added |
---|
This would be helpful for me too — I also have a plugin that renders CSS from a template using a request handler, which doesn't work properly without this patch.
follow-up: 3 comment:2 by , 10 years ago
This seems harmless enough. Any objections?
Replying to ethan.jucovy@…:
This would be helpful for me too — I also have a plugin that renders CSS from a template using a request handler, which doesn't work properly without this patch.
Which plugin? I'd just like to take a look at an example use-case.
comment:3 by , 10 years ago
Replying to rjollos:
Which plugin? I'd just like to take a look at an example use-case.
th:LighterTheme, which currently has a configuration option for the primary font-family. My workaround is to render the template to a string with mimetype text/plain
, and then to send the string with content-type text/css
using req.send
.
comment:4 by , 10 years ago
Milestone: | next-dev-1.1.x → 1.1.2 |
---|---|
Owner: | set to |
Status: | new → assigned |
Thanks. I will use your plugin to do some testing before committing the change.
comment:5 by , 10 years ago
API Changes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
I've attached a patch for the th:LighterTheme that seems to work well after the change to Trac.
Committed to trunk in [12418].
Patch to fix mime type of style sheets