Skip to content

Commit

Permalink
fix lighthouse
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed May 5, 2022
1 parent 712eea0 commit b6f0e52
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 4 additions & 4 deletions admin/scripts/format-lighthouse-score.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ const summaryKeys = {
pwa: 'PWA',
};

/** @param {number} score */
const scoreEntry = (score) => {
const normalizedScore = Math.round(score * 100);
/** @param {number} rawScore */
const scoreEntry = (rawScore) => {
const score = Math.round(rawScore * 100);
// eslint-disable-next-line no-nested-ternary
const scoreIcon = score >= 90 ? '🟢' : score >= 50 ? '🟠' : '🔴';
return `${scoreIcon} ${normalizedScore}`;
return `${scoreIcon} ${score}`;
};

/**
Expand Down
12 changes: 10 additions & 2 deletions website/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
--site-color-checkbox-checked-bg: hsl(167deg 56% 73% / 25%);
--site-color-feedback-background: #fff;
--docusaurus-highlighted-code-line-bg: rgb(0 0 0 / 10%);
/* Use a darker color to ensure contrast, ideally we don't need important */
--ifm-breadcrumb-color-active: var(--ifm-color-primary-darker) !important;
}

html[data-theme='dark'] {
Expand All @@ -28,6 +30,10 @@ html[data-theme='dark'] {
--docusaurus-highlighted-code-line-bg: rgb(66 66 66 / 35%);
}

/*
* This selector will be dynamically replaced by the color generator. Don't put
* other properties here.
*/
[data-theme='light'] {
--ifm-color-primary: hsl(var(--site-primary-hue-saturation) 30%);
--ifm-color-primary-dark: hsl(var(--site-primary-hue-saturation) 26%);
Expand All @@ -41,10 +47,12 @@ html[data-theme='dark'] {
--ifm-color-primary-lightest: hsl(
var(--site-primary-hue-saturation-light) 58%
);
/* Use a darker color to ensure contrast */
--ifm-breadcrumb-color-active: var(--ifm-color-primary-darker);
}

/*
* This selector will be dynamically replaced by the color generator. Don't put
* other properties here.
*/
[data-theme='dark'] {
--ifm-color-primary: hsl(var(--site-primary-hue-saturation) 45%);
--ifm-color-primary-dark: hsl(var(--site-primary-hue-saturation) 41%);
Expand Down

0 comments on commit b6f0e52

Please sign in to comment.