-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update updates page layout for new mocks (#2495)
- Loading branch information
Fran McDade
authored and
Fran McDade
committed
Nov 22, 2024
1 parent
b01e082
commit b763ba3
Showing
10 changed files
with
173 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { css, SerializedStyles } from "@emotion/react"; | ||
import { TYPOGRAPHY_VARIANT } from "../../theme/typography/types"; | ||
|
||
/** | ||
* Returns typography style for the specified typography variant. | ||
* @param TYPOGRAPHY_VARIANT - Typography variant name. | ||
* @returns typography styles for the variant. | ||
*/ | ||
function typographyToCSS(TYPOGRAPHY_VARIANT: string) { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO revisit any. | ||
return (props: any): SerializedStyles => { | ||
return css` | ||
${props.theme.typography[TYPOGRAPHY_VARIANT]} | ||
`; | ||
}; | ||
} | ||
|
||
export const textHeadingXSmall = typographyToCSS( | ||
TYPOGRAPHY_VARIANT.TEXT_HEADING_XSMALL | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { tabletUp } from "@databiosphere/findable-ui/lib/theme/common/breakpoints"; | ||
import { CSSProperties } from "@mui/material/styles/createTypography"; | ||
import { TYPOGRAPHY_VARIANT } from "./types"; | ||
|
||
const FONT_FAMILY_DIN = "'din-2014', sans-serif"; | ||
|
||
const textBodyLarge500: CSSProperties = { | ||
fontFamily: FONT_FAMILY_DIN, | ||
fontSize: 18, | ||
fontWeight: 400, | ||
}; | ||
|
||
const textHeading: CSSProperties = { | ||
fontFamily: FONT_FAMILY_DIN, | ||
fontSize: 22, | ||
fontWeight: 400, | ||
letterSpacing: "normal", | ||
[tabletUp]: { | ||
fontSize: 24, | ||
letterSpacing: "normal", | ||
}, | ||
}; | ||
|
||
const textHeadingLarge: CSSProperties = { | ||
fontFamily: FONT_FAMILY_DIN, | ||
fontSize: 26, | ||
fontWeight: 400, // TODO: Update to 600 when font is available, here and elsewhere. | ||
letterSpacing: "normal", | ||
lineHeight: "34px", | ||
[tabletUp]: { | ||
fontSize: 32, | ||
letterSpacing: "normal", | ||
}, | ||
}; | ||
|
||
const textHeadingSmall: CSSProperties = { | ||
fontFamily: FONT_FAMILY_DIN, | ||
fontSize: 20, | ||
fontWeight: 400, | ||
letterSpacing: "normal", | ||
[tabletUp]: { | ||
fontSize: 22, | ||
letterSpacing: "normal", | ||
}, | ||
}; | ||
|
||
const textHeadingXLarge: CSSProperties = { | ||
fontFamily: FONT_FAMILY_DIN, | ||
fontSize: 32, | ||
fontWeight: 400, | ||
letterSpacing: "normal", | ||
[tabletUp]: { | ||
fontSize: 42, | ||
letterSpacing: "-0.4px", | ||
}, | ||
}; | ||
|
||
const textHeadingXSmall: CSSProperties = { | ||
fontFamily: FONT_FAMILY_DIN, | ||
fontSize: 18, | ||
fontWeight: 400, // TODO: Update to 600 when font is available, here and elsewhere. | ||
letterSpacing: "normal", | ||
lineHeight: "26px", | ||
}; | ||
|
||
export const TYPOGRAPHY: Record<TYPOGRAPHY_VARIANT, CSSProperties> = { | ||
[TYPOGRAPHY_VARIANT.TEXT_BODY_LARGE_500]: textBodyLarge500, | ||
[TYPOGRAPHY_VARIANT.TEXT_HEADING]: textHeading, | ||
[TYPOGRAPHY_VARIANT.TEXT_HEADING_LARGE]: textHeadingLarge, | ||
[TYPOGRAPHY_VARIANT.TEXT_HEADING_SMALL]: textHeadingSmall, | ||
[TYPOGRAPHY_VARIANT.TEXT_HEADING_XSMALL]: textHeadingXSmall, | ||
[TYPOGRAPHY_VARIANT.TEXT_HEADING_XLARGE]: textHeadingXLarge, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export enum TYPOGRAPHY_VARIANT { | ||
TEXT_BODY_LARGE_500 = "text-body-large-500", | ||
TEXT_HEADING = "text-heading", | ||
TEXT_HEADING_LARGE = "text-heading-large", | ||
TEXT_HEADING_SMALL = "text-heading-small", | ||
TEXT_HEADING_XLARGE = "text-heading-xlarge", | ||
TEXT_HEADING_XSMALL = "text-heading-xsmall", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters