Skip to content

Commit b077c6b

Browse files
authored
Merge pull request #123 from w3c/feature/#454-quote-component
Refactor quote component
2 parents ce5458f + 803c7e2 commit b077c6b

File tree

6 files changed

+18
-54
lines changed

6 files changed

+18
-54
lines changed

assets-src/styles/sass/30-base/_quotes.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ blockquote {
2222
margin-top: 1rem;
2323
}
2424

25+
> *:first-child {
26+
margin-top: 0;
27+
}
28+
2529
cite {
2630
color: $off-black;
2731
font-size: 1rem;

assets-src/styles/sass/50-core-components/_quotes.scss

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
.component--quote {
66
@include txt-saturn;
7-
@include stack(1rem);
87
color: $w3c-blue;
98
font-weight: bold;
109
margin-inline-end: 0;
@@ -15,30 +14,13 @@
1514
&::before {
1615
background-color: $w3c-blue;
1716
border-radius: rem(5);
18-
content: '';
19-
height: 100%;
2017
left: rem(-10);
21-
position: absolute;
22-
top: 0;
2318
width: rem(10);
2419
}
2520

2621
> * {
2722
max-width: rem(630);
2823
}
29-
30-
blockquote {
31-
margin-inline-start: 0;
32-
padding: 0;
33-
34-
p:first-of-type {
35-
margin-top: 0;
36-
}
37-
38-
&::before {
39-
display: none;
40-
}
41-
}
4224
}
4325

4426
[dir="rtl"] {
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<figure class="component component--quote">
2-
<blockquote>
3-
<p>The goal of the Web is to serve humanity. We build it now so that those who come to it later will be able to create things we cannot ourselves imagine.</p>
4-
</blockquote>
5-
<figcaption>Sir Tim Berners-Lee</figcaption>
6-
</figure>
1+
<blockquote class="component component--quote">
2+
<p>The goal of the Web is to serve humanity. We build it now so that those who come to it later will be able to create things we cannot ourselves imagine.</p>
3+
<footer>Sir Tim Berners-Lee</footer>
4+
</blockquote>

public/dist/assets/styles/core.css

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,9 @@ blockquote::before {
501501
blockquote > * + * {
502502
margin-top: 1rem;
503503
}
504+
blockquote > *:first-child {
505+
margin-top: 0;
506+
}
504507
blockquote cite {
505508
color: #111;
506509
font-size: 1rem;
@@ -3156,9 +3159,6 @@ main,
31563159
.component--quote {
31573160
font-size: 1.125rem;
31583161
line-height: 1.5;
3159-
display: flex;
3160-
flex-direction: column;
3161-
justify-content: flex-start;
31623162
color: #005a9c;
31633163
font-weight: bold;
31643164
-webkit-margin-end: 0;
@@ -3168,33 +3168,15 @@ main,
31683168
padding: 1.25rem;
31693169
position: relative;
31703170
}
3171-
.component--quote > * + * {
3172-
margin-top: 1rem;
3173-
}
31743171
.component--quote::before {
31753172
background-color: #005a9c;
31763173
border-radius: 0.3125rem;
3177-
content: "";
3178-
height: 100%;
31793174
left: -0.625rem;
3180-
position: absolute;
3181-
top: 0;
31823175
width: 0.625rem;
31833176
}
31843177
.component--quote > * {
31853178
max-width: 39.375rem;
31863179
}
3187-
.component--quote blockquote {
3188-
-webkit-margin-start: 0;
3189-
margin-inline-start: 0;
3190-
padding: 0;
3191-
}
3192-
.component--quote blockquote p:first-of-type {
3193-
margin-top: 0;
3194-
}
3195-
.component--quote blockquote::before {
3196-
display: none;
3197-
}
31983180

31993181
[dir=rtl] .component--quote::before {
32003182
left: auto;

public/dist/assets/styles/core.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
<figure class="component component--quote">
2-
<blockquote>
3-
<p>
4-
{% block text %}{% endblock %}
5-
</p>
6-
</blockquote>
1+
<blockquote class="component component--quote">
2+
<p>
3+
{% block text %}{% endblock %}
4+
</p>
75
{% if author is defined and author is not empty %}
8-
<figcaption>{{ author }}</figcaption>
6+
<footer>{{ author }}</footer>
97
{% endif %}
10-
</figure>
8+
</blockquote>

0 commit comments

Comments
 (0)