summaryrefslogtreecommitdiffstats
path: root/fedoratheme/kindofblue/browser/stylesheets/README.txt
blob: 4bfb295f646a896aa0098e7b620ac187b8e157d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
README for the 'browser/stylesheets/' directory
===============================================

This folder is a Zope 3 Resource Directory acting as a repository for
stylesheets.

Its declaration is located in 'browser/configure.zcml':

    <!-- Resource directory for stylesheets -->
    <browser:resourceDirectory
        name="fedoratheme.kindofblue.stylesheets"
        directory="stylesheets"
        layer=".interfaces.IThemeSpecific"
        />

A stylesheet placed in this directory (e.g. 'main.css') can be accessed from
this relative URL:

    "++resource++fedoratheme.kindofblue.stylesheets/main.css"

Note that it might be better to register each of these resources separately if
you want them to be overridable from zcml directives.

The only way to override a resource in a resource directory is to override the
entire directory (all elements have to be copied over).

A Zope 3 browser resource declared like this in 'browser/configure.zcml':

    <browser:resource
        name="main.css"
        file="stylesheets/main.css"
        layer=".interfaces.IThemeSpecific"
        />

can be accessed from this relative URL:

    "++resource++main.css"

Notes
-----

* Stylesheets registered as Zope 3 resources might be flagged as not found in
  the 'portal_css' tool if the layer they are registered for doesn't match the
  default skin set in 'portal_skins'.
  This can be confusing but it must be considered as a minor bug in the CSS
  registry instead of a lack in the way Zope 3 resources are handled in
  Zope 2.

* There might be a way to interpret DTML from a Zope 3 resource view.
  Although, if you need to use DTML for setting values in a stylesheet (the
  same way as in default Plone stylesheets where values are read from
  'base_properties'), it is much easier to store it in a directory that is
  located in the 'skins/' folder of your package, registered as a File System
  Directory View in the 'portal_skins' tool, and added to the layers of your
  skin.

* Customizing/overriding stylesheets that are originally accessed from the
  'portal_skins' tool (e.g. Plone default stylesheets) can be done inside that
  tool only. There is no known way to do it with Zope 3 browser resources.
  Vice versa, there is no known way to override a Zope 3 browser resource from
  a skin layer in 'portal_skins'.