Skip to content

Commit

Permalink
πŸ’„ Align text CSS classes with design
Browse files Browse the repository at this point in the history
πŸ’„ Add labelLarge class
πŸ”₯ Remove labelSemibold and labelLight
  • Loading branch information
petterhh committed Dec 6, 2024
1 parent 60b7d4f commit 96f1833
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const BreadCrumbMenu = ({
className={
isLast ? styles.breadCrumbText : styles.breadCrumbLink
}
type={isLast ? "labelSemibold" : "desktopLink"}
type={isLast ? "labelRegular" : "desktopLink"}
>
{title}
</Text>
Expand Down
2 changes: 1 addition & 1 deletion src/components/navigation/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const Header = ({
/>
)}
<Button size="large" type="secondary" background="light">
<Text type="labelRegular">{t("contact_us")}</Text>
<Text type="labelLarge">{t("contact_us")}</Text>
</Button>
</div>
<button
Expand Down
4 changes: 2 additions & 2 deletions src/components/sections/employees/EmployeeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default function EmployeeList({
<>
<div className={styles.employeeFiltersWrapper}>
<div className={styles.employeeFilterWrapper}>
<Text type="labelSemibold" className={styles.employeeFilterLabel}>
<Text type="labelRegular" className={styles.employeeFilterLabel}>
{t("field")}
</Text>
<Tag
Expand All @@ -125,7 +125,7 @@ export default function EmployeeList({
})}
</div>
<div className={styles.employeeFilterWrapper}>
<Text type="labelSemibold" className={styles.employeeFilterLabel}>
<Text type="labelRegular" className={styles.employeeFilterLabel}>
{t("location")}
</Text>
<Tag
Expand Down
16 changes: 0 additions & 16 deletions src/components/text/Text.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ const meta: Meta<typeof Text> = {
"h5",
"h6",
"labelSmall",
"labelLight",
"labelRegular",
"labelSemibold",
"labelBold",
"quoteItalic",
"quoteNormal",
Expand Down Expand Up @@ -100,27 +98,13 @@ export const LabelSmall: Story = {
},
};

export const LabelLight: Story = {
args: {
type: "labelLight",
children: "This is a Label Light text",
},
};

export const LabelRegular: Story = {
args: {
type: "labelRegular",
children: "This is a Label Regular text",
},
};

export const LabelSemibold: Story = {
args: {
type: "labelSemibold",
children: "This is a Label Semibold text",
},
};

export const QuoteItalic: Story = {
args: {
type: "quoteItalic",
Expand Down
9 changes: 3 additions & 6 deletions src/components/text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ export type TextType =
| "desktopLink"
| "desktopLinkBig"
| "labelSmall"
| "labelLight"
| "labelRegular"
| "labelSemibold"
| "labelBold"
| "labelLarge"
| "quoteItalic"
| "quoteNormal"
| "bodyExtraSmall"
Expand All @@ -34,10 +33,9 @@ const elementMap: { [key in TextType]: keyof JSX.IntrinsicElements } = {
desktopLink: "p",
desktopLinkBig: "p",
labelSmall: "span",
labelLight: "span",
labelRegular: "span",
labelSemibold: "span",
labelBold: "span",
labelLarge: "span",
quoteItalic: "p",
quoteNormal: "p",
bodyExtraSmall: "p",
Expand All @@ -59,10 +57,9 @@ const classMap: { [key in TextType]?: string } = {
desktopLink: styles.desktopLink,
desktopLinkBig: styles.desktopLinkBig,
labelSmall: styles.labelSmall,
labelLight: styles.labelLight,
labelRegular: styles.labelRegular,
labelSemibold: styles.labelSemibold,
labelBold: styles.labelBold,
labelLarge: styles.labelLarge,
quoteItalic: styles.quoteItalic,
quoteNormal: styles.quoteNormal,
bodyExtraSmall: styles.bodyExtraSmall,
Expand Down
72 changes: 37 additions & 35 deletions src/components/text/text.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
}

.labelSmall,
.labelLight,
.labelRegular,
.labelSemibold,
.labelBold,
.quoteItalic,
.quoteNormal,
Expand All @@ -22,32 +20,33 @@
.h1 {
font-size: 4.5rem;
font-style: normal;
font-weight: 600;
line-height: 120%;
font-weight: 450;
line-height: 111.111%;
}

.h2 {
font-size: 3rem;
font-weight: 600;
line-height: 120%;
font-size: 3.5rem;
font-weight: 450;
line-height: 114.286%;
}

.h3 {
font-size: 2.125rem;
font-weight: 600;
font-size: 2rem;
font-weight: 450;
line-height: 125%;
}

.h4 {
font-size: 1.5rem;
font-style: normal;
font-weight: 500;
line-height: 120%; /* 1.8rem */
font-weight: 450;
line-height: 133.3%;
}

.h5 {
font-size: 1.25rem;
font-style: normal;
font-weight: 400;
font-weight: 450;
line-height: 120%;
}

Expand All @@ -58,7 +57,7 @@
font-size: 1rem;
font-style: normal;
font-weight: 400;
line-height: 110%;
line-height: 150%;
}

.desktopLinkBig {
Expand All @@ -71,22 +70,24 @@

.bodyXl {
font-size: 2.5rem;
font-weight: 400;
font-weight: 300;
line-height: 120%;
letter-spacing: 0.025rem;
}

.bodyBig {
font-size: 1.5rem;
font-style: normal;
font-weight: 400;
line-height: 130%;
font-weight: 300;
line-height: 133.333%;
}

.bodyNormal {
font-size: 1.25rem;
font-style: normal;
font-weight: 300;
line-height: 160%;
letter-spacing: 0.0125rem;
}

.bodySmall {
Expand All @@ -96,14 +97,14 @@
}

.bodyExtraSmall {
font-size: 14px;
font-size: 0.875rem;
font-weight: 400;
line-height: 18px;
letter-spacing: 0.14px;
line-height: 128.571%;
letter-spacing: 0.00875rem;

@media (max-width: 375px) {
font-size: 12px;
letter-spacing: 0.12px;
font-size: 0.75px;
letter-spacing: 0.0075rem;
}
}

Expand All @@ -113,31 +114,25 @@
line-height: 1.5rem;
}

.labelLight {
font-size: 1rem;
font-style: normal;
font-weight: 300;
line-height: 120%;
}

.labelRegular {
font-size: 1rem;
font-style: normal;
font-weight: 400;
line-height: 120%;
line-height: 150%;
letter-spacing: 0.02rem;
}

.labelSemibold {
.labelBold {
font-size: 1rem;
font-style: normal;
font-weight: 600;
font-weight: 800;
line-height: 120%;
}

.labelBold {
font-size: 1rem;
.labelLarge {
font-size: 1.25rem;
font-style: normal;
font-weight: 800;
font-weight: 400;
line-height: 120%;
}

Expand All @@ -149,9 +144,16 @@
white-space: pre-line;
}

.quoteItalic {
font-size: 1.5rem;
font-style: italic;
font-weight: 400;
line-height: 130%;
white-space: pre-line;
}

/* TODO: add font variables */
/* .labelBold */
/* .quoteItalic */
/* .labelSemibold, */
/* .labelBold, */
/* .quoteItalic, */

0 comments on commit 96f1833

Please sign in to comment.