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

Remove comments and test compiled CSS #77

Merged
merged 5 commits into from
Jan 26, 2024
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
1 change: 0 additions & 1 deletion src/nationalarchives/components/card/card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
&__image-container {
height: 0;
margin-bottom: 1rem;
// padding-bottom: #{math.div(9, 16) * 100%};
padding-bottom: #{math.div(2, 3) * 100%};

position: relative;
Expand Down
11 changes: 0 additions & 11 deletions src/nationalarchives/components/hero/hero.scss
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@
}

&--tint .tna-hero__figure {
// @include colour.colour-border("keyline-dark", 1px, solid, top);
// @include colour.colour-border("keyline-dark", 1px, solid, bottom);

&::before,
&::after {
position: absolute;
Expand Down Expand Up @@ -193,14 +190,6 @@
.tna-hero__image {
filter: grayscale(1) contrast(1.75) brightness(1.2);
}

.tna-hero__content-inner {
// @include colour.colour-border("keyline-dark", 1px);

@include media.on-mobile {
// border: none;
}
}
}

@include media.on-mobile {
Expand Down
1 change: 0 additions & 1 deletion src/nationalarchives/utilities/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
&--xs {
font-size: 1em;
@include typography.main-font;
// @include typography.main-font-weight-bold;
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/nationalarchives/utilities/_lists.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,12 @@
&--plain {
dt {
padding-top: 0;
// padding-bottom: 0;
padding-left: 0;
}

dd {
// margin-bottom: 0.5rem;
padding-top: 0;
padding-right: 0;
// padding-bottom: 0;
}
}

Expand Down
1 change: 0 additions & 1 deletion src/nationalarchives/variables/_colour.scss
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ $colour-palette-dark: map.merge(
"contrast-background": #111,
"contrast-link-visited":
map.get($colour-palette-default, "contrast-link-visited"),
// "accent-background-light": brand-colour("light-grey"),
)
) !default;

Expand Down
21 changes: 20 additions & 1 deletion tasks/test-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,23 @@ Object.keys(componentsWithJavaScript).forEach((component) => {

console.log("\n");

// TODO: Test CSS for contents
console.log(`Testing compiled CSS files`);
const cssAllPackage = fs
.readFileSync("package/nationalarchives/all.css")
.toString();
const checkForClasses = ["tna-template", "tna-template__body"];
checkForClasses.forEach((cssClass) => {
const escapedClass = cssClass.replace("-", "\\-");
const regExp = cssAllPackage.match(new RegExp(`.${escapedClass}\{`, "g"));
if (regExp) {
pass(
`${cssClass.replace(/`{$/, "")} selector occurs ${regExp.length} time${
regExp.length === 1 ? "" : "s"
} in compiled CSS`,
);
} else {
fail(`${cssClass.replace(/`{$/, "")} selector missing from compiled CSS`);
process.exitCode = 1;
throw new Error("CSS test failed");
}
});
Loading