Skip to content

Commit

Permalink
fix: set max width on paragraphs
Browse files Browse the repository at this point in the history
  • Loading branch information
wp-aberg committed Nov 15, 2023
1 parent bc97568 commit 6eca400
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions build.washingtonpost.com/components/Markdown/Styling.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ const HR = styled("hr", {

export const P = styled("p", {
fontSize: "$100",
lineHeight: "$150",
margin: 0,
paddingBottom: "$050",
fontFamily: "$meta",
fontWeight: "$light",
maxWidth: "767px",
"& > code": {
fontFamily: "monospace",
backgroundColor: theme.colors.subtle,
Expand Down
10 changes: 10 additions & 0 deletions build.washingtonpost.com/components/Typography/Description.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { styled, theme } from "@washingtonpost/wpds-ui-kit";

export const Description = styled("p", {
color: theme.colors.accessible,
fontFamily: theme.fonts.meta,
fontWeight: theme.fontWeights.light,
lineHeight: theme.lineHeights["150"],
marginBlock: 0,
maxWidth: "767px",
});
10 changes: 3 additions & 7 deletions build.washingtonpost.com/pages/components/[slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import React from "react";
import { MDXRemote } from "next-mdx-remote";
import { NextSeo } from "next-seo";

import { styled, theme } from "@washingtonpost/wpds-ui-kit";
import { styled } from "@washingtonpost/wpds-ui-kit";

import MDXStyling from "~/components/Markdown/Styling";
import Header from "~/components/Typography/Headers";
import { Description } from "~/components/Typography/Description";
import TableofContents from "~/components/Markdown/Components/tableofcontents";
import {
getAllPathsBySection,
Expand All @@ -27,11 +28,6 @@ const components = {
useRef: React.useRef,
};

const P = styled("p", {
color: theme.colors.accessible,
marginBlock: 0,
});

const Article = styled("article", {
margin: "auto",
});
Expand Down Expand Up @@ -63,7 +59,7 @@ export default function Page({
)}

{source.scope.description && (
<P className="description">{source.scope.description}</P>
<Description>{source.scope.description}</Description>
)}

<ComponentDetails
Expand Down

0 comments on commit 6eca400

Please sign in to comment.