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

Various fixes, remove text details #44

Merged
merged 1 commit into from
Nov 6, 2023
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
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Initial concept of text detail elements
- Elements can be hidden on certain devices with `tna-!--hide-on-[large|medium|small|tiny]`
- Allow links to have no visited state with `tna-link--no-visited-state`
- Card supertitles can be made "plain" with no contrasting colour
Expand All @@ -22,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Update the `spacing` and `spacing-mobile` functions in `spacing` to `space` and `space-mobile`
- Mixin `colour.invert` changed to `colour.contrast`
- Background colour classes changed to BEM (`tna-background--accent` -> `tna-background-accent`)
- Text balance on headings removed but left on headings with links
- `background-tint` colour changed for better accessibility/contrast

### Deprecated
### Removed
Expand All @@ -31,6 +32,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Cookie banner URL is now correctly used
- Spacing above picture elements fixed
- Image widths fixed (not stretched)

### Security

Expand Down
7 changes: 4 additions & 3 deletions src/nationalarchives/components/picture/picture.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
@use "../button";

.tna-picture {
margin: 0;
padding: 0;

@include spacing.space-above;
margin-right: 0;
margin-bottom: 0;
margin-left: 0;
padding: 0;

&__image-wrapper {
position: relative;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ SceneSetterSmall.args = {
text: `We are the official archive of England and Wales. Discover 1,000 years of history through <a href="#">fascinating stories</a> from the past or <a href="#">start your own research</a> and <a href="#">search our catalogue</a> of 32 million records. <a href="#">Plan a visit</a> to access original historic documents from our collections then enjoy the grounds, café, and <a href="#">free exhibitions</a>.`,
};

const TextDetailsTemplate = () =>
`<p>
Typed slip with photographs - 'The <span class="tna-detail" title="Italian (miscellaneous)" data-type="misc">Italian</span> Steamer <span class="tna-detail" title="Aida Lauro (person)" data-type="per">Aida Lauro</span> which ran on the rocks near <span class="tna-detail" title="Cape Cornwall (location)" data-type="loc">Cape Cornwall</span> a few days ago is now a total wreck. After a severe buffeting by heavy seas the ship has broken in two. The photograph shows the <span class="tna-detail" title="Aida Lauro (person)" data-type="per">Aida Lauro</span> broken in two by a severe buffeting from the seas near <a href="#" class="tna-detail" title="Cape Cornwall (location)" data-type="loc">Cape Cornwall</a>.
</p>`;
export const TextDetails = TextDetailsTemplate.bind({});
// const TextDetailsTemplate = () =>
// `<p>
// Typed slip with photographs - 'The <span class="tna-detail" title="Italian (miscellaneous)" data-type="misc">Italian</span> Steamer <span class="tna-detail" title="Aida Lauro (person)" data-type="per">Aida Lauro</span> which ran on the rocks near <span class="tna-detail" title="Cape Cornwall (location)" data-type="loc">Cape Cornwall</span> a few days ago is now a total wreck. After a severe buffeting by heavy seas the ship has broken in two. The photograph shows the <span class="tna-detail" title="Aida Lauro (person)" data-type="per">Aida Lauro</span> broken in two by a severe buffeting from the seas near <a href="#" class="tna-detail" title="Cape Cornwall (location)" data-type="loc">Cape Cornwall</a>.
// </p>`;
// export const TextDetails = TextDetailsTemplate.bind({});

const BlockquoteTemplate = ({
html,
Expand Down
1 change: 1 addition & 0 deletions src/nationalarchives/utilities/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ picture,
video,
canvas {
max-width: 100%;
height: auto;

display: block;
}
Expand Down
63 changes: 31 additions & 32 deletions src/nationalarchives/utilities/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,46 +135,46 @@ small {
);
}

.tna-detail[title][data-type] {
padding: 0 0.375rem;
// .tna-detail[title][data-type] {
// padding: 0 0.375rem;

display: inline-flex;
flex-flow: row nowrap;
align-items: baseline;
gap: 0.5rem;
// display: inline-flex;
// flex-flow: row nowrap;
// align-items: baseline;
// gap: 0.5rem;

vertical-align: baseline;
// vertical-align: baseline;

background-color: #ccc;
// background-color: #ccc;

&::after {
@include colour.colour-font("font-base");
@include typography.detail-font-small;
vertical-align: baseline;
// &::after {
// @include colour.colour-font("font-base");
// @include typography.detail-font-small;
// vertical-align: baseline;

content: attr(data-type) / "";
}
// content: attr(data-type) / "";
// }

&[data-type="misc"] {
background-color: #f28482;
}
// &[data-type="misc"] {
// background-color: #f28482;
// }

&[data-type="loc"] {
background-color: #edae49;
}
// &[data-type="loc"] {
// background-color: #edae49;
// }

&[data-type="per"] {
background-color: #b5e2fa;
}
// &[data-type="per"] {
// background-color: #b5e2fa;
// }

@at-root #{selector.unify("a", &)} {
@include colour.colour-font("font-base");
// @at-root #{selector.unify("a", &)} {
// @include colour.colour-font("font-base");

&::after {
text-decoration: none;
}
}
}
// &::after {
// text-decoration: none;
// }
// }
// }

.tna-chip-list {
@include spacing.space-above;
Expand Down Expand Up @@ -245,12 +245,11 @@ small {
%heading {
@include colour.colour-font("font-dark");

text-wrap: balance;

&:not(.tna-heading--no-link-arrow) {
a {
display: inline-block;

text-wrap: balance;
// text-decoration-thickness: .1em;

&::after {
Expand Down
2 changes: 1 addition & 1 deletion src/nationalarchives/variables/_colour.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ LIGHT THEME (DEFAULT)
*/
$colour-palette-default: (
"page-background": #f4f4f4,
"background-tint": #d8d8d8,
"background-tint": #e2e2e2,
"font-base": $base-font,
"font-dark": brand-colour("black"),
"font-light": hex-to-rgb($base-font, 0.7),
Expand Down