Skip to content

Commit

Permalink
No longer include richtext block css fix
Browse files Browse the repository at this point in the history
As of Wagtail 2.10, the rich-text class is not added to richtext divs so this
extra css is unecessary.
  • Loading branch information
mikemonteith committed Aug 16, 2021
1 parent 47e1066 commit 25ac947
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 45 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
wagtail_nhsuk_frontend.egg-info
wagtailnhsukfrontend/static/wagtailnhsukfrontend/css/wagtail-nhsuk-frontend.min.css
testapp/db.sqlite3
testapp/media/images
__pycache__
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,22 @@ See the [component documentation](./docs/components/) for a list of components y

Include the CSS in your base template
```html
<link rel="stylesheet" type="text/css" href="{% static 'wagtailnhsukfrontend/css/wagtail-nhsuk-frontend.min.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'wagtailnhsukfrontend/css/nhsuk.min.css' %}">
```

Include the Javascript in your base template
```html
<script type="text/javascript" src="{% static 'wagtailnhsukfrontend/js/nhsuk-4.1.0.min.js' %}" defer></script>
<script type="text/javascript" src="{% static 'wagtailnhsukfrontend/js/nhsuk.min.js' %}" defer></script>
```
## Upgrading

If you are upgrading from v0 to v1, see the [changelog](./CHANGELOG.md).

## Contributing
This CSS and JS is taken directly from the [nhsuk-frontend library](https://github.com/nhsuk/nhsuk-frontend/releases/tag/v5.1.0) and provided in this package for convenience.

If you have a more complicated frontend build such as compiling your own custom styles, you might want to [install from npm](https://github.com/nhsuk/nhsuk-frontend/blob/master/docs/installation/installing-with-npm.md) instead.

## Contributing

See the [contributing documentation](./docs/contributing.md) to run the application locally and contribute changes.

Expand Down
14 changes: 4 additions & 10 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,13 @@ Whilst in the `wagtail-nhsuk-frontend` directory:
pipenv shell
```

### 3. Build the application CSS

```
python3 setup.py build
```

### 4. Install dependencies
### 3. Install dependencies

```
pipenv install -e .[testing,linting]
```

### 5. Run database migrations for the test app
### 4. Run database migrations for the test app
```
cd testapp
```
Expand All @@ -48,13 +42,13 @@ cd testapp
python3 manage.py migrate
```

### 6. Create Wagtail admin user
### 5. Create Wagtail admin user

```
python3 manage.py createsuperuser
```

### 7. Start a local server
### 6. Start a local server

```
python3 manage.py runserver 8080
Expand Down
21 changes: 0 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from distutils.command.build import build
from setuptools import setup, find_packages

with open("README.md", "r") as fh:
Expand All @@ -21,27 +20,7 @@
]


class CompileCSSCommand(build):
"""Combine CSS from the frontend library with our wagtail-specific fixes"""

def run(self):
filepath_base = 'wagtailnhsukfrontend/static/wagtailnhsukfrontend/css/'
filenames = [
'nhsuk-5.1.0.min.css',
'fixes.css',
]

with open(filepath_base + 'wagtail-nhsuk-frontend.min.css', 'w') as outfile:
for fname in filenames:
with open(filepath_base + fname) as infile:
for line in infile:
outfile.write(line)


setup(
cmdclass={
'build': CompileCSSCommand,
},
name="wagtail-nhsuk-frontend",
version="1.0.0",
description="NHSUK Frontend Styles for Wagtail",
Expand Down
4 changes: 2 additions & 2 deletions testapp/testapp/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
<link rel="stylesheet" type="text/css" href="{% static 'css/testapp.css' %}">

{# NHSUK CSS library #}
<link rel="stylesheet" type="text/css" href="{% static 'wagtailnhsukfrontend/css/wagtail-nhsuk-frontend.min.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'wagtailnhsukfrontend/css/nhsuk.min.css' %}">

{# NHSUK JS library #}
<script type="text/javascript" src="{% static 'wagtailnhsukfrontend/js/nhsuk-5.1.0.min.js' %}" defer></script>
<script type="text/javascript" src="{% static 'wagtailnhsukfrontend/js/nhsuk.min.js' %}" defer></script>

{% block extra_css %}
{# Override this in templates to add extra stylesheets #}
Expand Down

This file was deleted.

Large diffs are not rendered by default.

0 comments on commit 25ac947

Please sign in to comment.