Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve HTML structure for additional guidance #581

Merged
merged 3 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/frontend/entrypoints/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ $govuk-global-styles: true;
@import "govuk/all";
@import "../styles/app_select_options";
@import "../styles/app_summary_card";
@import "../styles/app_markdown_example_block";
@import "../../components/task_list_component/";
@import "../../components/page_list_component/";
@import "../../components/header_component/";
10 changes: 10 additions & 0 deletions app/frontend/styles/_app_markdown_example_block.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.app-markdown-example-block {
white-space: pre-wrap;
font-size: inherit;
font-family: inherit;

&__code {
font-size: inherit;
font-family: inherit;
}
}
28 changes: 17 additions & 11 deletions app/views/pages/additional_guidance.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,24 @@

<%= f.govuk_submit (additional_guidance_form.additional_guidance_markdown.blank? ? t("guidance.preview_guidance") : t("guidance.update_preview")), secondary: true, name: :preview_markdown %>

<%= govuk_details(summary_text: "<h2 class='govuk-!-font-size-19 govuk-!-margin-0 govuk-!-font-weight-regular'>#{t("guidance.formatting_help.heading")}</h2>".html_safe) do %>

<% %w[links second_level_headings third_level_headings bulleted_lists numbered_lists].each do |format_name| %>
<h3 class="govuk-heading-m"><%= t("guidance.formatting_help.#{format_name}.heading") %></h3>

<p><%= simple_format(t("guidance.formatting_help.#{format_name}.instructions")) %></p>

<%= govuk_inset_text do %>
<%= simple_format(t("guidance.formatting_help.#{format_name}.example")) %>
<details class="govuk-details" data-module="govuk-details">
<summary class="govuk-details__summary">
<h2 class='govuk-details__summary-text govuk-!-font-size-19 govuk-!-margin-0 govuk-!-font-weight-regular'>
<%= t("guidance.formatting_help.heading") %>
</h2>
</summary>
<div class="govuk-details__text">
<% %w[links second_level_headings third_level_headings bulleted_lists numbered_lists].each do |format_name| %>
<h3 class="govuk-heading-m"><%= t("guidance.formatting_help.#{format_name}.heading") %></h3>

<%= simple_format(t("guidance.formatting_help.#{format_name}.instructions")) %>

<%= govuk_inset_text do %>
<pre class="app-markdown-example-block"><code class="app-markdown-example-block__code"><%= t("guidance.formatting_help.#{format_name}.example") %></code ></pre>
<% end %>
<% end %>
<% end %>
<% end %>
</div>
</details>

<% if preview_html.present? %>
<h2 class="govuk-heading-m"><%= t("guidance.preview.heading") %></h2>
Expand Down