mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-08-29 01:08:59 +00:00
FIX - align first Sky settings group
This commit is contained in:
@@ -12,6 +12,10 @@
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.sky-settings-group:first-child > .sky-settings-group__title:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.sky-settings-group__list {
|
||||
min-width: 0;
|
||||
margin: 0;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
|
||||
import { createSSRApp, h } from 'vue'
|
||||
import { renderToString } from 'vue/server-renderer'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
@@ -5,6 +7,11 @@ import { describe, expect, it } from 'vitest'
|
||||
import SkySettingsGroup from '@/ui/settings/SkySettingsGroup.vue'
|
||||
import SkySettingsRow from '@/ui/settings/SkySettingsRow.vue'
|
||||
|
||||
const settingsStyles = readFileSync(
|
||||
new URL('../settings.css', import.meta.url),
|
||||
'utf8',
|
||||
)
|
||||
|
||||
describe('SkySettingsGroup', () => {
|
||||
it('connects its heading and footer to the settings section', async () => {
|
||||
const app = createSSRApp({
|
||||
@@ -49,4 +56,13 @@ describe('SkySettingsGroup', () => {
|
||||
expect(html).not.toContain('<h2')
|
||||
expect(html).not.toContain('sky-settings-group__footer')
|
||||
})
|
||||
|
||||
it('keeps the first group title flush with the scroll content', () => {
|
||||
expect(settingsStyles).toMatch(
|
||||
/\.sky-settings-group:first-child\s*>\s*\.sky-settings-group__title:first-child\s*\{[^}]*margin-top:\s*0/s,
|
||||
)
|
||||
expect(settingsStyles).toMatch(
|
||||
/\.sky-settings-group__title\s*\{[^}]*margin:\s*32px 16px 8px/s,
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -34,8 +34,5 @@ describe('SettingsApp Sky UI contract', () => {
|
||||
expect(source).toMatch(
|
||||
/\.settings-content--subpage\s*\{[^}]*padding-top:\s*0/,
|
||||
)
|
||||
expect(source).toMatch(
|
||||
/\.settings-content--subpage[\s\S]*?:deep\(\s*\.sky-settings-group:first-child\s*>\s*\.sky-settings-group__title:first-child\s*\)\s*\{[^}]*margin-top:\s*0/,
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1506,13 +1506,6 @@ onBeforeUnmount(() => {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.settings-content--subpage
|
||||
> :deep(
|
||||
.sky-settings-group:first-child > .sky-settings-group__title:first-child
|
||||
) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.settings-copy {
|
||||
margin: 0 var(--sky-space-1) var(--sky-space-4);
|
||||
color: var(--sky-muted);
|
||||
|
||||
Reference in New Issue
Block a user