fix(SW-2692): Added hyphens:auto and text-wrap:balance to tackle long words

Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-06-05 05:35:17 +00:00
parent 714b5f06c7
commit 9fb5f82d92
6 changed files with 28 additions and 20 deletions

View File

@@ -7,9 +7,8 @@
.heading { .heading {
color: var(--Text-Heading); color: var(--Text-Heading);
overflow-wrap: break-word;
word-break: break-word;
hyphens: auto; hyphens: auto;
text-wrap: balance;
} }
.text { .text {

View File

@@ -1,16 +1,15 @@
import Link from "next/link"
import { Suspense } from "react" import { Suspense } from "react"
import { Typography } from "@scandic-hotels/design-system/Typography"
import Blocks from "@/components/Blocks" import Blocks from "@/components/Blocks"
import ButtonLink from "@/components/ButtonLink"
import HeaderDynamicContent from "@/components/Headers/DynamicContent" import HeaderDynamicContent from "@/components/Headers/DynamicContent"
import Hero from "@/components/Hero" import Hero from "@/components/Hero"
import MeetingPackageWidget from "@/components/MeetingPackageWidget" import MeetingPackageWidget from "@/components/MeetingPackageWidget"
import Sidebar from "@/components/Sidebar" import Sidebar from "@/components/Sidebar"
import SidebarSkeleton from "@/components/Sidebar/SidebarSkeleton" import SidebarSkeleton from "@/components/Sidebar/SidebarSkeleton"
import Button from "@/components/TempDesignSystem/Button"
import LinkChips from "@/components/TempDesignSystem/LinkChips" import LinkChips from "@/components/TempDesignSystem/LinkChips"
import Preamble from "@/components/TempDesignSystem/Text/Preamble"
import Title from "@/components/TempDesignSystem/Text/Title"
import TrackingSDK from "@/components/TrackingSDK" import TrackingSDK from "@/components/TrackingSDK"
import { staticPageVariants } from "./variants" import { staticPageVariants } from "./variants"
@@ -34,21 +33,21 @@ export default async function StaticPage({
{header ? ( {header ? (
<> <>
<div className={styles.headerIntro}> <div className={styles.headerIntro}>
<Title as="h2">{header.heading}</Title> <Typography variant="Title/lg">
<Preamble>{header.preamble}</Preamble> <h1 className={styles.heading}>{header.heading}</h1>
</Typography>
<Typography variant="Body/Lead text">
<p>{header.preamble}</p>
</Typography>
</div> </div>
{header.top_primary_button?.url ? ( {header.top_primary_button?.url ? (
<Button <ButtonLink
size="medium" href={header.top_primary_button.url}
intent="tertiary" size="Medium"
theme="base" variant="Tertiary"
asChild
className={styles.button}
> >
<Link href={header.top_primary_button.url}> {header.top_primary_button.title}
{header.top_primary_button.title} </ButtonLink>
</Link>
</Button>
) : null} ) : null}
{header.navigation_links ? ( {header.navigation_links ? (
<LinkChips chips={header.navigation_links} /> <LinkChips chips={header.navigation_links} />

View File

@@ -20,6 +20,12 @@
gap: var(--Spacing-x3); gap: var(--Spacing-x3);
} }
.heading {
color: var(--Text-Heading);
text-wrap: balance;
hyphens: auto;
}
.heroContainer { .heroContainer {
width: 100%; width: 100%;
padding: var(--Spacing-x4) var(--Spacing-x2); padding: var(--Spacing-x4) var(--Spacing-x2);

View File

@@ -13,6 +13,8 @@
.heading { .heading {
color: var(--Text-Heading); color: var(--Text-Heading);
margin-top: var(--Space-x3); margin-top: var(--Space-x3);
text-wrap: balance;
hyphens: auto;
} }
.h1, .h1,

View File

@@ -50,8 +50,8 @@ export default function SidePeek({
<aside className={styles.sidePeek}> <aside className={styles.sidePeek}>
<header className={styles.header}> <header className={styles.header}>
{title ? ( {title ? (
<Typography variant="Title/md" className={styles.heading}> <Typography variant="Title/md">
<h2>{title}</h2> <h2 className={styles.heading}>{title}</h2>
</Typography> </Typography>
) : null} ) : null}
<Button <Button

View File

@@ -81,6 +81,8 @@
.heading { .heading {
color: var(--Text-Heading); color: var(--Text-Heading);
text-wrap: balance;
hyphens: auto;
} }
.sidePeekContent { .sidePeekContent {