Skip to content

Commit

Permalink
✨ (grapher) updating padding between text elements
Browse files Browse the repository at this point in the history
For better consistency with static charts created in Figma
  • Loading branch information
sophiamersmann committed Jan 9, 2025
1 parent b9167bd commit a017567
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions packages/@ourworldindata/grapher/src/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,6 @@ interface StaticFooterProps extends FooterProps {

@observer
export class StaticFooter extends Footer<StaticFooterProps> {
verticalPadding = 2

// eslint-disable-next-line @typescript-eslint/no-empty-function
componentDidMount(): void {}
// eslint-disable-next-line @typescript-eslint/no-empty-function
Expand Down
6 changes: 5 additions & 1 deletion packages/@ourworldindata/grapher/src/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ interface HeaderProps {
export class Header<
Props extends HeaderProps = HeaderProps,
> extends React.Component<Props> {
protected verticalPadding = 4

@computed protected get manager(): HeaderManager {
return this.props.manager
}
Expand Down Expand Up @@ -156,7 +158,7 @@ export class Header<
}

@computed get subtitleMarginTop(): number {
let padding = 4
let padding = this.verticalPadding

// make sure the subtitle doesn't overlap with the logo
if (
Expand Down Expand Up @@ -292,6 +294,8 @@ interface StaticHeaderProps extends HeaderProps {

@observer
export class StaticHeader extends Header<StaticHeaderProps> {
protected verticalPadding = 6

@computed get titleLineHeight(): number {
return this.manager.isStaticAndSmall ? 1.1 : 1.2
}
Expand Down

0 comments on commit a017567

Please sign in to comment.