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

feat: remove themes #250

Merged
merged 41 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3166a8c
refactor: extract logo to separate component
chrisvaillancourt Sep 10, 2024
3978c7e
refactor: move hover styles into relevant component
chrisvaillancourt Sep 10, 2024
51b2636
refactor: extract logo colors to css variables
chrisvaillancourt Sep 10, 2024
973b13b
build: update dependencies
chrisvaillancourt Sep 11, 2024
6c1ed29
fix: remove unnecessary pnpm version specifier
chrisvaillancourt Sep 12, 2024
98f47a2
feat: add heading attributes to props
chrisvaillancourt Sep 12, 2024
f7045ad
wip: header refactor
chrisvaillancourt Sep 12, 2024
a3a13f9
build: update dependencies
chrisvaillancourt Sep 12, 2024
eb9fffb
feat: simplify header layout
chrisvaillancourt Sep 12, 2024
70f1eb2
wip: css theme toggle
chrisvaillancourt Sep 13, 2024
b457a40
feat: update header grid
chrisvaillancourt Sep 13, 2024
3662c3f
chore: remove commented out class
chrisvaillancourt Sep 13, 2024
49fc16c
feat: reuse theme icons
chrisvaillancourt Sep 13, 2024
d81376d
feat: improve theme toggle tooltip
chrisvaillancourt Sep 13, 2024
56cd14c
chore: code formatting
chrisvaillancourt Sep 13, 2024
9cd4265
feat: use updated header
chrisvaillancourt Sep 13, 2024
3819f72
feat: add site icon to constants
chrisvaillancourt Sep 17, 2024
64c92aa
fix: remove unused data attribute
chrisvaillancourt Sep 17, 2024
182ac87
feat: emit theme change event
chrisvaillancourt Sep 18, 2024
9800dc8
build: update dependencies
chrisvaillancourt Sep 18, 2024
72f3d0a
fix: inline js to prevent theme icon from switching after load
chrisvaillancourt Sep 18, 2024
7eed581
chore: remove unused import
chrisvaillancourt Sep 18, 2024
f870462
fix: remove unused class
chrisvaillancourt Sep 18, 2024
8ded16d
docs: add info on why we need to inline script
chrisvaillancourt Sep 18, 2024
d500c03
chore: remove old theme toggle
chrisvaillancourt Sep 18, 2024
4ab8e97
refactor: rename theme toggle
chrisvaillancourt Sep 18, 2024
83f7c29
feat: remove theme toggle
chrisvaillancourt Sep 18, 2024
12cc491
feat: simplify header layout
chrisvaillancourt Sep 18, 2024
098ef4c
feat: pass logo and nav links as props
chrisvaillancourt Sep 18, 2024
2652ad4
refactor: pass logo, links, and title as props and slot
chrisvaillancourt Sep 18, 2024
6dfdbb9
feat: check if links exists and has items
chrisvaillancourt Sep 18, 2024
b257742
refactor: extract links type to shared type
chrisvaillancourt Sep 18, 2024
793fb11
feat: make footer links an unordered list
chrisvaillancourt Sep 19, 2024
4c334b4
build: update dependencies
chrisvaillancourt Sep 19, 2024
fe055ba
feat: add json parse util
chrisvaillancourt Sep 19, 2024
cf0df83
feat: force dark mode
chrisvaillancourt Sep 19, 2024
eddf42a
feat: remove light theme from site config
chrisvaillancourt Sep 20, 2024
02a9731
chore: remove unused logo
chrisvaillancourt Sep 20, 2024
0682f7b
refactor: remove json util
chrisvaillancourt Sep 20, 2024
bc74556
build: only specify major and minor version of git
chrisvaillancourt Sep 20, 2024
8263d72
test: remove unnecessary tests
chrisvaillancourt Sep 20, 2024
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
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"features": {
"ghcr.io/devcontainers/features/git:1": {
"version": "2.46.0"
"version": "2.46"
},
"ghcr.io/devcontainers/features/git-lfs:1": {}
},
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ ARG PNPM_VERSION

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
# stop corepack from adding packageManager field to package.json
# we don't need this since we already specify the package manager
# and version in the root compose.yaml
# https://github.com/nodejs/corepack/blob/main/README.md#environment-variables
ENV COREPACK_ENABLE_AUTO_PIN=0

RUN corepack enable \
&& corepack prepare pnpm@$PNPM_VERSION --activate \
Expand Down
51 changes: 0 additions & 51 deletions e2e/components/ThemeToggle.spec.ts

This file was deleted.

43 changes: 0 additions & 43 deletions e2e/pages/index/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,47 +26,4 @@ test.describe('home page', () => {
const postsText = await posts.allTextContents();
expect(postsText.length).toBeGreaterThan(6);
});
test('nav menu links are visible on mobile', async ({ page, isMobile }) => {
if (!isMobile) return;

const navHamburger = await page.getByLabel('Open main menu');
await expect(navHamburger).toBeVisible();

await navHamburger.click();
const mainMenu = await page.getByLabel('Main menu', { exact: true });
await expect(mainMenu).toBeVisible();

const homeLink = await mainMenu.getByRole('link', { name: 'Home' });
await expect(homeLink).toBeVisible();

const postsLink = await mainMenu.getByRole('link', { name: 'Posts' });
await expect(postsLink).toBeVisible();

const aboutLink = await mainMenu.getByRole('link', { name: 'About' });
await expect(aboutLink).toBeVisible();
});
test('nav menu links are visible on desktop', async ({ page, isMobile }) => {
if (isMobile) return;

const nav = await page.getByLabel('Main menu', { exact: true });
await expect(nav).toBeVisible();
const home = nav.getByText('home');
const posts = nav.getByText('posts');
const about = nav.getByText('about');
await Promise.all([
expect(home).toBeVisible(),
expect(about).toBeVisible(),
expect(posts).toBeVisible(),
]);
});
test('nav menu toggle is visible on small viewports', async ({
page,
isMobile,
}) => {
if (!isMobile) return;

await page.setViewportSize({ width: 320, height: 600 });
const navHamburger = await page.getByLabel('Open main menu');
await expect(navHamburger).toBeVisible();
});
});
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,35 @@
},
"devDependencies": {
"@astrojs/check": "^0.9.3",
"@astrojs/mdx": "^3.1.5",
"@astrojs/mdx": "^3.1.7",
"@astrojs/sitemap": "^3.1.6",
"@astrojs/tailwind": "^5.1.0",
"@playwright/test": "^1.47.0",
"@astrojs/tailwind": "^5.1.1",
"@playwright/test": "^1.47.1",
"@resvg/resvg-js": "^2.6.2",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/typography": "^0.5.15",
"@types/node": "^20.16.5",
"autoprefixer": "^10.4.20",
"daisyui": "^4.12.10",
"postcss": "^8.4.45",
"postcss": "^8.4.47",
"postcss-html": "^1.7.0",
"prettier": "3.3.3",
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-tailwindcss": "^0.6.6",
"tailwindcss": "^3.4.10",
"tailwindcss": "^3.4.12",
"typescript": "^5.6.2",
"vitest": "^2.0.5",
"wrangler": "^3.75.0"
"vitest": "^2.1.1",
"wrangler": "^3.78.6"
},
"dependencies": {
"@astrojs/rss": "^4.0.7",
"@mdi/js": "^7.4.47",
"astro": "^4.15.4",
"astro": "^4.15.8",
"dotenv": "^16.4.5",
"dotenv-expand": "^11.0.6",
"remark-unwrap-images": "^4.0.0",
"satori": "^0.10.14",
"satori": "^0.11.1",
"satori-html": "^0.3.2",
"zod": "^3.23.8"
},
"packageManager": "[email protected]+sha512.60c18acd138bff695d339be6ad13f7e936eea6745660d4cc4a776d5247c540d0edee1a563695c183a66eb917ef88f2b4feb1fc25f32a7adcadc7aaf3438e99c1"
}
}
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default defineConfig({
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
reporter: 'list', // changed from html to list to stop default browser from opening
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
Expand Down
Loading