Skip to content

Commit b02b4ae

Browse files
committed
feat: revert project to Tailwind 3 for improved browser support
1 parent 5e5314b commit b02b4ae

90 files changed

Lines changed: 1231 additions & 1229 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// @ts-check
2+
3+
/**
4+
* @typedef {Object} Summary
5+
* @prop {number} performance
6+
* @prop {number} accessibility
7+
* @prop {number} best-practices
8+
* @prop {number} seo
9+
* @prop {number} pwa
10+
*/
11+
12+
/**
13+
* @typedef {Object} Manifest
14+
* @prop {string} url
15+
* @prop {boolean} isRepresentativeRun
16+
* @prop {string} htmlPath
17+
* @prop {string} jsonPath
18+
* @prop {Summary} summary
19+
*/
20+
21+
/**
22+
* @typedef {Object} LighthouseOutputs
23+
* @prop {Record<string, string>} links
24+
* @prop {Manifest[]} manifest
25+
* @prop {string} preset
26+
*/
27+
28+
const formatScore = (/** @type { number } */ score) => Math.round(score * 100);
29+
const emojiScore = (/** @type { number } */ score) =>
30+
score >= 0.9 ? "🟢" : score >= 0.5 ? "🟠" : "🔴";
31+
32+
const scoreRow = (
33+
/** @type { string } */ label,
34+
/** @type { number } */ score,
35+
) => `| ${emojiScore(score)} ${label} | ${formatScore(score)} |`;
36+
37+
/**
38+
* @param {LighthouseOutputs} lighthouseOutputs
39+
*/
40+
function makeComment(lighthouseOutputs) {
41+
const { summary } = lighthouseOutputs.manifest[2];
42+
const [[testedUrl, reportUrl]] = Object.entries(lighthouseOutputs.links);
43+
const preset = lighthouseOutputs.preset;
44+
45+
const comment = `We ran Lighthouse against the changes on a ${preset} and produced this [report](${reportUrl}). Here's the summary:
46+
47+
| Category | Score |
48+
| -------- | ----- |
49+
${scoreRow("Performance", summary.performance)}
50+
${scoreRow("Accessibility", summary.accessibility)}
51+
${scoreRow("Best practices", summary["best-practices"])}
52+
${scoreRow("SEO", summary.seo)}
53+
54+
`;
55+
56+
return comment;
57+
}
58+
59+
module.exports = ({ lighthouseOutputs }) => {
60+
return makeComment(lighthouseOutputs);
61+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = async ({ github, context, core }) => {
2+
const result = await github.rest.repos.listPullRequestsAssociatedWithCommit({
3+
owner: context.repo.owner,
4+
repo: context.repo.repo,
5+
commit_sha: context.sha,
6+
});
7+
8+
core.setOutput("pr", result?.data[0]?.number || "");
9+
core.setOutput("title", result?.data[0]?.title || "");
10+
core.setOutput("url", result?.data[0]?.html_url || "");
11+
core.setOutput("draft", `${result?.data[0]?.draft}` || "true");
12+
};

core/.browserslistrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
>2%, last 2 versions, Firefox ESR

core/app/[locale]/(default)/account/wishlists/[id]/_components/wishlist-actions.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const WishlistActions = ({
4444
<div className="flex-1">
4545
<WishlistVisibilitySwitch {...wishlist} />
4646
</div>
47-
<div className="@lg:border-l-contrast-100 flex items-center gap-2 pl-4 @lg:border-l">
47+
<div className="flex items-center gap-2 pl-4 @lg:border-l @lg:border-l-contrast-100">
4848
{publicUrl != null && publicUrl !== '' && (
4949
<WishlistShareButton
5050
closeLabel={shareCloseLabel}
@@ -74,7 +74,7 @@ export function WishlistActionsSkeleton() {
7474
<div className="flex-1">
7575
<SwitchSkeleton characterCount={5} />
7676
</div>
77-
<div className="@lg:border-l-contrast-100 flex items-center gap-2 pl-4 @lg:border-l">
77+
<div className="flex items-center gap-2 pl-4 @lg:border-l @lg:border-l-contrast-100">
7878
<WishlistShareButtonSkeleton />
7979
<Skeleton.Box className="h-10 w-10 rounded-full" />
8080
</div>

core/app/[locale]/(default)/account/wishlists/_components/wishlist-actions-menu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export const WishlistActionsMenu = ({ actionsTitle, items, share }: Props) => {
163163
</DropdownMenu>
164164
{modals.map(({ key, modal: { formAction: action, ...modalProps } }) => (
165165
<Modal
166-
className="max-w-lg min-w-64 @lg:min-w-96"
166+
className="min-w-64 max-w-lg @lg:min-w-96"
167167
form={action ? { action, onSuccess: handleModalFormSuccess(key) } : undefined}
168168
isOpen={state[key] ?? false}
169169
key={key}

core/app/[locale]/(default)/webpages/[id]/_components/web-page.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ export function WebPageContent({ webPage: streamableWebPage, breadcrumbs, childr
3030
<header className="pb-8 @2xl:pb-12 @4xl:pb-16">
3131
{breadcrumbs && <Breadcrumbs breadcrumbs={breadcrumbs} />}
3232

33-
<h1 className="font-heading mt-8 mb-4 text-4xl leading-none font-medium @xl:text-5xl @4xl:text-6xl">
33+
<h1 className="mb-4 mt-8 font-heading text-4xl font-medium leading-none @xl:text-5xl @4xl:text-6xl">
3434
{title}
3535
</h1>
3636
</header>
3737

3838
<div
39-
className="prose [&_h2]:font-heading space-y-4 [&_h2]:text-3xl [&_h2]:leading-none [&_h2]:font-normal @-xl:[&_h2]:text-4xl [&_img]:mx-auto [&_img]:max-h-[600px] [&_img]:w-fit [&_img]:rounded-2xl [&_img]:object-cover"
39+
className="@-xl:[&_h2]:text-4xl prose space-y-4 [&_h2]:font-heading [&_h2]:text-3xl [&_h2]:font-normal [&_h2]:leading-none [&_img]:mx-auto [&_img]:max-h-[600px] [&_img]:w-fit [&_img]:rounded-2xl [&_img]:object-cover"
4040
dangerouslySetInnerHTML={{ __html: content }}
4141
/>
4242
{children}
@@ -50,22 +50,22 @@ export function WebPageContent({ webPage: streamableWebPage, breadcrumbs, childr
5050

5151
function WebPageTitleSkeleton() {
5252
return (
53-
<div className="mt-8 mb-4 animate-pulse">
54-
<div className="bg-contrast-100 h-9 w-5/6 rounded-lg @xl:h-12 @4xl:h-[3.75rem]" />
53+
<div className="mb-4 mt-8 animate-pulse">
54+
<div className="h-9 w-5/6 rounded-lg bg-contrast-100 @xl:h-12 @4xl:h-[3.75rem]" />
5555
</div>
5656
);
5757
}
5858

5959
function WebPageBodySkeleton() {
6060
return (
6161
<div className="mx-auto w-full max-w-4xl animate-pulse pb-8 @2xl:pb-12 @4xl:pb-16">
62-
<div className="bg-contrast-100 mb-8 h-[1lh] w-3/5 rounded-lg" />
63-
<div className="bg-contrast-100 mb-4 h-[0.5lh] w-full rounded-lg" />
64-
<div className="bg-contrast-100 mb-4 h-[0.5lh] w-full rounded-lg" />
65-
<div className="bg-contrast-100 mb-4 h-[0.5lh] w-full rounded-lg" />
66-
<div className="bg-contrast-100 mb-4 h-[0.5lh] w-full rounded-lg" />
67-
<div className="bg-contrast-100 mb-4 h-[0.5lh] w-full rounded-lg" />
68-
<div className="bg-contrast-100 mb-4 h-[0.5lh] w-3/4 rounded-lg" />
62+
<div className="mb-8 h-[1lh] w-3/5 rounded-lg bg-contrast-100" />
63+
<div className="mb-4 h-[0.5lh] w-full rounded-lg bg-contrast-100" />
64+
<div className="mb-4 h-[0.5lh] w-full rounded-lg bg-contrast-100" />
65+
<div className="mb-4 h-[0.5lh] w-full rounded-lg bg-contrast-100" />
66+
<div className="mb-4 h-[0.5lh] w-full rounded-lg bg-contrast-100" />
67+
<div className="mb-4 h-[0.5lh] w-full rounded-lg bg-contrast-100" />
68+
<div className="mb-4 h-[0.5lh] w-3/4 rounded-lg bg-contrast-100" />
6969
</div>
7070
);
7171
}

core/components/wishlist/share-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const WishlistShareButton = ({
9898
if (!isMobileUser) {
9999
return (
100100
<Modal
101-
className="max-w-lg min-w-64 @lg:min-w-96"
101+
className="min-w-64 max-w-lg @lg:min-w-96"
102102
isOpen={open}
103103
setOpen={setOpen}
104104
trigger={ShareButton}

0 commit comments

Comments
 (0)