Skip to content

Commit

Permalink
Use Dart Sass (#101)
Browse files Browse the repository at this point in the history
This changes our SASS build to use the Dart Sass implementation. As part
of this, we bundle the GDS styles plus our own additions into a single
file - site.css.

We also apply govuk-link to all a elements and govuk-body to all p
elements by default.
  • Loading branch information
gunndabad authored Sep 6, 2022
1 parent 21a1879 commit 4e0dce2
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 62 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ jobs:
dotnet tool install -g dotnet-format --version "6.*" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json
dotnet-format --verify-no-changes
- name: Install SASS
run: npm install -g sass

- name: Build
run: dotnet build --configuration Release

Expand Down
3 changes: 2 additions & 1 deletion dotnet-authserver/src/TeacherIdentity.AuthServer/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
wwwroot/lib
wwwroot/Styles/*.css
wwwroot/Styles/*.css
wwwroot/Styles/*.css.map
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@
<govuk-panel-body>
@if (Model.GotTrn)
{
<p class="govuk-body" data-testid="known-trn-content">Thank you, weve finished checking our records.</p>
<p data-testid="known-trn-content">Thank you, weve finished checking our records.</p>
}
else
{
<span data-testid="unknown-trn-content"></span>
<h2 class="govuk-heading-m">You can continue without a match</h2>
<p class="govuk-body">We will attempt to match your record again. If we cannot, someone might be in touch to ask for more information.</p>
<p>We will attempt to match your record again. If we cannot, someone might be in touch to ask for more information.</p>
}

<h2 class="govuk-heading-m">Next time</h2>
<p class="govuk-body govuk-!-margin-bottom-6">Next time, you can skip these questions by signing in with your email address: <b>@Model.Email</b></p>
<p class="govuk-!-margin-bottom-6">Next time, you can skip these questions by signing in with your email address: <b>@Model.Email</b></p>

@{
await RenderForm("app-button--inverse govuk-!-margin-bottom-0");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<div class="govuk-grid-column-two-thirds-from-desktop">
<h1 class="govuk-heading-xl">Confirm your email address</h1>

<p class="govuk-body">We’ve emailed a confirmation code to <span data-testid="email">@Model.Email</span></p>
<p>We’ve emailed a confirmation code to <span data-testid="email">@Model.Email</span></p>

<govuk-input asp-for="Code" input-class="govuk-!-width-one-quarter" pattern="[0-9]*" inputmode="numeric" autocomplete="one-time-code">
<govuk-input-label class="govuk-label--s" />
</govuk-input>

<p>
<a href="#" class="govuk-body govuk-link">I have not received an email</a>
<a href="#">I have not received an email</a>
</p>

<govuk-button type="submit">Continue</govuk-button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@page "/sign-in/trn"
@page "/sign-in/trn"
@model TeacherIdentity.AuthServer.Pages.SignIn.TrnModel
@{
ViewBag.Title = "We’ll ask you some questions to check against our records";
Expand All @@ -8,15 +8,15 @@
<govuk-panel-title>We’ll ask you some questions to check against our records</govuk-panel-title>

<govuk-panel-body>
<p class="govuk-body">We’ll ask for your:</p>
<p>We’ll ask for your:</p>
<ul class="govuk-list govuk-list--bullet">
<li>name</li>
<li>date of birth</li>
<li>National Insurance number, if you have one</li>
<li>teacher reference number (TRN)</li>
</ul>

<p class="govuk-body govuk-!-margin-bottom-6">
<p class="govuk-!-margin-bottom-6">
If you do not have your TRN or National Insurance number available, we may ask some follow-up questions.
</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>TeacherIdentityServer</UserSecretsId>
<EnableDefaultSassItems>false</EnableDefaultSassItems>
</PropertyGroup>

<ItemGroup>
<SassFile Include="wwwroot/Styles/**/*.scss" />
</ItemGroup>
<Target Name="CompileSass" BeforeTargets="Build">
<Exec Command="sass -q wwwroot/Styles/site.scss wwwroot/Styles/site.css" />
</Target>

<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="6.0.2" />
Expand All @@ -23,7 +22,6 @@
<PackageReference Include="Hangfire.PostgreSql" Version="1.9.8" />
<PackageReference Include="idunno.Authentication.Basic" Version="2.2.3" />
<PackageReference Include="Joonasw.AspNetCore.SecurityHeaders" Version="4.0.1" />
<PackageReference Include="LibSassBuilder" Version="2.0.2" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.7" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@{
@{
ViewBag.Title = "Sorry, there is a problem with the service";
}

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">Sorry, there is a problem with the service</h1>
<p class="govuk-body">Try again later.</p>
<p>Try again later.</p>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
@{
@{
ViewBag.Title = "Page not found";
}

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">Page not found</h1>
<p class="govuk-body">
<p>
If you typed the web address, check it is correct.
</p>
<p class="govuk-body">
<p>
If you pasted the web address, check you copied the entire address.
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<link rel="apple-touch-icon" sizes="152x152" href="/assets/images/govuk-apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" href="/assets/images/govuk-apple-touch-icon.png">

@Html.Raw(GovUk.Frontend.AspNetCore.HtmlSnippets.StyleImports)
<link rel="stylesheet" asp-href-include="~/Styles/*.css">

<meta property="og:image" content="/assets/images/govuk-opengraph-image.png">
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,55 @@
@use '../lib/govuk-frontend/govuk/all.scss';
@import '../lib/govuk-frontend/govuk/_base.scss';
@import '../lib/govuk-frontend/govuk/settings/measurements.scss';

a {
@extend %govuk-link;
}

p {
@extend .govuk-body;
}

.app-panel--interruption {
background-color: govuk-colour("blue");
color: govuk-colour("white");
text-align: left;

p,
.govuk-heading-m,
.govuk-list,
.govuk-body,
.govuk-label,
.govuk-fieldset__legend,
.govuk-hint {
color: govuk-colour("white");
}

p {
margin-bottom: 20px;
}

.govuk-heading-m {
padding-top: 10px;
}

*:last-child {
margin-bottom: 0;
}

.govuk-radios__label::before,
& ::after {
color: govuk-colour("black");
border-color: govuk-colour("black");
background-color: govuk-colour("white");
}

@include govuk-media-query(desktop) {
> * {
width: map_get($govuk-grid-widths, two-thirds);
}
}
}

$app-button-shadow-size: $govuk-border-width-form-element;
$app-button-inverse-background-colour: govuk-colour("white");
Expand Down Expand Up @@ -31,3 +82,4 @@ $app-button-inverse-hover-background-colour: govuk-tint($app-button-inverse-fore
background-color: $app-button-inverse-hover-background-colour;
box-shadow: inset 0 0 0 2px $govuk-focus-colour;
}

0 comments on commit 4e0dce2

Please sign in to comment.