Skip to content

Commit 038eabd

Browse files
committed
Fix style regression on responsive queries..
1 parent be3648f commit 038eabd

3 files changed

Lines changed: 32 additions & 8 deletions

File tree

‎frontend/theme/ecosystemStyles.ts‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Style } from '@purestack/ts-css'
2-
import { BREAKPOINTS, mediaBelow, type ThemePalette } from '@purestack/ts-style'
2+
import type { ThemePalette } from '@purestack/ts-style'
33
import { studioTypography } from './studioSkin'
44

55
export function registerEcosystemStyles(root: Style, palette: ThemePalette) {
@@ -54,13 +54,6 @@ function registerRegorHighlightStyles(root: Style, palette: ThemePalette) {
5454
marginTop: '24px',
5555
})
5656
registerRegorConnectionStyles(root, palette)
57-
root
58-
.media(mediaBelow(BREAKPOINTS.sm))
59-
.select('.studio .regor-highlight')
60-
.css({
61-
gap: '24px',
62-
padding: '24px',
63-
})
6457
}
6558

6659
function registerRegorConnectionStyles(root: Style, palette: ThemePalette) {

‎frontend/theme/responsiveStyles.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,13 @@ export function registerResponsiveStyles(root: Style, palette: ThemePalette) {
488488
root.media(mediaBelow(BREAKPOINTS.sm)).select('.studio .feature-grid').css({
489489
gap: '13px',
490490
})
491+
root
492+
.media(mediaBelow(BREAKPOINTS.sm))
493+
.select('.studio .regor-highlight')
494+
.css({
495+
gap: '24px',
496+
padding: '24px',
497+
})
491498
root
492499
.media(mediaBelow(BREAKPOINTS.sm))
493500
.select('.studio .feature-card, .studio .feature-small')
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { BREAKPOINTS, mediaBelow, styleBuilder } from '@purestack/ts-style'
2+
import { beforeEach, describe, expect, it } from 'vitest'
3+
import { registerStudioStyles } from './studioStyles'
4+
5+
describe('Studio responsive styles', () => {
6+
beforeEach(() => {
7+
styleBuilder.reset()
8+
})
9+
10+
it.each(['light', 'dark'] as const)(
11+
'keeps mobile overrides after tablet rules in the %s theme',
12+
(theme) => {
13+
registerStudioStyles()
14+
const css = styleBuilder.get(theme).toCSS()
15+
const mobile = css.indexOf(`@media(${mediaBelow(BREAKPOINTS.sm)})`)
16+
const tablet = css.indexOf(`@media(${mediaBelow(BREAKPOINTS.md)})`)
17+
const laptop = css.indexOf(`@media(${mediaBelow(BREAKPOINTS.lg)})`)
18+
19+
expect(laptop).toBeGreaterThanOrEqual(0)
20+
expect(tablet).toBeGreaterThan(laptop)
21+
expect(mobile).toBeGreaterThan(tablet)
22+
},
23+
)
24+
})

0 commit comments

Comments
 (0)