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 3 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
36 changes: 34 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,40 @@ <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>
<blockquote class="blockquote" lang="de">
<q
>Lorem ipsum dolor sit amet <q>consectetur adipiscing elit</q>. Integer posuere erat a ante.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</q
>

<figcaption class="blockquote-footer">
Author
<cite>Source</cite>
</figcaption>
</blockquote>

<blockquote class="blockquote" lang="en">
<q
>Lorem ipsum dolor sit amet <q>consectetur adipiscing elit</q>. Integer posuere erat a ante.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</q
>
<figcaption class="blockquote-footer">
Author
<cite>Source</cite>
</figcaption>
</blockquote>

<blockquote class="blockquote" lang="fr">
<q
>Lorem ipsum dolor sit amet <q>consectetur adipiscing elit</q>. Integer posuere erat a ante.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</q
>

<figcaption class="blockquote-footer">
Author
<cite>Source</cite>
</figcaption>
</blockquote>
</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
34 changes: 34 additions & 0 deletions packages/styles/src/components/blockquote.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@use '../tokens/components';
@use '../functions/tokens';
@use './../placeholders/blockquote' as blockquote-ph;

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

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

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

.blockquote {
margin: 0;
padding: 0;
border: none;
}
}

.blockquote-footer {
@extend %body;
myrta2302 marked this conversation as resolved.
Show resolved Hide resolved
margin-top: tokens.get('post-quote-gap-inline');
}
15 changes: 15 additions & 0 deletions packages/styles/src/placeholders/_blockquote.scss
myrta2302 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@use '../tokens/components';
@use '../tokens/elements';
@use '../functions/tokens';

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

%lead {
font-size: tokens.get('post-lead-font-size');
font-weight: tokens.get('post-lead-font-weight');
}

%body {
font-size: tokens.get('post-body-font-size', elements.$post-body);
font-weight: tokens.get('post-body-font-weight', elements.$post-body);
}
1 change: 1 addition & 0 deletions packages/styles/src/placeholders/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
@use './color';
@use './dropdown';
@use './text';
@use './blockquote';
7 changes: 7 additions & 0 deletions packages/styles/tests/components/blockquote.test.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@use 'sass:map';
@use 'sass:meta';
@use 'tests/jest';
@use 'src/components/blockquote';

// Check if component forwards options
@include jest.true(map.has-key(meta.module-variables('blockquote'), 'font-base-path'));
Loading
Loading