From fc2afbe044cdcadfef24c9bc283abe44e5a536d2 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Fri, 15 Nov 2019 16:45:01 +0000 Subject: [PATCH 1/3] Increase line-height for in s Text in our `` elements is larger than the default Transport font on OSX, due to it using the Monaco font. This creates a taller formatting box for each line of text it has. We set a smaller font-size, and line-height in ``s. This works for Transport but text in `` sections appears squashed vertically. This sets the line-height for `` to match that of content outside tables, to stop it squashing up. This has been tested with Consolas (the font Windows uses for ``) and all other fallbacks. --- lib/assets/stylesheets/modules/_technical-documentation.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/assets/stylesheets/modules/_technical-documentation.scss b/lib/assets/stylesheets/modules/_technical-documentation.scss index 8c3cdee5..cc76de64 100644 --- a/lib/assets/stylesheets/modules/_technical-documentation.scss +++ b/lib/assets/stylesheets/modules/_technical-documentation.scss @@ -139,6 +139,8 @@ font-family: monaco, Consolas, "Lucida Console", monospace; font-size: 15px; font-size: 0.9375rem; + // Match the line-height outside of tables + line-height: 1.4; color: $code-0E; @include govuk-media-query(tablet) { From b95449f1981e5fb2a9b525f81536a7d9151d439d Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Tue, 19 Nov 2019 17:20:54 +0000 Subject: [PATCH 2/3] Add CHANGELOG entry for pull request #162 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b844f00b..af9b5d76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,15 @@ ## Unreleased +### Fixes + +- [Pull request #162: Fix line height spacing for multiline code elements](https://github.com/alphagov/tech-docs-gem/pull/162) +- [Pull request #165: Update header alignment to match layout](https://github.com/alphagov/tech-docs-gem/pull/165) + ## 2.0.10 +### Fixes + - [Pull request #160: Make sure IDs on collapsible navigation are unique](https://github.com/alphagov/tech-docs-gem/pull/160) ## 2.0.9 From 31f551fd57f5ff4732f955c0cda73bcb8ab7d97b Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Thu, 21 Nov 2019 11:56:10 +0000 Subject: [PATCH 3/3] Add example of `` in `` --- example/source/code.html.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/example/source/code.html.md b/example/source/code.html.md index 2e860a33..438adfec 100644 --- a/example/source/code.html.md +++ b/example/source/code.html.md @@ -8,6 +8,35 @@ A paragraph with a `code` element within it. code element within a link +An example of a table with a `code` element within it. + +
+
+ + + + + + + + + + + + + + +
httpResultMessageHow to fix
400 + [{ +
+ "error": "BadRequestError", +
+ "message": "Can't send to this recipient using a team-only API key" +
+ ]} +
Use the correct type of API key
+ + An example of a code block with a long line length ```ruby @@ -32,4 +61,4 @@ An example of a code block with a short length ```ruby RSpec.describe ContentItem do end -``` \ No newline at end of file +```