Skip to content

Commit 324fe1d

Browse files
committed
fix: Update settings and test for xs breakpoint class (#2054)
1 parent b92969a commit 324fe1d

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/app.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
--color-atcoder-ac-with_editorial-background_dark: #3abff8;
8181

8282
/* Customized breakpoints */
83-
--breakpoint-xs: 420px;
83+
--breakpoint-xs: 26.25rem;
8484

8585
/* Customized widths */
8686
--width-1-7: 14.2857143%;

tests/custom-colors.spec.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ test.describe('Custom colors for TailwindCSS v4 configuration', () => {
5353
expect(css).toContain('bg-atcoder');
5454
});
5555

56-
test('xs breakpoint is available (or custom breakpoints)', () => {
56+
test('xs breakpoint media queries are generated in CSS', () => {
5757
const cssDir = resolve('.svelte-kit/output/client/_app/immutable/assets');
5858
const cssFiles = readdirSync(cssDir)
5959
.filter((f: string) => f.endsWith('.css'))
@@ -62,14 +62,13 @@ test.describe('Custom colors for TailwindCSS v4 configuration', () => {
6262

6363
expect(cssFiles.length).toBeGreaterThan(0);
6464

65-
// Verify total CSS size from multiple files
66-
const totalCssSize = cssFiles.slice(0, 5).reduce((acc, f) => {
67-
const cssPath = resolve(cssDir, f);
68-
const css = readFileSync(cssPath, 'utf-8');
69-
return acc + css.length;
70-
}, 0);
65+
// Merge all CSS files to verify xs breakpoint
66+
const allCss = cssFiles
67+
.map((f: string) => readFileSync(resolve(cssDir, f), 'utf-8'))
68+
.join('\n');
7169

72-
// Verify CSS is generated properly (single file size may be small due to multiple files)
73-
expect(totalCssSize).toBeGreaterThan(5000);
70+
// Verify xs breakpoint media query is generated (26.25rem = 420px)
71+
// @media(min-width:26.25rem) confirms the xs breakpoint is defined correctly
72+
expect(allCss).toMatch(/@media\(min-width:26\.25rem\)/);
7473
});
7574
});

0 commit comments

Comments
 (0)