├── .gitignore ├── LICENSE ├── MANIFEST.in ├── README.rst ├── facelift.png ├── setup.py └── wagtailfacelift ├── __init__.py ├── static └── css │ └── facelift.css └── wagtail_hooks.py /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | *.pyc 3 | *.pyo 4 | .installed.cfg 5 | bin 6 | .idea/ 7 | develop-eggs 8 | node_modules 9 | .DS_Store 10 | /.venv/ 11 | dist/ 12 | /local/ 13 | /docs/_build/ 14 | *.pyc 15 | 16 | 17 | # dist 18 | downloads 19 | eggs 20 | parts 21 | *.egg-info 22 | lib64 23 | *.log 24 | *.pot 25 | static/CACHE/* 26 | .anaconda 27 | *.sass-cache 28 | .coverage 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Springload Limited 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 10 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | include README.md 3 | recursive-include wagtailfacelift/static * 4 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | **!! WARNING: This repo isn't maintained anymore !!** 2 | 3 | Overriding Wagtail CSS isn't sustainable and makes upgrading to a newer version more difficult. 4 | Designers are now more closely involved with the development of Wagtail (e.g. see the `Streamfield UI Changes `_) so we are confident that hacks like this project are no longer needed. 5 | 6 | Wagtail Facelift 7 | ================ 8 | 9 | Drop-in CSS enhancements for Wagtail's Streamfield. Pure CSS overrides, there's no extra configuration. 10 | 11 | Check out `Awesome Wagtail `_ for more awesome packages and resources from the Wagtail community. 12 | 13 | .. image:: ./facelift.png 14 | :target: https://pypi.python.org/pypi/wagtailfacelift 15 | 16 | Installation 17 | ------------ 18 | 19 | .. code:: sh 20 | 21 | pip install git+https://github.com/springload/wagtailfacelift.git 22 | 23 | 24 | Add the application to your installed apps: 25 | 26 | .. code:: python 27 | 28 | INSTALLED_APPS = [ 29 | 'wagtail', 30 | 'wagtailfacelift' 31 | ] 32 | 33 | 34 | --- 35 | 36 | Extra theming 37 | ------------- 38 | 39 | `.multi-field-dark` 40 | 41 | Apply this class to your widget for a subtle background shift, eg: 42 | 43 | .. code:: python 44 | 45 | MultiFieldPanel([ 46 | StreamFieldPanel('heroes'), 47 | ], 48 | heading="Homepage Heroes", 49 | classname="collapsible collapsed multi-field-dark" 50 | ) 51 | 52 | 53 | Enjoy! 54 | 55 | -------------------------------------------------------------------------------- /facelift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/springload/wagtailfacelift/503303f3f2b33e4d541267846e093872915eb012/facelift.png -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | from setuptools import find_packages, setup 3 | 4 | with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: 5 | README = readme.read() 6 | 7 | # allow setup.py to be run from any path 8 | os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) 9 | 10 | setup( 11 | name='wagtailfacelift', 12 | version='0.1.0', 13 | packages=find_packages(), 14 | include_package_data=True, 15 | license='BSD License', 16 | description='Facelift for Wagtail streamfields.', 17 | long_description=README, 18 | url='https://github.com/springload/wagtailfacelift', 19 | author='Josh Barr', 20 | author_email='josh@springload.co.nz', 21 | classifiers=[ 22 | 'Environment :: Web Environment', 23 | 'Intended Audience :: Developers', 24 | 'License :: OSI Approved :: BSD License', 25 | 'Operating System :: OS Independent', 26 | 'Programming Language :: Python', 27 | 'Programming Language :: Python :: 2', 28 | 'Programming Language :: Python :: 2.7', 29 | 'Programming Language :: Python :: 3', 30 | 'Programming Language :: Python :: 3.3', 31 | 'Programming Language :: Python :: 3.4', 32 | 'Programming Language :: Python :: 3.5', 33 | 'Framework :: Django', 34 | 'Framework :: Django :: 1.8', 35 | 'Framework :: Django :: 1.9', 36 | 'Topic :: Internet :: WWW/HTTP :: Site Management', 37 | ], 38 | ) 39 | -------------------------------------------------------------------------------- /wagtailfacelift/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/springload/wagtailfacelift/503303f3f2b33e4d541267846e093872915eb012/wagtailfacelift/__init__.py -------------------------------------------------------------------------------- /wagtailfacelift/static/css/facelift.css: -------------------------------------------------------------------------------- 1 | /* ========================================================================== *\ 2 | Wagtail Admin CSS overrides 3 | \* ========================================================================== */ 4 | 5 | /* ------------------------------ *\ 6 | Layout: full width admin 7 | \* ------------------------------ */ 8 | 9 | .wrapper { 10 | max-width: 100% !important; 11 | } 12 | 13 | .content { 14 | /*padding-bottom: 0 !important;*/ 15 | /*margin-bottom: 0 !important;*/ 16 | } 17 | 18 | .object fieldset { 19 | max-width: 100%; 20 | width: 100% !important; 21 | } 22 | 23 | 24 | /* ------------------------------- *\ 25 | General cosmetic improvements 26 | \* ------------------------------- */ 27 | 28 | /* Dirty hack to scope these to non-login pages. */ 29 | 30 | body:not(.login) .full input, 31 | body:not(.login) .full textarea, 32 | body:not(.login) .full .richtext { 33 | padding-top: 1rem !important; 34 | padding-bottom: 1rem !important; 35 | padding-left: 25px !important; 36 | padding-right: 25px !important; 37 | } 38 | 39 | @media only screen and (min-width: 50em) { 40 | footer { 41 | width: calc(100% - 280px) !important; 42 | margin-left: 50px !important; 43 | margin-right: 50px !important; 44 | } 45 | } 46 | 47 | 48 | @media only screen and (min-width: 50em) { 49 | label { 50 | display: inline-block; 51 | } 52 | } 53 | 54 | /* More refined corner radius */ 55 | 56 | input, 57 | textarea, 58 | select, 59 | .richtext, 60 | .tagit { 61 | border-radius: 3px !important; 62 | } 63 | 64 | 65 | /* ========================================================================== *\ 66 | Streamfield overrides 67 | \* ========================================================================== */ 68 | 69 | .struct-block { 70 | border: solid 1px rgba(0, 0, 0, 0.16); 71 | padding: 0; 72 | box-shadow: 0 2px 3px rgba(0,0,0, 0.12); 73 | margin-bottom: 2rem; 74 | border-radius: .25rem; 75 | background: #fff; 76 | } 77 | 78 | /* Fix clearfixing of structs */ 79 | 80 | .struct-block:after { 81 | content: ""; 82 | display: table; 83 | clear: both; 84 | } 85 | 86 | .sequence-member-inner.sequence-member-inner > .field { 87 | padding: 1rem 0; 88 | } 89 | 90 | .sequence .sequence > .sequence-member > .sequence-member-inner > .field { 91 | padding-left: 1rem; 92 | box-shadow: 0 2px 3px rgba(0,0,0,0.12); 93 | border: solid 1px rgba(0, 0, 0, 0.16); 94 | border-radius: 3px; 95 | margin-bottom: 1rem; 96 | } 97 | 98 | .sequence .sequence > .sequence-member:nth-child(odd) .sequence-member-inner > .field { 99 | background: rgba(0, 0, 0, 0.02); 100 | } 101 | 102 | li.sequence-member .sequence-member-inner { 103 | padding: 0 !important; 104 | } 105 | 106 | li.sequence-member .struct-block .fields { 107 | width: 100% !important; 108 | } 109 | 110 | li.sequence-member .struct-block .sequence-container { 111 | width: 83.333333% !important; 112 | display: inline-block; 113 | } 114 | 115 | li.sequence-member .fields > li { 116 | padding: .75rem 1rem; 117 | } 118 | 119 | li.sequence-member .fields > li:nth-child(odd) { 120 | background: rgba(0,0,0,0.02); 121 | } 122 | 123 | li.sequence-member .fields > li:last-child { 124 | border-bottom-width: 0 !important; 125 | } 126 | 127 | .block_field.stream-field > .block_widget > .field-content { 128 | width: 100% !important; 129 | } 130 | 131 | /* Undo hovers on streamfields */ 132 | 133 | li.sequence-member:hover { 134 | border-color: transparent !important; 135 | background-color: transparent !important; 136 | } 137 | 138 | .sequence-member input { 139 | background-color: #fff; 140 | } 141 | 142 | .struct-block .sequence-container { 143 | padding-bottom: 1rem !important; 144 | } 145 | 146 | 147 | /* ------------------------------ *\ 148 | Streamfield menu 149 | \* ------------------------------ */ 150 | 151 | .stream-menu { 152 | background-color: #F2FDFD !important; 153 | box-shadow: none !important; 154 | border: solid 1px rgba(67, 177, 176, 0.31); 155 | } 156 | 157 | .stream-menu-closed { 158 | border-width: 0 !important; 159 | } 160 | 161 | .stream-menu li button { 162 | color: #358c8b; 163 | } 164 | 165 | .stream-menu li button:hover, 166 | .stream-menu li button:focus { 167 | color: #fff; 168 | } 169 | 170 | 171 | /* ========================================================================== *\ 172 | Misc fixes 173 | \* ========================================================================== */ 174 | 175 | .chooser .unchosen:before, 176 | .chooser .chosen:before { 177 | float: none !important; 178 | display: inline-block !important; 179 | } 180 | 181 | .inEditMode { 182 | margin-top: 2.75rem; 183 | padding-top: 1rem !important; 184 | padding-bottom: 1rem !important; 185 | } 186 | 187 | .hallotoolbar { 188 | margin-top: -.5rem !important; 189 | margin-left: 0 !important; 190 | font-size: 12px !important; 191 | } 192 | 193 | .sequence-member .field.widget-rich_text_area .field-content { 194 | width: 96% !important; 195 | } 196 | 197 | /* ========================================================================== *\ 198 | Theming 199 | \* ========================================================================== */ 200 | 201 | /* 202 | `.multi-field-dark` 203 | =================== 204 | 205 | Apply this class to your widget for a subtle background shift, eg: 206 | 207 | MultiFieldPanel([ 208 | StreamFieldPanel('heroes'), 209 | ], 210 | heading="Homepage Heroes", 211 | classname="collapsible collapsed multi-field-dark" 212 | ) 213 | */ 214 | 215 | .multi-field-dark { 216 | background: #F0F3F5; 217 | border-bottom: solid 1px #DADFE2; 218 | } 219 | 220 | .multi-field-dark.collapsed { 221 | border-bottom-width: 0; 222 | } 223 | 224 | .multi-field-dark > h2 { 225 | border-bottom: solid 1px rgba(0,0,0,0.1); 226 | } 227 | -------------------------------------------------------------------------------- /wagtailfacelift/wagtail_hooks.py: -------------------------------------------------------------------------------- 1 | from django.utils.html import format_html 2 | from django.contrib.staticfiles.templatetags.staticfiles import static 3 | from wagtail.wagtailcore import hooks 4 | 5 | 6 | @hooks.register('insert_global_admin_css') 7 | def global_admin_css(): 8 | html = ''.format(path=static('css/facelift.css')) 9 | return format_html(html) 10 | --------------------------------------------------------------------------------