Skip to content

Commit

Permalink
Merge pull request #19 from ministryofjustice/add-sass
Browse files Browse the repository at this point in the history
Add sass via npm to compile stylesheets
  • Loading branch information
MatMoore authored Jan 25, 2024
2 parents 4166849 + 63ded2a commit b599e5e
Show file tree
Hide file tree
Showing 15 changed files with 11,235 additions and 177 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,6 @@ cython_debug/
#static files dirs
staticfiles/

local.py
local.py

node_modules
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
## Quick start

Project contains a poetry dependency file for installation with `poetry install`
To run `poetry run python manage.py runserver`
You will need npm (for javascript dependencies) and poetry (for python dependencies).

## Configuration
1. Run `poetry install` to install python dependencies
2. Set environment variables CATALOGUE_URL and CATALOGUE_TOKEN (TODO: add dotenv support)
3. Run `poetry run python manage.py runserver`

The following should be set using environment variables:

- CATALOGUE_URL
- CATALOGUE_TOKEN
Run `npm install` and then `npm run sass` to compile the stylesheets.

## Current Endpoints

Expand Down
251 changes: 251 additions & 0 deletions package-lock.json

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

10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"dependencies": {
"@ministryofjustice/frontend": "^2.0.1",
"govuk-frontend": "^5.0.0",
"sass": "^1.70.0"
},
"scripts": {
"sass": "sass --load-path=. scss:static/assets/css"
}
}
8 changes: 8 additions & 0 deletions scss/base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$govuk-assets-path: '/static/';
$moj-assets-path: '/static';

// Removes need to put classes on all elements
$govuk-global-styles: true;

@import "node_modules/govuk-frontend/dist/govuk/all";
@import "node_modules/@ministryofjustice/frontend/moj/all";
31 changes: 31 additions & 0 deletions scss/search.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.search-container {
display: flex;
}
.search-icon {
height: 100%;
}

.search-button {
background: #1d70b8;
border: 0;
color: #fff;
cursor: pointer;
height: 40px;
margin-bottom: 0;
padding: 0;
width: 40px;
}

.govuk-input.search-input {
border-right-width: 0;
}

.search-button:focus {
box-shadow: inset 0 0 0 4px #0b0c0c;
outline: 3px solid #fd0
}

.search-input:focus {
border-right-width: 2px;
z-index: 1
}
2 changes: 0 additions & 2 deletions static/assets/css/all.min.css

This file was deleted.

Loading

0 comments on commit b599e5e

Please sign in to comment.