Skip to content

Commit

Permalink
Fix broken h3 tag
Browse files Browse the repository at this point in the history
Since we're now allowing <h2> and <h3> tags in the description, we
remove the broken <h3> tag from quiz-question class. Since its content
is also in the <title> element, and in order to be consistent with other
show actions in the public area, we change this tag to <h1>.

We add <h2> tag in the "Share" heading and we replace the broken <h4>
tag above adding new styles.
  • Loading branch information
taitus committed Feb 22, 2023
1 parent 8000277 commit b7ee935
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions app/assets/stylesheets/legislation_process.scss
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,14 @@

.quiz-header-title {
font-size: $small-font-size;
font-weight: 700;
margin-bottom: 0;
text-transform: uppercase;
}
}

h4 a {
@include brand-color;

&:hover {
a {
@include brand-color;
@include header-font-size(h4);
font-weight: 700;
text-decoration: none;
}
}
Expand Down Expand Up @@ -232,6 +230,7 @@
}

.quiz-question {
@include header-font-size(h2);
margin-bottom: $line-height;
}

Expand Down
6 changes: 3 additions & 3 deletions app/views/legislation/questions/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="small-12 medium-9 column">
<div class="quiz-title">
<p class="quiz-header-title"><%= t("legislation.questions.show.title") %></p>
<h4><%= link_to @process.title, @process %></h4>
<strong><%= link_to @process.title, @process %></strong>
</div>
</div>
<div class="small-12 medium-3 column">
Expand All @@ -28,7 +28,7 @@
</div>
<div class="row">
<div class="small-12 medium-9 column">
<h3 class="quiz-question"><%= @question.title %></h3>
<h1 class="quiz-question"><%= @question.title %></h1>
<%= AdminWYSIWYGSanitizer.new.sanitize(@question.description) %>
<div class="debate-questions" id="legislation-answer-form">
<%= render "answer_form", process: @process, question: @question, answer: @answer %>
Expand All @@ -37,7 +37,7 @@

<aside class="small-12 medium-3 column">
<div id="social-share" class="sidebar-divider"></div>
<h3><%= t("legislation.questions.show.share") %></h3>
<h2><%= t("legislation.questions.show.share") %></h2>
<%= render "/shared/social_share", title: @question.title, url: legislation_process_question_url(@question.process, @question) %>
</aside>
</div>
Expand Down

0 comments on commit b7ee935

Please sign in to comment.