Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add paragraph style #3569

Merged
merged 24 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7f07a15
feat: add paragraph style
Sep 23, 2024
766a861
Merge branch 'main' into 3416-foundations-typography--paragraph
bashirkarimi Sep 23, 2024
0cd8802
feat: add paragraph style
Sep 23, 2024
af02388
feat: add story for paragraph
Sep 23, 2024
b9c3626
chore: edit text
Sep 23, 2024
84dace9
Merge branch 'main' into 3416-foundations-typography--paragraph
bashirkarimi Sep 23, 2024
52ec3d0
feat: add changeset for paragraph element
Sep 23, 2024
cd81451
Merge branch 'main' into 3416-foundations-typography--paragraph
bashirkarimi Sep 25, 2024
aeb8647
Merge branch 'main' into 3416-foundations-typography--paragraph
bashirkarimi Sep 25, 2024
c231ce8
Update .changeset/sixty-items-promise.md
bashirkarimi Sep 25, 2024
4ad01de
Update packages/styles/src/elements/paragraph.scss
bashirkarimi Sep 25, 2024
7e8310d
Merge branch 'main' into 3416-foundations-typography--paragraph
gfellerph Sep 27, 2024
d96a887
Merge branch 'main' into 3416-foundations-typography--paragraph
Sep 30, 2024
f68fc9c
chore: move paragraph element to Typography category
Oct 2, 2024
3297e30
Update .changeset/strange-bottles-impress.md
bashirkarimi Oct 4, 2024
5858f8b
chore: move the story under foundation category
Oct 4, 2024
b56d650
Update packages/styles/src/elements/paragraph.scss
bashirkarimi Oct 7, 2024
0bc7f1d
Update packages/documentation/src/stories/elements/paragraph/paragrap…
bashirkarimi Oct 7, 2024
97c8082
feat: add decorator
Oct 7, 2024
711e2c2
style: format code
Oct 7, 2024
76e8778
Merge branch 'main' into 3416-foundations-typography--paragraph
bashirkarimi Oct 7, 2024
ab66108
Merge branch 'main' into 3416-foundations-typography--paragraph
bashirkarimi Oct 14, 2024
b8e38d9
fix: remove key property
Oct 14, 2024
1d463c2
chore: add margin block and remove space from last child
Oct 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/sixty-items-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': minor
---

Added paragraph style.
5 changes: 5 additions & 0 deletions .changeset/strange-bottles-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-documentation': minor
---

Added paragraph element
bashirkarimi marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Canvas, Controls, Meta } from '@storybook/blocks';
import * as ParagraphStories from './paragraph.stories';
import StylesPackageImport from '@/shared/styles-package-import.mdx';

<Meta of={ParagraphStories} />

<div className="docs-title">
# Paragraph

<nav>
<link-design of={JSON.stringify(ParagraphStories)}></link-design>
</nav>
</div>

Default paragraph without size variants.

<Canvas of={ParagraphStories.Default} sourceState="shown" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import type { StoryObj } from '@storybook/web-components';
import { html } from 'lit';
import { MetaExtended } from '@root/types';

const meta: MetaExtended = {
id: '7ecd87f1-de96-4e39-a057-ba1798eb69593',
title: 'Typography/Paragraph',
parameters: {
badges: [],
design: {
type: 'figma',
url: 'https://www.figma.com/design/JIT5AdGYqv6bDRpfBPV8XR/Foundations-%26-Components-Next-Level?node-id=26-49',
bashirkarimi marked this conversation as resolved.
Show resolved Hide resolved
},
},
};

export default meta;

type Story = StoryObj;

export const Default: Story = {
bashirkarimi marked this conversation as resolved.
Show resolved Hide resolved
render: () => html`
<p>
This is a paragraph. It is a block of text that is separated from other blocks of text by a
blank line. It is usually indented at the beginning of the first line. The first word of a
paragraph is often indented more than the rest of the paragraph.
</p>
<p>
This is a paragraph. It is a block of text that is separated from other blocks of text by a
blank line. It is usually indented at the beginning of the first line. The first word of a
paragraph is often indented more than the rest of the paragraph.
</p>
bashirkarimi marked this conversation as resolved.
Show resolved Hide resolved
`,
};
1 change: 1 addition & 0 deletions packages/styles/src/elements/_index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use 'reset';
@use 'body';
@use 'paragraph';
@use 'heading';
9 changes: 9 additions & 0 deletions packages/styles/src/elements/paragraph.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@use 'sass:map';
@use '../functions/tokens';
@use '../tokens/elements';

tokens.$default-map: elements.$post-paragraph;

p {
margin-block-start: tokens.get('paragraph', 'margin-block-start');
bashirkarimi marked this conversation as resolved.
Show resolved Hide resolved
}