| 45 | NB Production sites who wish to compile their code either need to hardcode the theme name in their {{{views/layout.html}}} or upgrade to Web2Py version: 2.00.0 (2012-06-17 23:36:32), or newer. |
| 46 | |
| 47 | === Simple modifications === |
| 48 | 1. Add all CSS overrides to a file: {{{/static/themes/<themename>/style.css}}} |
| 49 | 1. Copy css.cfg from skeletontheme to your template folder: {{{/modules/templates/<templatename>/css.cfg}}} |
| 50 | 1. Add {{{../themes/<templatename>/style.css}}} to the end of the file |
| 51 | 1. Build: {{{static/scripts/tools/build.sahana.py}}} |
| 52 | |
| 53 | e.g. to just change the menu logo, add this to style.css (assuming the new logo is in {{{/static/themes/<themename>/img/logo.png}}}): |
| 54 | {{{ |
| 55 | .S3menulogo { |
| 56 | background: url(img/logo.png) left top no-repeat; |
| 57 | } |
| 58 | }}} |
| 59 | |
| 60 | == Complex modifications === |
| 61 | Need to work with SCSS, ideally using Compass. |
| 62 | {{{ |
| 63 | compass --compile |
| 64 | }}} |
| 65 | |
| 66 | === Ext Theme === |
| 67 | Use [http://www.codebeautifier.com CodeBeautifier] to merge the {{{ext-all-notheme.css}}} with {{{xtheme-gray.css}}} (merges properties on the same selectors which most minifiers don't): |
| 68 | * {{{static/scripts/ext/resources/css/ext-theme.min.css}}} |
| 69 | Can also use this to merge a custom theme, e.g. built with http://extbuilder.dynalias.com or this Eclipse plugin: http://spket.com/ext-theme-builder.html |
| 70 | |
| 71 | === Customizing Form Design by Theme === |
72 | | NB Production sites who wish to compile their code either need to hardcode the theme name in their {{{views/layout.html}}} or upgrade to Web2Py version: 2.00.0 (2012-06-17 23:36:32), or newer. |
73 | | |
74 | | === Ext Theme === |
75 | | Use [http://www.codebeautifier.com CodeBeautifier] to merge the {{{ext-all-notheme.css}}} with {{{xtheme-gray.css}}} (merges properties on the same selectors which most minifiers don't): |
76 | | * {{{static/scripts/ext/resources/css/ext-theme.min.css}}} |
77 | | Can also use this to merge a custom theme, e.g. built with http://extbuilder.dynalias.com or this Eclipse plugin: http://spket.com/ext-theme-builder.html |
78 | | |
79 | | === Customizing Form Design by Theme === |
80 | | By default, all form fields have their uniq divs like that {{{<div class="form-row row" id="org_organisation_phone__row">}}} In this example, we will put Organization Home Country field next to Organization Type field. |
81 | | |
82 | | Add these css code to your css file here /static/themes/MYTHEME/style.css: {{{#org_organisation_link_defaultorganisation_type__row, #org_organisation_country__row {display:inline-block;float:left}}}} |
83 | | |
84 | | That's it. |
| 103 | e.g. To put the Organization Home Country field next to the Organization Type field, add this CSS code to your css file here /static/themes/MYTHEME/style.css: |
| 104 | {{{ |
| 105 | #org_organisation_link_defaultorganisation_type__row, #org_organisation_country__row {display:inline-block;float:left} |
| 106 | }}} |