From be8b9011ff88ab032ba819788c6a8b7058ab87f4 Mon Sep 17 00:00:00 2001 From: Kelly Joseph Price Date: Mon, 18 Dec 2023 15:23:17 -0800 Subject: [PATCH] refactor: callout titles h2 (#829) * Revert "fix: use semantic h3 (#828)" This reverts commit 372ca7b0e4fc6da85ed2582e68d7a9bccfc08aa6. * feat: use h2 for callout heading * test: fix --- __tests__/components/__snapshots__/test.js.snap | 2 +- __tests__/components/test.js | 2 +- components/Callout/index.jsx | 4 ++-- components/Callout/style.scss | 4 ++++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/__tests__/components/__snapshots__/test.js.snap b/__tests__/components/__snapshots__/test.js.snap index 983e1ff9f..90bf95a35 100644 --- a/__tests__/components/__snapshots__/test.js.snap +++ b/__tests__/components/__snapshots__/test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Components Callout 1`] = `"

❗️

Error Callout

Lorem ipsum dolor.

"`; +exports[`Components Callout 1`] = `"

❗️

Error Callout

Lorem ipsum dolor.

"`; exports[`Components Embed 1`] = `"
"`; diff --git a/__tests__/components/test.js b/__tests__/components/test.js index 865cae3b0..b0708181f 100644 --- a/__tests__/components/test.js +++ b/__tests__/components/test.js @@ -74,7 +74,7 @@ describe('Components', () => { cleanup(); const noTitleExpectation = - '

🚧

Callout with no title.

'; + '

🚧

Callout with no title.

'; ({ container } = render(markdown.react(callout[1]))); expect(container).toContainHTML(noTitleExpectation); diff --git a/components/Callout/index.jsx b/components/Callout/index.jsx index 904ae25dc..3432b4ed8 100644 --- a/components/Callout/index.jsx +++ b/components/Callout/index.jsx @@ -8,10 +8,10 @@ const Callout = props => { return ( // eslint-disable-next-line react/jsx-props-no-spreading, react/no-unknown-property
-

+

{icon} {title} -

+ {content}
); diff --git a/components/Callout/style.scss b/components/Callout/style.scss index 2f220512b..c4c78c6a6 100644 --- a/components/Callout/style.scss +++ b/components/Callout/style.scss @@ -74,6 +74,10 @@ .callout-heading { color: var(--title, --text); + font-size: 1.25em; // match h3 + font-family: var(--markdown-title-font); // match h3 + font-weight: var(--markdown-title-weight, 600); // match h3 + line-height: 1.25; // match h3 margin-bottom: calc(#{$l-offset} * 0.5); &:only-child {