More updates

This commit is contained in:
2024-07-12 23:35:29 -04:00
parent c10125b41d
commit ef9b937d2e
36 changed files with 1311 additions and 12020 deletions

View File

@@ -2,7 +2,7 @@
- var lang = "en-uk"
- var colorpfx = "colour"
- var headings = ["What is it", "When to use it", "How to use it"]
- var root = "."
- var generateColourToken = ["colours"]
-
var content = [
@@ -75,21 +75,18 @@
},
{
name: "in-progress",
color: "var(--color-oj)",
color: "#f0b031",
},
{
name: "complete",
color: "var(--color-lime)",
color: "#2e51a1",
},
{
name: "deprecated",
color: "var(--color-raspberry)",
color: "#da2c5b",
},
]
- var generateSCSS = ["colours"]
-
var colours = [
{ name: "Blue",
@@ -125,4 +122,5 @@
]
},
}
]
]

View File

@@ -1,62 +0,0 @@
//- This file is used to generate ../scss/_core.scss and will overwrite what is in that include.
include _config
include _color-samples
-var out = ""
-
out = `/* Core Code
This file is generates _core.scss using information in ../pg/_config.pug.
Please make your changes in your _config.pug file so that they are not
overwritten. \n */\n\n\n`
- out += `//colour tokens\n$${colorpfx}: (`
each val in generateColourToken
- out += generateSCSS(eval(val), colorpfx)
//- var scss = $colors
| !{generateSCSS(eval(val), colorpfx)}
- out += ");\n:root {\n\t@each $name, $color in $" + colorpfx + " {\n\t\t--#{$name}: #{$color};\n\t}\n}"
//- This is the end of the statuses
- out += "\n\n\n// Statuses\n$statuses: (\n"
each status in statuses || []
- out += `\t"${status.name}": ${status.color},\n`
-out += ");"
-
out += `\n\nh1[class^="status"], h2[class^="status"], span[class^="status"] {
&::after {
$size: 1.5rem;
border-radius: 50%;
border: 1px solid #CCC;
content: " ";
display: inline-block;
height: $size;
margin-left: .5rem;
position: relative;
top: 2px;
width: $size;
}
}
@each $name, $color in $statuses {
.status-#{$name}::after {
background-color: $color;
}
}`
//- / This is the end of the statuses
- out += "\n\n//! / Core Code\n\n"
| !{out}

View File

@@ -192,7 +192,7 @@ mixin accessibility-info(c)
mixin color-samples(colors, theid)
mixin colour-samples(colors, theid)
color-samples
- let css = [];
- let scss = [];

View File

@@ -0,0 +1,246 @@
@mixin core-colour-samples {
#copystatus {
left: 50%;
position: absolute;
z-index: 100;
div {
border-radius: 1rem;
border: 1px solid green;
left: -50%;
padding: 1rem;
position: relative;
white-space: nowrap;
&::after {
clear: both;
content: " ";
display: block;
}
&.succeeded {
background-color: white;
border-color: black;
color: black;
}
&.failed {
background-color: white;
border-color: #f00;
color: #f00;
}
}
}
color-samples {
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 1rem;
margin-bottom: 1rem;
@include break(-lg) {
display: grid;
grid-template-columns: repeat(2, 1fr);
max-width: 100%;
width: 100%;
}
@include break(-sm) {
grid-template-columns: auto;
width: 100%;
max-width: 100%;
}
color-sample {
align-items: center;
border-radius: .5rem;
border: 1px solid #CCC;
display: grid;
font-family: inherit;
gap: .5rem;
grid-template-areas: "name name name hex hex hex"
"name name name rgb rgb rgb"
"acc acc acc acc acc acc"
"lighter lighter lighter darker darker darker"
"notes notes notes notes notes notes";
grid-template-columns: repeat(6, 1fr);
grid-template-rows: repeat(2, 1.5rem) 10rem repeat(3, max-content); // 3rem repeat(2, 2rem) 1.5rem repeat(3, max-content);
padding: 1rem;
width: 20rem;
max-width: 318px;
@include break(-lg) {
width: 100%;
max-width: 100%;
}
name {
align-self: start;
font-size: 1.25rem;
grid-area: name;
span {
cursor: pointer;
}
}
rgb {
grid-area: rgb;
white-space: nowrap;
}
hex {
grid-area: hex;
white-space: nowrap;
}
> accessibility {
border-bottom: 1px solid #ccc;
border-top: 1px solid #ccc;
}
accessibility {
grid-area: acc;
grid-row: 3;
padding: .5rem 0;
display: grid;
gap: .5rem;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: 2.5rem repeat(2, max-content);
.result {
align-items: center;
border-radius: .5rem;
display: grid;
grid-template-columns: repeat(2, 1fr);
border: 1px solid #ccc;
padding: 0 1rem;
text-align: center;
&.accwaa, &.accwaaa {
background-color: white;
color: black;
}
&.accbaa, &.accbaaa {
background-color: black;
color: white;
}
span:nth-child(2) {
font-size: 2rem;
}
}
.aa, .aaa {
align-self: center;
display: block;
font-size: .75rem;
}
.acchb {
grid-column: 2;
}
.acchb, .acchw {
display: grid;
grid-tempate-columns: auto;
grid-template-rows: repeat(2, max-content);
align-self: start;
text-align: center;
padding: 0;
span {
grid-row: 1;
grid-column: 1 / -1;
font-size: .9rem;
}
small {
text-align: center;
grid-row: 2;
grid-column: 1 / -1;
font-size: .75rem;
}
}
}
sample-block {
align-self: start;
grid-column: span 3;
grid-row: 4;
color-pill {
display: grid;
grid-gap: .5rem;
grid-template-columns: 20px max-content auto;
:nth-child(1) {
align-self: center;
border-radius: 5px;
border: 1px solid #CCC;
display: inline-block;
height: 10px;
width: 20px;
}
span {
cursor: pointer;
.tooltip-tc {
padding: .5rem;
width: 20rem;
max-width: 318px;
height: 10.5rem;
display: grid;
gap: .5rem;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(3, max-content);
.result {
align-items: center;
border-radius: .5rem;
display: grid;
grid-template-columns: repeat(2, 1fr);
border: 1px solid #ccc;
padding: 0 1rem;
text-align: center;
&.accwaa, &.accwaaa {
background-color: white;
color: black;
}
&.accbaa, &.accbaaa {
background-color: black;
color: white;
}
span{ border: none;
&:nth-child(2) {
font-size: 2rem;
}
}
}
.aa, .aaa {
align-self: center;
display: block;
font-size: .75rem;
}
.acchb {
grid-column: 2;
}
.acchb, .acchw {
border: none;
display: block;
width: 100%;
place-self: stretch;
span {
border: none;
font-size: .9rem;
width: 100%;
&::after, &::before {
display: none;
}
}
small {
font-size: .75rem;
text-align: center;
}
}
}
}
}
}
notes {
border-top: 1px solid #ccc;
grid-column: 1 / -1;
padding-top: .5rem;
}
}
}
}

View File

@@ -1,4 +1,4 @@
include _config
include ../_config
block config
- var getDate = function(){

View File

@@ -1,4 +1,4 @@
include _config
include ../_config
block config
mixin h(h)

311
src/pg/core/core.scss.pug Normal file
View File

@@ -0,0 +1,311 @@
//- This file is used to generate ../scss/_core.scss and will overwrite what is in that include.
-
var out = `// DS2 core (c) 2024 Alexander McIlwraith\n// Licensed under CC BY-SA 4.0 \n\n\n/* Core Code\n
This file is generates _core.scss using information in ../pg/_config.pug.
Please make your changes in your _config.pug file so that they are not
overwritten. \n*/\n\n\n`
include ../_config
include _colour-samples
-
out +=`@mixin core-colour-samples {
#copystatus {
left: 50%;
position: absolute;
z-index: 100;
div {
border-radius: 1rem;
border: 1px solid green;
left: -50%;
padding: 1rem;
position: relative;
white-space: nowrap;
&::after {
clear: both;
content: " ";
display: block;
}
&.succeeded {
background-color: white;
border-color: black;
color: black;
}
&.failed {
background-color: white;
border-color: #f00;
color: #f00;
}
}
}
color-samples {
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 1rem;
margin-bottom: 1rem;
@include break(-lg) {
display: grid;
grid-template-columns: repeat(2, 1fr);
max-width: 100%;
width: 100%;
}
@include break(-sm) {
grid-template-columns: auto;
width: 100%;
max-width: 100%;
}
color-sample {
align-items: center;
border-radius: .5rem;
border: 1px solid #CCC;
display: grid;
font-family: inherit;
gap: .5rem;
grid-template-areas: "name name name hex hex hex"
"name name name rgb rgb rgb"
"acc acc acc acc acc acc"
"lighter lighter lighter darker darker darker"
"notes notes notes notes notes notes";
grid-template-columns: repeat(6, 1fr);
grid-template-rows: repeat(2, 1.5rem) 10rem repeat(3, max-content); // 3rem repeat(2, 2rem) 1.5rem repeat(3, max-content);
padding: 1rem;
width: 20rem;
max-width: 318px;
@include break(-lg) {
width: 100%;
max-width: 100%;
}
name {
align-self: start;
font-size: 1.25rem;
grid-area: name;
span {
cursor: pointer;
}
}
rgb {
grid-area: rgb;
white-space: nowrap;
}
hex {
grid-area: hex;
white-space: nowrap;
}
> accessibility {
border-bottom: 1px solid #ccc;
border-top: 1px solid #ccc;
}
accessibility {
grid-area: acc;
grid-row: 3;
padding: .5rem 0;
display: grid;
gap: .5rem;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: 2.5rem repeat(2, max-content);
.result {
align-items: center;
border-radius: .5rem;
display: grid;
grid-template-columns: repeat(2, 1fr);
border: 1px solid #ccc;
padding: 0 1rem;
text-align: center;
&.accwaa, &.accwaaa {
background-color: white;
color: black;
}
&.accbaa, &.accbaaa {
background-color: black;
color: white;
}
span:nth-child(2) {
font-size: 2rem;
}
}
.aa, .aaa {
align-self: center;
display: block;
font-size: .75rem;
}
.acchb {
grid-column: 2;
}
.acchb, .acchw {
display: grid;
grid-tempate-columns: auto;
grid-template-rows: repeat(2, max-content);
align-self: start;
text-align: center;
padding: 0;
span {
grid-row: 1;
grid-column: 1 / -1;
font-size: .9rem;
}
small {
text-align: center;
grid-row: 2;
grid-column: 1 / -1;
font-size: .75rem;
}
}
}
sample-block {
align-self: start;
grid-column: span 3;
grid-row: 4;
color-pill {
display: grid;
grid-gap: .5rem;
grid-template-columns: 20px max-content auto;
:nth-child(1) {
align-self: center;
border-radius: 5px;
border: 1px solid #CCC;
display: inline-block;
height: 10px;
width: 20px;
}
span {
cursor: pointer;
.tooltip-tc {
padding: .5rem;
width: 20rem;
max-width: 318px;
height: 10.5rem;
display: grid;
gap: .5rem;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(3, max-content);
.result {
align-items: center;
border-radius: .5rem;
display: grid;
grid-template-columns: repeat(2, 1fr);
border: 1px solid #ccc;
padding: 0 1rem;
text-align: center;
&.accwaa, &.accwaaa {
background-color: white;
color: black;
}
&.accbaa, &.accbaaa {
background-color: black;
color: white;
}
span{ border: none;
&:nth-child(2) {
font-size: 2rem;
}
}
}
.aa, .aaa {
align-self: center;
display: block;
font-size: .75rem;
}
.acchb {
grid-column: 2;
}
.acchb, .acchw {
border: none;
display: block;
width: 100%;
place-self: stretch;
span {
border: none;
font-size: .9rem;
width: 100%;
&::after, &::before {
display: none;
}
}
small {
font-size: .75rem;
text-align: center;
}
}
}
}
}
}
notes {
border-top: 1px solid #ccc;
grid-column: 1 / -1;
padding-top: .5rem;
}
}
}
}`
- out += `\n\n//colour tokens\n$${colorpfx}: (`
each val in generateColourToken
- out += generateSCSS(eval(val), colorpfx)
//- var scss = $colors
| !{generateSCSS(eval(val), colorpfx)}
- out += ");\n:root {\n\t@each $name, $color in $" + colorpfx + " {\n\t\t--#{$name}: #{$color};\n\t}\n}"
//- This is the end of the statuses
- out += "\n\n\n// Statuses\n$statuses: (\n"
each status in statuses || []
- out += `\t"${status.name}": ${status.color},\n`
-out += ");"
-
out += `\n\nh1[class^="status"], h2[class^="status"], span[class^="status"] {
&::after {
$size: 1.5rem;
border-radius: 50%;
border: 1px solid #CCC;
content: " ";
display: inline-block;
height: $size;
margin-left: .5rem;
position: relative;
top: 2px;
width: $size;
}
}
@each $name, $color in $statuses {
.status-#{$name}::after {
background-color: $color;
}
}`
//- / This is the end of the statuses
- out += "\n\n//! / Core Code\n\n"
| !{out}

View File

@@ -1,4 +1,4 @@
extends _master-index.pug
extends core/_master-index.pug
block config

View File

@@ -1,7 +1,7 @@
extends ../../_master-pattern
extends ../../core/_master-pattern
block content
include ../../_color-samples
include ../../core/_colour-samples
h2 Primary colours
+color-samples(colours, "colors")
+colour-samples(colours, "colors")

View File

@@ -1,4 +1,4 @@
extends ../../../_master-pattern.pug
extends ../../../core/_master-pattern.pug
block content
+h(0)
+h(1)

View File

@@ -3,9 +3,9 @@
@use "sass:math";
$switch-accent: #2e51a1 !default; // switch background when switched right (on/ true)
$switch-background: #e9e9ea !default; // switch background when switched left (off / false)
$switch-color: #ffffff !default; // the colour of the switch
$switch-accent: var(--colour-blue) !default; // switch background when switched right (on/ true)
$switch-background: var(--colour-grey-xl) !default; // switch background when switched left (off / false)
$switch-color: var(--colour-white) !default; // the colour of the switch
$switch-height: 1.5rem !default;
@mixin switch {

View File

@@ -1,4 +1,4 @@
extends ../../../_master-pattern.pug
extends ../../../core/_master-pattern.pug
block content

View File

@@ -1,8 +1,8 @@
[role=switch] {
display: -ms-inline-grid;
display: inline-grid;
border: 1px solid #2e51a1;
background-color: #e9e9ea;
border: 1px solid var(--colour-blue);
background-color: var(--colour-grey-xl);
border-radius: 0.75rem;
height: 1.5rem;
width: 3rem;
@@ -19,7 +19,7 @@
transition: all 500ms;
}
[role=switch][aria-checked=true] {
background-color: #2e51a1;
background-color: var(--colour-blue);
}
[role=switch][aria-checked=true] > span {
margin-left: calc(1.5rem - 5%);

View File

@@ -1,4 +1,4 @@
extends ../../../_master-pattern.pug
extends ../../../core/_master-pattern.pug
block content

View File

@@ -1,4 +1,4 @@
extends ../../../_master-pattern.pug
extends ../../../core/_master-pattern.pug
block content

View File

@@ -1,7 +1,7 @@
//- DS2 core (c) 2024 Alexander McIlwraith
//- Licensed under CC BY-SA 4.0
$header-bg-color: var(--color-grey-xl) !default;
$header-bg-color: var(--colour-grey-xxl) !default;
$font-heading: sans-serif !default;
$font-weight: 700 !default;

View File

@@ -22,7 +22,7 @@ header svg text {
font-size: 10rem;
font-weight: 1000;
font-family: sans-serif;
fill: var(--color-grey-xl);
fill: var(--colour-grey-xxl);
}
header > div {
-ms-grid-row: 2;

View File

@@ -1,4 +1,4 @@
extends ../../../_master-pattern.pug
extends ../../../core/_master-pattern.pug
block content

View File

@@ -1,49 +0,0 @@
$font-body: sans-serif !default;
@mixin table {
table:not([role="presentation"]) {
border-collapse: collapse;
border-top: 2px solid var(--color-grey);
margin: 0 0 1rem 0;
caption {
font-family: $font-body;
font-family: 1.25rem;
}
thead {
tr {
td, th {
border-bottom: 1px solid var(--color-grey);
border-right: 1px solid var(--color-white);
background-color: var(--color-grey-xxl);
font-family: $font-body;
font-weight: bold;
padding: .25rem .5rem;
&:last-of-type {
border-right: none;
}
}
}
}
tbody {
tr {
td {
border-bottom: 1px solid var(--color-grey-xl);
border-right: 1px solid var(--color-grey-xl);
font-family: $font-body;
padding: .25rem .5rem;
&:last-of-type {
border-right: none;
}
}
&:last-child td {
border-bottom: 1px solid var(--color-grey);
}
}
+ caption {
font-family: $font-body;
font-size: .9rem;
caption-side: bottom;
}
}
}
}

View File

@@ -1,9 +1,9 @@
//- DS2 core (c) 2024 Alexander McIlwraith
//- Licensed under CC BY-SA 4.0
// DS2 core (c) 2024 Alexander McIlwraith
// Licensed under CC BY-SA 4.0
$tab-border: var(--color-grey) !default;
$tab-selected: var(--color-white) !default;
$tab-notselected: var(--color-grey-xxl) !default;
$tab-border: var(--colour-grey) !default;
$tab-selected: var(--colour-white) !default;
$tab-notselected: var(--colour-grey-xxl) !default;
@mixin tabs {
tabset, .tab-group {

View File

@@ -1,7 +1,7 @@
//- DS2 core (c) 2024 Alexander McIlwraith
//- Licensed under CC BY-SA 4.0
extends ../../../_master-pattern.pug
extends ../../../core/_master-pattern.pug
block content

View File

@@ -9,8 +9,8 @@ tabset > ul, .tab-group > ul {
padding: 0;
}
tabset > ul li.separator, .tab-group > ul li.separator {
border-bottom: 1px solid var(--color-grey);
border-left: 1px solid var(--color-grey);
border-bottom: 1px solid var(--colour-grey);
border-left: 1px solid var(--colour-grey);
display: inline-block;
margin: 0.45rem 0 0 0;
width: 100%;
@@ -19,9 +19,9 @@ tabset .tab-hidden, .tab-group .tab-hidden {
display: none;
}
tabset [role=tab], .tab-group [role=tab] {
background-color: var(--color-white);
border-left: 1px solid var(--color-grey);
border-top: 1px solid var(--color-grey);
background-color: var(--colour-white);
border-left: 1px solid var(--colour-grey);
border-top: 1px solid var(--colour-grey);
border-radius: 0.5rem 0.5rem 0 0;
cursor: pointer;
margin: 0;
@@ -30,19 +30,19 @@ tabset [role=tab], .tab-group [role=tab] {
z-index: 2;
}
tabset [role=tab]:last-of-type, .tab-group [role=tab]:last-of-type {
border-right: 1px solid var(--color-grey);
border-right: 1px solid var(--colour-grey);
}
tabset [role=tab]:not(.selected), .tab-group [role=tab]:not(.selected) {
background-color: var(--color-grey-xxl);
border-bottom: 1px solid var(--color-grey);
background-color: var(--colour-grey-xxl);
border-bottom: 1px solid var(--colour-grey);
}
tabset [role=tab] span, .tab-group [role=tab] span {
display: block;
margin: 0 0 0.5rem 0;
}
tabset [role=tabpanel], .tab-group [role=tabpanel] {
background-color: var(--color-white);
border: 1px solid var(--color-grey);
background-color: var(--colour-white);
border: 1px solid var(--colour-grey);
border-top: none;
padding: 1rem;
z-index: 1;

View File

@@ -1,4 +1,4 @@
extends ../../_master-pattern.pug
extends ../../core/_master-pattern.pug
block content
-