Skip to content

Commit

Permalink
Merge pull request #488 from localgovdrupal/1.x
Browse files Browse the repository at this point in the history
1.4.15 release
  • Loading branch information
finnlewis committed Oct 2, 2023
2 parents 3cc7de2 + e7a7b76 commit 89e3bf5
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 13 deletions.
13 changes: 13 additions & 0 deletions css/components/guide-nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,16 @@
display: inline;
font-weight: bold;
}

.lgd-guide-nav__list-item--active {
font-weight: bold;
}

.lgd-guide-nav__list-item > a {
font-weight: normal;
}

.block-localgov-guides-contents {
margin-top: var(--spacing-largest);
margin-bottom: var(--spacing-largest);
}
14 changes: 14 additions & 0 deletions css/components/prev-next.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ ul.lgd-prev-next__list li.lgd-prev-next__list-item {

.lgd-prev-next__link {
display: flex;
flex-wrap: wrap;
text-decoration: none;
align-items: center;
padding: var(--button-padding-vertical) var(--button-padding-horizontal) var(--button-padding-vertical) var(--button-padding-horizontal);
color: var(--button-text-color);
Expand All @@ -28,6 +30,18 @@ ul.lgd-prev-next__list li.lgd-prev-next__list-item {
background-color: var(--button-bg--color-hover);
}

.lgd-prev-next__label {
font-weight: bold;
}

.lgd-prev-next__title {
width: 100%;
}

.lgd-prev-next__list-item--prev .lgd-prev-next__title {
padding-left: var(--spacing-large);
}

.lgd-prev-next__icon path {
fill: var(--button-icon-color);
}
Expand Down
2 changes: 1 addition & 1 deletion localgov_base.theme
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function localgov_base_preprocess_file_link(&$variables) {
* Implements hook_views_pre_render().
*/
function localgov_base_views_pre_render(ViewExecutable $view) {
if (isset($view) && ($view->storage->id() == 'localgov_sitewide_search')) {
if ($view->storage->id() == 'localgov_sitewide_search') {
$view->element['#attached']['library'][] = 'localgov_base/sitewide-search';
}
}
Expand Down
37 changes: 25 additions & 12 deletions templates/block/guides-prev-next-block.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

{%
set classes = [
'lgd-prev-next',
'lgd-prev-next--guides',
]
'lgd-prev-next',
'lgd-prev-next--guides',
]
%}

{% if not localgov_base_remove_css %}
Expand All @@ -18,30 +18,43 @@

{% set previous_icon = 'chevron-left' %}
{% set next_icon = 'chevron-right' %}

<nav{{attributes.addClass(classes)}}>
<ul class="lgd-prev-next__list">
{% if previous_url %}
<li class="lgd-prev-next__list-item lgd-prev-next__list-item--prev">
<a href="{{ previous_url }}#lgd-guides__title" class="lgd-prev-next__link lgd-prev-next__link--prev" aria-label="{{ 'Previous'|t }}: {{ previous_title }}">
{% include "@localgov_base/includes/icons/icon.html.twig" with {
icon_name: previous_icon,
icon_classes: 'lgd-prev-next__icon lgd-prev-next__icon--prev',
}
icon_name: previous_icon,
icon_classes: 'lgd-prev-next__icon lgd-prev-next__icon--prev',
}
%}
{{ 'Previous'|t }}
<div class="lgd-prev-next__label">
{{ 'Previous'|t }}
</div>
{% if show_title == 1 %}
<div class="lgd-prev-next__title">
{{ previous_title }}
</div>
{% endif %}
</a>
</li>
{% endif %}
{% if next_url %}
<li class="lgd-prev-next__list-item lgd-prev-next__list-item--next">
<a href="{{ next_url }}#lgd-guides__title" class="lgd-prev-next__link lgd-prev-next__link--next" aria-label="{{ 'Next'|t }}: {{ next_title }}">
{{ 'Next'|t }}
<div class="lgd-prev-next__label">
{{ 'Next'|t }}
</div>
{% include "@localgov_base/includes/icons/icon.html.twig" with {
icon_name: next_icon,
icon_classes: 'lgd-prev-next__icon lgd-prev-next__icon--next',
}
icon_name: next_icon,
icon_classes: 'lgd-prev-next__icon lgd-prev-next__icon--next',
}
%}
{% if show_title == 1 %}
<div class="lgd-prev-next__title">
{{ next_title }}
</div>
{% endif %}
</a>
</li>
{% endif %}
Expand Down

0 comments on commit 89e3bf5

Please sign in to comment.