diff --git a/.changeset/tall-socks-train.md b/.changeset/tall-socks-train.md new file mode 100644 index 000000000..11c9b6d6d --- /dev/null +++ b/.changeset/tall-socks-train.md @@ -0,0 +1,5 @@ +--- +'@cloudfour/patterns': minor +--- + +Don't allow line breaks in author names diff --git a/src/components/author/author.scss b/src/components/author/author.scss index 8188a5357..2207b4efd 100644 --- a/src/components/author/author.scss +++ b/src/components/author/author.scss @@ -7,3 +7,10 @@ .c-author { color: var(--theme-color-text-muted); } + +/** + * 1. Prevent breaking inside author names + */ +.c-author__author { + display: inline-block; /* 1 */ +} diff --git a/src/components/author/author.twig b/src/components/author/author.twig index 4a5386eb3..b16ed66f2 100644 --- a/src/components/author/author.twig +++ b/src/components/author/author.twig @@ -62,16 +62,16 @@ {# Author content #}
{# Author links #} -

+

{{ author_prefix|default("By") }} {% block authors %} {% for author in authors %} {% if loop.last and loop.length > 1 %}and {% endif %} - {%- if author.link and not unlink -%} - {{ author.name }} - {%- else -%} - {{ author.name }} - {%- endif -%} + {%- if author.link and not unlink -%} + {{ author.name }} + {%- else -%} + {{ author.name }} + {%- endif -%} {%- if not loop.last and loop.length > 2 %},{% endif %} {% endfor %} {% endblock %}