Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sass via npm to compile stylesheets #19

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading