Skip to content

Commit

Permalink
add center_content option to intro section
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonccox committed Nov 22, 2019
1 parent c99b439 commit c4d5a68
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ The `intro` template is used to create an introduction section within a modular
- `use_footer_links` - Whether the `footer_links` from the site-wide customization should also appear in this section. See the *Customization* section below for more information about `footer_links`.
- `links` - A list of icon links to be displayed. Each link needs to specify a `link` (the URL to which it points) and an `icon` (Font-Awesome CSS classes, such as `fas fa-code`). These links will be displayed after the `footer_links` if `use_footer_links` is true.
- `img_alt` - The alt text to be used for the image in this section.
- `center_content` - If true, the content (not the Custom Intro Image) will be centered instead of left-aligned.

#### About

Expand Down
12 changes: 12 additions & 0 deletions blueprints/modular/intro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,15 @@ form:
label: Alt Text
validate:
type: textarea

header.center_content:
type: toggle
label: Center Content
highlight: 1
default: 0
description: If activated, the content (not the Custom Intro Image) will be centered instead of left-aligned.
options:
1: PLUDIN_ADMIN.YES
0: PLUDIN_ADMIN.NO
validate:
type: bool
2 changes: 1 addition & 1 deletion css-compiled/theme.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css-compiled/theme.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions scss/util.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@
margin-right: auto;
}

.center-text {
text-align: center;
}

// css variables

:root {
Expand Down
2 changes: 1 addition & 1 deletion templates/modular/intro.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{ image.html('', page.header.img_alt, 'intro__img')|raw }}
{% endif %}

<div class="intro__content {% if image %} with-img {% endif %}">
<div class="intro__content {% if image %} with-img {% endif %} {% if page.header.center_content %} center-text {% endif %}">
{{ content|raw }}

<div class="intro__links">
Expand Down

0 comments on commit c4d5a68

Please sign in to comment.