Skip to content

Commit

Permalink
Adding moj design system (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrlee authored Mar 17, 2021
1 parent db09442 commit 716fdfb
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 4 deletions.
1 change: 1 addition & 0 deletions assets/sass/application.sass
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ $govuk-global-styles: true
$path: "/assets/images/"

@import 'govuk/all'
@import 'moj/all'

@import './components/header-bar'
@import './local'
24 changes: 21 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"postinstall": "husky install",
"copy-views": "cp -R server/views dist/server/",
"compile-sass": "sass --no-source-map --load-path=node_modules/govuk-frontend ./assets/sass/application.sass:./assets/stylesheets/application.css ./assets/sass/application-ie8.sass:./assets/stylesheets/application-ie8.css --style compressed",
"compile-sass": "sass --no-source-map --load-path=node_modules/govuk-frontend --load-path=node_modules/@ministryofjustice/frontend ./assets/sass/application.sass:./assets/stylesheets/application.css ./assets/sass/application-ie8.sass:./assets/stylesheets/application-ie8.css --style compressed",
"watch-ts": "tsc -w",
"watch-views": "nodemon --watch server/views -e html,njk -x npm run copy-views",
"watch-node": "DEBUG=gov-starter-server* nodemon --watch dist/ dist/server.js | bunyan -o short",
Expand Down Expand Up @@ -84,6 +84,7 @@
]
},
"dependencies": {
"@ministryofjustice/frontend": "^0.2.1",
"agentkeepalive": "^4.1.4",
"applicationinsights": "^1.8.10",
"body-parser": "^1.19.0",
Expand Down
2 changes: 2 additions & 0 deletions server/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ export default function createApp(userService: UserService): express.Application
'/assets/js',
'/node_modules/govuk-frontend/govuk/assets',
'/node_modules/govuk-frontend',
'/node_modules/@ministryofjustice/frontend/moj/assets',
'/node_modules/@ministryofjustice/frontend',
'/node_modules/jquery/dist',
].forEach(dir => {
app.use('/assets', express.static(path.join(process.cwd(), dir), cacheControl))
Expand Down
2 changes: 2 additions & 0 deletions server/utils/nunjucksSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export default function nunjucksSetup(app: express.Application, path: pathModule
path.join(__dirname, '../../server/views'),
'node_modules/govuk-frontend/',
'node_modules/govuk-frontend/components/',
'node_modules/@ministryofjustice/frontend/',
'node_modules/@ministryofjustice/frontend/moj/components/',
],
{
autoescape: true,
Expand Down
1 change: 1 addition & 0 deletions server/views/partials/layout.njk
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@
<body>, to avoid blocking the initial render. #}
<script src="/assets/govuk/all.js"></script>
<script src="/assets/govukFrontendInit.js"></script>
<script src="/assets/moj/all.js"></script>
{% endblock %}

0 comments on commit 716fdfb

Please sign in to comment.