This component is used to display a list of key facts. This block of facts communicates important facts about a course, for instance, and is prominently positioned at the top of a page.
This component accepts an array of “facts” which is output as a description list in one to three columns dependent upon device.
Each fact consists of:
"facts": [
{
"term": "Delivery type",
"data": [
{
"content": "On campus"
},
{
"content": "Virtual"
},
...
]
},
...
]
{% if facts.length > 0 %}
<div class="uol-key-facts">
<div class="uol-content-container">
<div class="uol-col-container uol-col-container--key-facts">
<dl class="uol-key-facts__list">
{% for fact in facts %}
<div class="uol-key-facts__group">
<dt class="uol-key-facts__term">{{ fact.term }}</dt>
{% for data in fact.data %}
<dd class="uol-key-facts__data">{{ data.content | safe }}</dd>
{% endfor %}
</div>
{% endfor %}
</dl>
</div>
</div>
</div>
{% endif %}
<div class="uol-key-facts">
<div class="uol-content-container">
<div class="uol-col-container uol-col-container--key-facts">
<dl class="uol-key-facts__list">
<div class="uol-key-facts__group">
<dt class="uol-key-facts__term">UCAS</dt>
<dd class="uol-key-facts__data">L700</dd>
</div>
<div class="uol-key-facts__group">
<dt class="uol-key-facts__term">Start date</dt>
<dd class="uol-key-facts__data">September 2023</dd>
</div>
<div class="uol-key-facts__group">
<dt class="uol-key-facts__term">Delivery type</dt>
<dd class="uol-key-facts__data">On campus</dd>
</div>
<div class="uol-key-facts__group">
<dt class="uol-key-facts__term">Duration</dt>
<dd class="uol-key-facts__data">3 years full time</dd>
</div>
<div class="uol-key-facts__group">
<dt class="uol-key-facts__term">Work placement</dt>
<dd class="uol-key-facts__data">Optional</dd>
</div>
<div class="uol-key-facts__group">
<dt class="uol-key-facts__term">Study abroad</dt>
<dd class="uol-key-facts__data">Optional</dd>
</div>
<div class="uol-key-facts__group">
<dt class="uol-key-facts__term">Typical A-level offer</dt>
<dd class="uol-key-facts__data">AAB - ABB (specific subjects required)</dd>
</div>
<div class="uol-key-facts__group">
<dt class="uol-key-facts__term">Typical Access to Leeds offer</dt>
<dd class="uol-key-facts__data">ABB or BBB (including an accepted subject) plus a pass in the Access to Leeds scheme (specific subjects required).</dd>
</div>
</dl>
</div>
</div>
</div>
.uol-key-facts {
background-color: $color-brand-2--light;
/*
TODO: width fix for fitting in to course pages incorporating scroll bar
Do more robust solution whereby scrollbar width is calculated via using client width
*/
width: 100%;
position: relative;
left: 50%;
right: 50%;
margin-left: -50%;
margin-right: -50%;
margin-bottom: $spacing-7;
@include media(">=uol-media-l") {
width: calc(100vw - 9px);
position: relative;
margin-left: -50vw;
margin-right: -50vw;
}
}
.uol-key-facts__list {
@extend .text-size-paragraph;
font-variant-numeric: lining-nums;
padding: 0;
margin: $spacing-5 #{$spacing-4 / 2};
width: 100%;
@include media(">=uol-media-s", "<uol-media-l") {
columns: 2;
column-gap: $spacing-4;
margin: $spacing-5 calc((1 / 12) * 100% + #{$spacing-2});
}
@include media(">=uol-media-l") {
columns: 3;
margin: $spacing-4 #{$spacing-5 / 2};
column-gap: $spacing-5;
}
@include media(">=uol-media-xl") {
margin: 2.25rem calc((1 / 12) * 100% + #{$spacing-6 / 2}) 2.25rem #{$spacing-6 / 2};
column-gap: calc((100% + #{$spacing-6}) / 11 + #{$spacing-6});
}
}
.uol-key-facts__group {
break-inside: avoid;
margin-bottom: $spacing-4;
// background-color: rgba(#0FF, 0.3);
&:last-child {
// margin-bottom: 0;
}
@include media(">=uol-media-l") {
margin: 0;
padding: $spacing-3 0;
}
}
.uol-key-facts__term {
font-weight: $font-weight-bold--sans-serif;
color: $color-font--dark;
}
.uol-key-facts__data {
margin-left: 0;
}
// Temp to fix alignment, there is probably better way to do this.
.uol-col-container--key-facts {
[class*=uol-col-] & {
margin: 0;
}
@include media(">=uol-media-l") {
padding: 1rem 1.5rem;
}
}
{
"facts": [
{
"term": "UCAS",
"data": [
{
"content": "L700"
}
]
},
{
"term": "Start date",
"data": [
{
"content": "September 2023"
}
]
},
{
"term": "Delivery type",
"data": [
{
"content": "On campus"
}
]
},
{
"term": "Duration",
"data": [
{
"content": "3 years full time"
}
]
},
{
"term": "Work placement",
"data": [
{
"content": "Optional"
}
]
},
{
"term": "Study abroad",
"data": [
{
"content": "Optional"
}
]
},
{
"term": "Typical A-level offer",
"data": [
{
"content": "AAB - ABB (specific subjects required)"
}
]
},
{
"term": "Typical Access to Leeds offer",
"data": [
{
"content": "ABB or BBB (including an accepted subject) plus a pass in the Access to Leeds scheme (specific subjects required)."
}
]
}
]
}