Skip to content

Commit

Permalink
Add SASS to AuthorizeAccess project (#1261)
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad authored Apr 4, 2024
1 parent 7454321 commit e848e83
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wwwroot/lib
wwwroot/Styles/*.css
wwwroot/Styles/*.css.map
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
new JsonSerializerOptions() { WriteIndented = true });
}

@section Head {
@section Styles {
<style type="text/css" asp-add-nonce="true">
.claims-json {
font-family: monospace !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
ViewBag.ServiceName = "OIDC Sample";
}

@section Head {
@RenderSection("Head", required: false)
@section Styles {
@RenderSection("Styles", required: false)
}

@section Scripts {
@RenderSection("Scripts", required: false)
}

@if (User.Identity?.IsAuthenticated == true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@

@section Head {
<meta name="robots" content="noindex">
@RenderSection("Head", required: false)
@PageTemplateHelper.GenerateStyleImports()
<link rel="stylesheet" asp-href-include="~/Styles/*.css">
@RenderSection("Styles", required: false)
@RenderSection("Scripts", required: false)
}

@section Header {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

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

<ItemGroup>
<PackageReference Include="GovUk.Frontend.AspNetCore" />
<PackageReference Include="GovUk.OneLogin.AspNetCore" />
<PackageReference Include="Joonasw.AspNetCore.SecurityHeaders" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" />
<PackageReference Include="Microsoft.Web.LibraryManager.Build" />
<PackageReference Include="OpenIddict.AspNetCore" />
<PackageReference Include="Sentry.AspNetCore" />
<PackageReference Include="Serilog.AspNetCore" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": "1.0",
"defaultProvider": "jsdelivr",
"libraries": [
{
"library": "[email protected]",
"destination": "wwwroot/lib/govuk-frontend/"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import '../lib/govuk-frontend/govuk/all.scss';

0 comments on commit e848e83

Please sign in to comment.