[Twisted-web] CSS

Tristan Seligmann mithrandi at mithrandi.net
Tue Jun 7 02:40:20 EDT 2011

On Mon, Jun 6, 2011 at 8:18 AM, pylix pythonne <pylixx at gmail.com> wrote:
> I've been trying vehemently to apply an external CSS to a nevow live element
> template i've created.
> putting a reference for it in the head doesn't allow it to be found i'm
> hosting the server on local host with the command:
> twistd -n athena -widget --element=foo.bar

I would suggest moving away from athena-widget for running your app.
That way you can define your own resource structure, including serving
up the static CSS files you want to include from <head>.

> I've had a breif look at the source and it seems it has a cssmodule as well
> as
> a autopackage method for css

You could probably use this as well. The system works pretty much the
same as the way the JS modules system works; you need to set a
cssModule (class) attribute on your widget, and define your CSS
"packages" in more or less the same way you have your JS "packages"
laid out. I haven't used this system at all, and probably wouldn't
recommend it for general use; it encourages having your CSS broken up
into lots of small per-widget fragments, but for a consistent look and
feel to your application, you really want to be doing styling at the
"global" level. (Others may have a different opinion on the subject)
mithrandi, i Ainil en-Balandor, a faer Ambar

More information about the Twisted-web mailing list