Skip to content

Commit 915d963

Browse files
fix: fixed typography, display and links sections
1 parent 70673e4 commit 915d963

File tree

8 files changed

+47
-14
lines changed

8 files changed

+47
-14
lines changed

styles/css/core/variables.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@
143143
--pgn-typography-font-size-h1-mobile: 2.25rem; /* Mobile font size of heading level 1. */
144144
--pgn-typography-font-size-h1-base: 2.5rem; /* Base font size of heading level 1. */
145145
--pgn-typography-font-size-micro: 0.688rem; /* Micro utils text font size. */
146-
--pgn-typography-font-size-xs: 0.75rem; /* X-small font size. */
147-
--pgn-typography-font-size-sm: 0.875rem; /* Small font size. */
146+
--pgn-typography-font-size-xs: 75%; /* X-small font size. */
147+
--pgn-typography-font-size-sm: 87.5%; /* Small font size. */
148148
--pgn-typography-font-size-lg: calc(var(--pgn-typography-font-size-base) * 1.25); /* Lead text font size. */
149149
--pgn-typography-font-size-base: 1.125rem; /* Base font size. */
150150
--pgn-typography-font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; /* Monospace font family. */

tokens/src/core/global/typography.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@
4141
},
4242
"sm": {
4343
"source": "$small-font-size",
44-
"$value": ".875rem",
44+
"$value": "87.5%",
4545
"$description": "Small font size."
4646
},
4747
"xs": {
4848
"source": "$x-small-font-size",
49-
"$value": ".75rem",
49+
"$value": "75%",
5050
"$description": "X-small font size."
5151
},
5252
"micro": {

www/src/components/Menu.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
margin-bottom: var(--pgn-spacing-spacer-base);
4141

4242
.pgn_collapsible {
43-
font-size: var(--pgn-typography-font-size-xs);
43+
font-size: var(--pgn-typography-font-size-sm);
4444
line-height: var(--pgn-typography-headings-line-height);
4545
font-weight: var(--pgn-typography-font-weight-normal);
4646
color: var(--pgn-color-gray-700);
@@ -86,7 +86,6 @@
8686
}
8787

8888
.collapsible-basic .collapsible-trigger {
89-
font-size: var(--pgn-typography-font-size-sm);
9089
text-decoration: none;
9190
justify-content: start;
9291
flex-direction: row-reverse;

www/src/components/_doc-elements.scss

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,3 +342,37 @@
342342
grid-template-columns: repeat(4, 1fr); // 4 columns for large+ screens
343343
}
344344
}
345+
346+
.pgn-doc__code-display-block,
347+
.pgn-doc__code-headings-block {
348+
.pgn__data-table-cell-wrap {
349+
max-width: max-content;
350+
}
351+
352+
@media (--pgn-size-breakpoint-max-width-md) {
353+
overflow: hidden;
354+
overflow-x: scroll;
355+
356+
.pgn__data-table-layout-wrapper {
357+
overflow-x: initial;
358+
}
359+
}
360+
361+
.heading-label {
362+
font-size: var(--pgn-typography-font-size-base);
363+
line-height: var(--pgn-typography-line-height-base);
364+
}
365+
}
366+
367+
.pgn-doc__code-body-block {
368+
.lead,
369+
.font-size-normal,
370+
.small,
371+
.x-small {
372+
line-height: var(--pgn-typography-line-height-base);
373+
}
374+
375+
.pgn__data-table-wrapper {
376+
font-size: inherit;
377+
}
378+
}

www/src/components/typography-page/Body.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function Body() {
1515
return (
1616
<>
1717
<h2 className="mb-2">Body</h2>
18-
<div className="mb-4">
18+
<div className="mb-4 pgn-doc__code-body-block">
1919
<DataTable
2020
itemCount={bodyClassesAndDescriptions.length}
2121
data={bodyClassesAndDescriptions}

www/src/components/typography-page/Display.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function Display() {
1010
return (
1111
<>
1212
<h2 className="mb-2">Display</h2>
13-
<div className="mb-4">
13+
<div className="mb-4 pgn-doc__code-display-block">
1414
<DataTable
1515
itemCount={displaySizes.length}
1616
data={displaySizes.map((size) => ({ text: `Display ${size}`, className: `display-${size}` }))}

www/src/components/typography-page/Headings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function Headings() {
1818
return (
1919
<>
2020
<h2 className="mb-2">Headings</h2>
21-
<div className="mb-4">
21+
<div className="mb-4 pgn-doc__code-headings-block">
2222
<DataTable
2323
itemCount={tableData.length}
2424
data={tableData}

www/src/components/typography-page/Links.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import React from 'react';
22
// @ts-ignore
3-
import { DataTable } from '~paragon-react';
3+
import { DataTable, Alert } from '~paragon-react';
4+
import { Info } from '~paragon-icons';
45
import { TextCell } from '../TableCells';
56

67
const linksClassesAndDescriptions = [
7-
{
8-
example: <a href="/#">Standalone Link</a>,
9-
description: <span>The default style for <code>a</code> tags that don`t appear in a <code>p</code> tag.</span>,
10-
},
118
{
129
example: <span>An <a className="inline-link" href="/foundations/typography/">inline link</a> in a sentence.</span>,
1310
description: <span>For links inside a <code>p</code> or with the <code>.inline-link</code> class name.</span>,
@@ -34,6 +31,9 @@ export default function Links() {
3431
return (
3532
<>
3633
<h2 className="mb-2">Links</h2>
34+
<Alert variant="info" icon={Info}>
35+
<a href="/#">Standalone Link</a> - the default style for <code>a</code> tag that appear outside of <code>p</code> tag.
36+
</Alert>
3737
<div className="mb-4">
3838
<DataTable
3939
itemCount={4}

0 commit comments

Comments
 (0)