Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
{% load wagtailcore_tags wagtailimages_tags %}
<div>
{# Section heading #}
<h2>{{ value.title }}</h2>

{# Section intro #}
<div>{{ value.intro|richtext }}</div>

{# Signposting cards #}
<ul>
{% for card in value.cards %}
<li class="{{ card.card_colour }}">
{% firstof card.heading card.page.title %}
{{ card.description|richtext }}
{% image card.image fill-100x100 %}
<a href="{% pageurl card.page %}">{{ card.link_text }}</a>
</li>
{% endfor %}
</ul>
<div class="grid division-signpost">
<div class="grid__division-signpost">
{# Section heading #}
{% if value.title %}
<h2 class="heading heading--two">{{ value.title }}</h2>
{% endif %}
{# Section intro #}
{% if value.intro %}
<p class="text text--five division-signpost__intro">{{ value.intro|richtext }}</p>
{% endif %}
{# Signposting cards #}
<ul class="division-signpost__cards">
{% for card in value.cards %}
<li class="division-signpost__card division-signpost__card--{{ card.card_colour }}">
<div class="division-signpost__text">
<h3 class="heading heading--two division-signpost__heading">{% firstof card.heading card.page.title %}</h3>
<p class="heading heading--four-b heading--light division-signpost__description">{{ card.description|richtext }}</p>
</div>
{% srcset_image card.image format-webp fill-{540x280,490x280} sizes="(max-width: 598px) 540px, (min-width: 599px) 490px" class="" alt="" %}
{# The title and icon need to be on the same line with no whitespace to prevent the arrow being orphaned on a new line #}
<a href="{% pageurl card.page %}" class="button-link button-link--{{ card.card_colour }}">{{ card.link_text }}&nbsp;{% include "patterns/atoms/icons/icon.html" with name="arrow-wide" classname="button-link__arrow" %}<span class="sr-only"> about {% firstof card.heading card.page.title %} division</span></a>
</li>
{% endfor %}
</ul>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
context:
value:
title: Our divisions
intro: We have three divisions, each with a unique focus and expertise
cards:
- card_colour: 'theme-coral'
heading: Charity
description: Amplify your impact, reach more supporters and transform your organisation with tailored digital strategies and solutions
link_text: Find out more
- card_colour: 'theme-nebuline'
heading: Public
description: Navigate complex challenges. Accelerate your mission and transform public services through digital
link_text: Find out more
- card_colour: 'theme-lagoon'
heading: Wagtail CMS services
description: Empower your editors and developers to do their best work with Wagtail, the world's leading open-source Python CMS.
link_text: Find out more

tags:
srcset_image:
'card.image format-webp fill-{540x280,490x280} sizes="(max-width: 598px) 540px, (min-width: 599px) 490px" class="" alt=""':
raw: |
<img alt="" class="" height="280" sizes="(max-width: 598px) 540px, (min-width: 599px) 490px" src="https://picsum.photos/540/280.webp" srcset="https://picsum.photos/540/280.webp 540w, https://picsum.photos/490/280.webp 490w" width="540">
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ <h4>Heading 4</h4>
</a>
</p>

<p class="mb-1 underline">Links styled as buttons</p>
<p class="mb-4" style="max-width: 300px">
<a class="mb-4 button-link button-link--theme-coral" href="#">Digital products&nbsp;{% include "patterns/atoms/icons/icon.html" with name="arrow-wide" classname="button-link__arrow" %}</a>
<a class="mb-4 button-link button-link--theme-nebuline" href="#">Digital products&nbsp;{% include "patterns/atoms/icons/icon.html" with name="arrow-wide" classname="button-link__arrow" %}</a>
<a class="mb-4 button-link button-link--theme-lagoon" href="#">Digital products&nbsp;{% include "patterns/atoms/icons/icon.html" with name="arrow-wide" classname="button-link__arrow" %}</a>
</p>

{# Buttons #}
<p class="mb-1 underline">Button</p>
<p class="mb-4"><a class="button" href="#">Digital products</a></p>
Expand Down
47 changes: 47 additions & 0 deletions tbx/static_src/sass/components/_button-link.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@use 'config' as *;

.button-link {
@include font-size('size-four');
@include high-contrast-text-decoration();
font-weight: $weight--semibold;
display: inline-block;
padding: $spacer-mini-plus $spacer-small;
text-align: center;
width: 100%;
color: var(--color--white);
transition: background-color $transition-quick;
// TODO: add default bg color for themed pages var(--color--accent) once color themes BE is ready

@include reduced-motion() {
transition: none;
}

&:hover {
color: var(--color--button-link-interaction);
background-color: var(--color--link-interaction);
}

&:focus {
@include focus-style();
}

&--theme-coral {
background-color: $color--coral-charity;
}

&--theme-nebuline {
background-color: $color--nebuline-public;
}

&--theme-lagoon {
background-color: $color--lagoon-wagtail;
}

&__arrow {
@include arrow-link-icon-styles(
$interaction-color: var(--color--button-link-interaction)
);
color: inherit;
margin-left: $spacer-mini-plus;
}
}
81 changes: 81 additions & 0 deletions tbx/static_src/sass/components/_division-signpost.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
@use 'config' as *;

.division-signpost {
margin-bottom: $spacer-large;

&__intro {
margin-bottom: $spacer-medium;
}

&__cards {
display: flex;
flex-wrap: wrap;
flex-direction: column;
gap: $spacer-mini-plus;

@include media-query(medium) {
flex-direction: row;
}
}

&__card {
flex-basis: 100%;
display: flex;
flex-direction: column;
transition: background-color $transition-quick;

@include media-query(medium) {
flex-basis: calc(50% - #{$spacer-mini-plus} * 0.5);
}

@include media-query(large) {
flex-basis: calc(33.33% - ($spacer-mini-plus * 2 / 3));
}

@include high-contrast-mode() {
border: 1px solid var(--color--text);
}

&--theme-coral {
background-color: var(--color--coral-charity);

&:has(.button-link:hover) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praise: This is one of my favourite things to come to CSS recently! So powerful : )

background-color: var(--color--coral-30);
}
}

&--theme-nebuline {
background-color: var(--color--nebuline-public);

&:has(.button-link:hover) {
background-color: var(--color--nebuline-30);
}
}

&--theme-lagoon {
background-color: var(--color--lagoon-wagtail);

&:has(.button-link:hover) {
background-color: var(--color--lagoon-30);
}
}
}

&__text {
padding: $spacer-medium $spacer-small $spacer-small;
margin-bottom: auto;

@include media-query(large) {
padding-top: $spacer-medium-plus;
}
}

&__heading {
color: var(--color--white);
margin-bottom: $spacer-mini;
}

&__description {
color: var(--color--white);
}
}
2 changes: 1 addition & 1 deletion tbx/static_src/sass/components/_featured-case-study.scss
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
}

&__icon {
@include arrow-link-icon-styles();
@include arrow-link-icon-styles($mobile-hidden: true);
margin-left: $spacer-mini-plus;
}

Expand Down
4 changes: 0 additions & 4 deletions tbx/static_src/sass/components/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@
&__arrow {
@include arrow-link-icon-styles();
color: var(--color--heading);
// Show static version on mobile screens
display: inline-block;
width: 72px;
height: 22px;
}

&__socials {
Expand Down
9 changes: 9 additions & 0 deletions tbx/static_src/sass/components/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,15 @@
}
}

&__division-signpost {
grid-column: 2 / span 4;
margin-bottom: $spacer;

@include media-query(large) {
grid-column: 2 / span 12;
}
}

// header and navigation grid elements
&__header-logo {
grid-column: 2 / span 2;
Expand Down
2 changes: 1 addition & 1 deletion tbx/static_src/sass/components/_icon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}

&--listing-arrow {
@include arrow-link-icon-styles();
@include arrow-link-icon-styles($mobile-hidden: true);
margin-left: $spacer-mini-plus;
}

Expand Down
2 changes: 1 addition & 1 deletion tbx/static_src/sass/components/_listing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
}

&__arrow {
@include arrow-link-icon-styles();
@include arrow-link-icon-styles($mobile-hidden: true);
margin-left: $spacer-mini-plus;
}

Expand Down
2 changes: 1 addition & 1 deletion tbx/static_src/sass/components/_showcase.scss
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
}

&--tail {
@include arrow-link-icon-styles();
@include arrow-link-icon-styles($mobile-hidden: true);
margin-left: $spacer-mini-plus;
margin-top: 0;
}
Expand Down
54 changes: 33 additions & 21 deletions tbx/static_src/sass/config/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -180,34 +180,43 @@
}

/* ============================================
Arrow icon styles - Hidden below medium breakpoint, shown above
Translates on hover
Arrow icon styles - Translates on hover
*/
@mixin arrow-link-icon-styles() {
display: none;
@mixin arrow-link-icon-styles(
$mobile-hidden: false,
$color: var(--color--decoration),
$interaction-color: var(--color--link-interaction)
) {
// Apply all common styles regardless of mobile-hidden
display: inline-block;
color: $color;
width: 72px;
height: 22px;
transition: transform, $transition-quick;

@include reduced-motion() {
transition: none;
}

@include media-query(medium) {
display: inline-block;
color: var(--color--decoration);
width: 72px;
height: 22px;
transition: transform, $transition-quick;
// If mobile-hidden is true, hide on mobile
@if $mobile-hidden {
display: none;

@include reduced-motion() {
transition: none;
@include media-query(medium) {
display: inline-block;
}
}

a:hover & {
color: var(--color--link-interaction);
transform: translateX(8px);
a:hover & {
color: $interaction-color;
transform: translateX(8px);

@include reduced-motion() {
transform: none;
}
@include reduced-motion() {
transform: none;
}

@include high-contrast-mode() {
color: var(--color--decoration);
}
@include high-contrast-mode() {
color: var(--color--decoration);
}
}
}
Expand Down Expand Up @@ -359,6 +368,7 @@
*/
@mixin button-styles() {
@include font-size('size-six');
@include high-contrast-text-decoration();
display: inline-block;
text-align: center;
border: 1px solid var(--color--link);
Expand All @@ -377,7 +387,9 @@
&:focus {
@include focus-style();
}
}

@mixin high-contrast-text-decoration() {
@include high-contrast-mode() {
text-decoration: underline;
text-decoration-thickness: $link-underline-thickness;
Expand Down
Loading
Loading