fix(support-chat): simplify legacy h5 styles
This commit is contained in:
@@ -160,25 +160,37 @@ func TestSupportChatKeepsOlderMobileWebViewsCompatible(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
forbiddenCSS := []string{
|
||||
`color-mix(`,
|
||||
`100svh`,
|
||||
`100dvh`,
|
||||
`inset:`,
|
||||
`min(`,
|
||||
`max(`,
|
||||
`clamp(`,
|
||||
`minmax(`,
|
||||
`fit-content`,
|
||||
`backdrop-filter`,
|
||||
`place-items`,
|
||||
`overflow-wrap: anywhere`,
|
||||
}
|
||||
for _, name := range []string{"assets/chat.css", "assets/demo.css"} {
|
||||
stylesheet, readErr := assets.ReadFile(name)
|
||||
if readErr != nil {
|
||||
t.Fatalf("read support chat stylesheet %s: %v", name, readErr)
|
||||
}
|
||||
for _, forbidden := range forbiddenCSS {
|
||||
if strings.Contains(string(stylesheet), forbidden) {
|
||||
t.Fatalf("support chat stylesheet %s must not require newer mobile CSS %q", name, forbidden)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stylesheet, err := assets.ReadFile("assets/chat.css")
|
||||
if err != nil {
|
||||
t.Fatalf("read support chat stylesheet: %v", err)
|
||||
}
|
||||
css := string(stylesheet)
|
||||
for _, forbidden := range []string{
|
||||
`color-mix(`,
|
||||
`height: 100dvh`,
|
||||
`inset:`,
|
||||
`width: min(`,
|
||||
`top: max(`,
|
||||
`backdrop-filter`,
|
||||
`place-items`,
|
||||
`overflow-wrap: anywhere`,
|
||||
} {
|
||||
if strings.Contains(css, forbidden) {
|
||||
t.Fatalf("support chat stylesheet must not require newer mobile CSS %q", forbidden)
|
||||
}
|
||||
}
|
||||
for _, marker := range []string{
|
||||
`.message-row.mine .message-bubble { border-color: #2475fc;`,
|
||||
`.send-button { width: 40px; height: 40px;`,
|
||||
|
||||
Reference in New Issue
Block a user