Skip to content

Commit

Permalink
isolate styles better for the display of snippet HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
twrichards committed Dec 16, 2024
1 parent 87ed411 commit 43ea0e5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions client/fontNormaliser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export const agateSans = agateSansFont(
);
export const textSans = pixelSizedFont(sourceFoundations.textSans);

export const bodyFont = pixelSizedFont(sourceFoundations.body);

const isAgateLoaded = () => {
let foundAgate = false;
document.fonts.forEach((font) => {
Expand Down
20 changes: 13 additions & 7 deletions client/src/payloadDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { TelemetryContext, PINBOARD_TELEMETRY_TYPE } from "./types/Telemetry";
import { Tab } from "./types/Tab";
import { FloatingClearButton } from "./floatingClearButton";
import { MamVideoDisplay } from "./mam/mamVideoDisplay";
import root from "react-shadow/emotion";
import { bodyFont } from "../fontNormaliser";

interface PayloadDisplayProps {
payloadAndType: PayloadAndType;
Expand Down Expand Up @@ -141,21 +143,25 @@ export const PayloadDisplay = ({
<strong>Newswires snippet:</strong>
<blockquote
css={css`
font-size: 0.8rem;
overflow-y: auto;
margin: 0;
padding: 0 0 0 ${space[1]}px;
border-left: 4px solid ${brand[800]};
background-color: ${neutral[100]};
max-height: 175px;
overflow-y: auto;
`}
>
<div
dangerouslySetInnerHTML={{
__html: safeSnippetHtml || "",
}}
/>
<root.div>
<div
css={css`
${bodyFont.small({ lineHeight: "tight" })};
font-size: 12px;
`}
dangerouslySetInnerHTML={{
__html: safeSnippetHtml || "",
}}
/>
</root.div>
</blockquote>
</div>
)}
Expand Down

0 comments on commit 43ea0e5

Please sign in to comment.