-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VOTE-2880/2881: Configure and style call out box (#1047)
- Loading branch information
1 parent
f1a9963
commit a110d94
Showing
5 changed files
with
90 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
web/themes/custom/votegov/src/sass/components/call-out-box.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@use "uswds-core" as *; | ||
@use "variables" as *; | ||
@use "mixins" as *; | ||
|
||
.vote-call-out-box { | ||
@include u-padding(4); | ||
@include u-margin-bottom(6); | ||
background-color: $bg-light-cool; | ||
|
||
@include at-media('tablet') { | ||
@include u-radius('lg'); | ||
} | ||
|
||
@include at-media-max('tablet') { | ||
@include u-padding-x(3); | ||
@include u-margin-x(-3); | ||
} | ||
} | ||
|
||
.vote-call-out-box--offset { | ||
@include u-margin-top(-4); | ||
|
||
@include at-media('tablet') { | ||
margin-top: -6rem; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
web/themes/custom/votegov/templates/component/call-out-box.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{# | ||
/** | ||
* @file | ||
* Default theme implementation to Call out box component. | ||
* | ||
* Template variables: | ||
* - heading: string | ||
* - text: string | ||
* - link_url: string | ||
* - link_text: string or uri | ||
* | ||
* Usage example: | ||
* {% include '@votegov/component/call-out-box.html.twig' with { | ||
* 'heading': var_heading, | ||
* 'text': var_text, | ||
* 'link_url': var_uri, | ||
* 'link_text': var_link_text | ||
* } %} | ||
* | ||
#} | ||
|
||
{% if link_url %} | ||
{% set link_markup %} | ||
<a href={{ link_url }}>{{ link_text }}</a> | ||
{% endset %} | ||
{% endif %} | ||
|
||
<div class="vote-call-out-box vote-call-out-box--offset"> | ||
<h2>{{ heading }}</h2> | ||
{{ text | t({'@link': {'#markup': link_markup } | render }) }} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters