Skip to content

Commit

Permalink
Update TNA Frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Dec 10, 2024
1 parent f4da323 commit e583b01
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 49 deletions.
3 changes: 3 additions & 0 deletions layouts/_design-system-base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

{%- set siteTitle = "The National Archives Design System" -%}
{%- set pageTitle = title -%}
{%- set htmlAttributes = {
"data-tnacookiespath": "/design-system/"
} -%}

{% block head %}
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'self' https://fonts.googleapis.com https://use.typekit.net https://p.typekit.net https://tna.dblclk.dev 'unsafe-inline'; img-src 'self' https://www.nationalarchives.gov.uk https://fakeimg.pl https://picsum.photos https://fastly.picsum.photos https://asciinema.org https://tna.dblclk.dev data: https://nationalarchives.github.io/design-system/; font-src 'self' https://use.typekit.net https://fonts.gstatic.com">
Expand Down
4 changes: 1 addition & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import Prism from "prismjs";

window.TNAFrontend.initAll();

const cookies = new window.TNAFrontend.Cookies({
path: "/design-system/",
});
const cookies = new window.TNAFrontend.Cookies();

const setTheme = (theme) => {
if (theme === "light") {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"ext": "js css scss njk json html md"
},
"dependencies": {
"@nationalarchives/frontend": "^0.3.0",
"@nationalarchives/frontend": "^0.4.0",
"prismjs": "^1.29.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/gallery/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ group: components
{% from "partials/example.njk" import example %}
{% from "partials/component-status.njk" import status %}

{{ example({ group: "components", item: "gallery", example: "default", html: true, nunjucks: true, size: "xxxl", noPadding: true }, 2) }}
{{ example({ group: "components", item: "gallery", example: "default", html: true, nunjucks: true, size: "xxxl" }, 2) }}

{{ status(false, 1, 1, 2, 2, false) }}
27 changes: 0 additions & 27 deletions src/components/records-list/default/index.njk

This file was deleted.

13 changes: 0 additions & 13 deletions src/components/records-list/index.md

This file was deleted.

26 changes: 26 additions & 0 deletions src/cookies/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,29 @@ This site currently collects no usage data.
}
}) }}
</div>

## Cookies that are used for marketing purposes

These cookies may be set by third party websites and track things that can be used for marketing and advertising purposes.

This site currently collects no data for marketing purposes.

<p aria-live="assertive" class="tna-ds--show-on-js" data-showcookiepreference="marketing" data-showcookiepreferenceonaccepted="Cookies that can be used for marketing purposes have been accepted." data-showcookiepreferenceonrejected="Cookies that can be used for marketing purposes have been rejected."></p>

<div class="tna-button-group tna-ds--show-on-js">
{{ tnaButton({
text: "Allow marketing cookies",
buttonElement: true,
attributes: {
"data-setcookiepreference": "marketing",
"data-setcookiepreferencevalue": "true"
}
}) }} {{ tnaButton({
text: "Decline marketing cookies",
buttonElement: true,
attributes: {
"data-setcookiepreference": "marketing",
"data-setcookiepreferencevalue": "false"
}
}) }}
</div>
4 changes: 4 additions & 0 deletions src/styles/typography/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ You can use a larger paragraph as an introduction to the page or section.

{{ example({ group: "styles", item: "typography", example: "paragraphs-large", html: true, nunjucks: false, size: "xs", openHTML: true }) }}

There is also a slightly bolder version of the large paragraph.

{{ example({ group: "styles", item: "typography", example: "paragraphs-large-bold", html: true, nunjucks: false, size: "xs", openHTML: true }) }}

### Small

You can use the `<small>` element sparingly to make your paragraph font size smaller.
Expand Down
7 changes: 7 additions & 0 deletions src/styles/typography/paragraphs-large-bold/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Paragraphs large bold
layout: examples/plain.njk
private: true
---

<p class="tna-large-paragraph tna-large-paragraph--bold">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>

0 comments on commit e583b01

Please sign in to comment.