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(styles): create blockquote component #3882

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
83cc27d
feat(styles): create blockquote component
myrta2302 Nov 5, 2024
fd48947
Merge branch 'main' into 3665-component-blockquotes
myrta2302 Nov 5, 2024
f4d2f10
updated html structure and css
myrta2302 Nov 5, 2024
ca4bd5d
review comments update
myrta2302 Nov 5, 2024
bb7a6cd
test
myrta2302 Nov 5, 2024
ded5ead
minor
myrta2302 Nov 5, 2024
fe0c08e
Merge branch 'main' into 3665-component-blockquotes
myrta2302 Nov 5, 2024
09d321d
fixed error
myrta2302 Nov 5, 2024
bc89dbe
Merge branch '3665-component-blockquotes' of https://github.com/swiss…
myrta2302 Nov 5, 2024
530ed75
remove test
myrta2302 Nov 5, 2024
155ca68
add dark scheme attr
myrta2302 Nov 5, 2024
2204b7f
Merge branch 'main' into 3665-component-blockquotes
myrta2302 Nov 7, 2024
9d72150
discussion updates
myrta2302 Nov 11, 2024
d866a5d
fix lint error
myrta2302 Nov 11, 2024
60da30d
Merge branch 'main' into 3665-component-blockquotes
myrta2302 Nov 11, 2024
de1a113
Merge branch 'main' into 3665-component-blockquotes
myrta2302 Nov 11, 2024
f01a2ae
token rename update
myrta2302 Nov 11, 2024
3a6256c
revert index.html
myrta2302 Nov 11, 2024
46323af
error fix
myrta2302 Nov 11, 2024
7c4b979
Merge branch 'main' into 3665-component-blockquotes
myrta2302 Nov 11, 2024
c6851d6
Revert "revert index.html"
myrta2302 Nov 12, 2024
82c3632
review comments update
myrta2302 Nov 12, 2024
9dbbd0b
Reapply "revert index.html"
myrta2302 Nov 12, 2024
e97e5f5
Revert changes to index.html
myrta2302 Nov 12, 2024
13b3630
test correction
myrta2302 Nov 12, 2024
535f934
Merge branch 'main' into 3665-component-blockquotes
myrta2302 Nov 12, 2024
6f1a773
add changeset
myrta2302 Nov 12, 2024
bdbb0db
Update .changeset/twenty-items-drum.md
myrta2302 Nov 14, 2024
6f5a7ff
Merge branch 'main' into 3665-component-blockquotes
myrta2302 Nov 14, 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
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import StylesPackageImport from '@/shared/styles-package-import.mdx';
<div className="lead">
For quoting blocks of content from another source within your document. Wrap `
<blockquote
className="blockquote">` around any HTML as the quote.
class="blockquote">` along with a `<q>` around any HTML as the quote.
myrta2302 marked this conversation as resolved.
Show resolved Hide resolved
</div>

<Canvas sourceState="shown" of={BlockquoteStories.Default} />
Expand All @@ -24,7 +24,7 @@ import StylesPackageImport from '@/shared/styles-package-import.mdx';
<Controls of={BlockquoteStories.Default} />
</div>

<StylesPackageImport components={["blockquote"]} />
<StylesPackageImport components={['blockquote']} />

## Concrete Examples of Application

Expand All @@ -33,6 +33,7 @@ The following examples show the different characteristics of the component. Thes
### Nested

To add simple quote characters around any nested text within your blockquote, you can wrap it with a

<code>&lt;q&gt;</code> tag.

<Canvas of={BlockquoteStories.Nested} />
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ export const Blockquote: Story = {
render: (_args: Args, context: StoryContext) => {
return html`
<div class="d-flex flex-wrap align-items-start gap-16">
${['bg-white', 'bg-dark'].map(
${['white', 'dark'].map(
bg => html`
<div class="${bg} d-flex flex-wrap align-items-start gap-16 p-16">
<div
data-color-scheme="${bg}"
myrta2302 marked this conversation as resolved.
Show resolved Hide resolved
class="bg-${bg} d-flex flex-wrap align-items-start gap-16 p-16"
>
${bombArgs({
text: [
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Vero mollitia magnam quo quam saepe. Aliquam tempore non deleniti culpa reprehenderit.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const meta: MetaComponent = {
args: {
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.',
language: 'en',
caption: false,
caption: true,
captionAuthor: 'Author',
captionSource: 'Source',
},
Expand All @@ -34,7 +34,7 @@ const meta: MetaComponent = {
},
language: {
name: 'Language',
description: 'The documents language.',
description: "The document's language.",
control: {
type: 'radio',
labels: {
Expand Down
2 changes: 0 additions & 2 deletions packages/styles/index.html
myrta2302 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ <h1>Styles package playground</h1>
<option value="internal">Post internal</option>
</select>
<hr />

<!-- Place your component markup here -->
<button class="btn btn-primary">Primary button</button>
</body>
</html>
1 change: 1 addition & 0 deletions packages/styles/src/components/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
@use 'avatar';
@use 'badge';
@use 'breadcrumb';
@use 'blockquote';
@use 'button';
@use 'button-group';
@use 'card';
Expand Down
38 changes: 38 additions & 0 deletions packages/styles/src/components/blockquote.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@use '../tokens/components';
@use '../functions/tokens';

tokens.$default-map: components.$post-blockquote;

.blockquote {
myrta2302 marked this conversation as resolved.
Show resolved Hide resolved
font-size: tokens.get('post-blockquote-font-size');
font-weight: tokens.get('post-blockquote-font-weight');
margin: tokens.get('post-blockquote-margin-block') tokens.get('post-blockquote-margin-inline');
padding: 0 tokens.get('post-blockquote-padding-inline-end') 0
tokens.get('post-blockquote-padding-inline-start');
border-inline-start: tokens.get('post-blockquote-border-width-left')
tokens.get('post-blockquote-border-left-style') tokens.get('post-blockquote-border-left-color');
}

figure:has(.blockquote) {
margin: tokens.get('post-blockquote-margin-block') tokens.get('post-blockquote-margin-inline');
padding: 0 tokens.get('post-blockquote-padding-inline-end') 0
tokens.get('post-blockquote-padding-inline-start');
border-inline-start: tokens.get('post-blockquote-border-width-left')
tokens.get('post-blockquote-border-left-style') tokens.get('post-blockquote-border-left-color');

.blockquote {
margin: 0;
padding: 0;
border-width: 0;
border-style: none;
border-color: transparent;
}
}

figcaption.blockquote-footer {
margin-top: tokens.get('post-blockquote-gap-inline');

cite {
font-style: normal;
myrta2302 marked this conversation as resolved.
Show resolved Hide resolved
}
}