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

6650 - MozFest Dark Quote #11539

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some context why this is building a totally new block template over reusing the existing quote block that is mentioned on the ticket? It looks like we are reusing the CSS but not the HTML. Could this be handled as a variant in mostly CSS?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've held some conversations since the ticket was created and it was decided that the dark background was enough to warrant it being a new block - i'll update the ticket to make this clearer.

The dark quote block is heavily based of the existing single_quote_block.html template (https://github.com/MozillaFoundation/foundation.mozilla.org/blob/main/network-api/networkapi/wagtailpages/templates/wagtailpages/blocks/single_quote_block.html) which also contains a mix of tailwind and css classes. Unfortunately we can't use this template directly as it extends
"./base_streamfield_block.html" which wraps everything in a container (https://github.com/MozillaFoundation/foundation.mozilla.org/blob/main/network-api/networkapi/wagtailpages/templates/wagtailpages/blocks/base_streamfield_block.html#L5) meaning we couldn't achieve the full width black background seen in the design.

The main difference between the dark quote block in the design and the existing one is the font size of the quote so i'll check in standup which one we should be following.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed in standup and we're going to follow the styles of the current quote block. Updated here: ad110bc

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I feel like I talked you into less semantic HTML 😭

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% load wagtailcore_tags wagtailimages_tags %}

{% block block_content %}
<div class="tw-py-16 tw-bg-black tw-dark">
<div class="tw-container">
<div class="tw-row tw-justify-center">
<div class="feature-quote">
<div class="quote-content [&_p]:tw-text-white">
{{ self.quote|richtext }}
</div>
<p class="tw-text-gray-40 tw-h6-heading tw-text-lg tw-max-w-4xl">{{ self.cite }}</p>
</div>
</div>
</div>
</div>
{% endblock block_content %}
4 changes: 4 additions & 0 deletions source/sass/wagtail/blocks/feature-quote.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
content: "";
display: block;
margin: 0 auto 10px;

@at-root .tw-dark & {
opacity: 0.3;
}
}

.quote-content .rich-text {
Expand Down