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

Add SDG view with related content #4292

Merged
merged 15 commits into from
Dec 28, 2020
Merged
Prev Previous commit
Next Next commit
Use h2 tags in feed headers
We were jumping from h1 to h3 and some of these sections (cards and
processes) had h3 tags inside them.

My best guess is we were using h3 so the titles were smaller. So I'm
adding a CSS mixin to easily use a font size of a different heading tag.
  • Loading branch information
javierm committed Dec 27, 2020
commit 13fbf4e4b31e04705c639ec5d93f4d148c249033
7 changes: 7 additions & 0 deletions app/assets/stylesheets/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2856,6 +2856,13 @@ table {
}
}

h2 {
&.title {
@include header-font-size(h3);
}
}

h2,
h3 {

&.title {
Expand Down
8 changes: 8 additions & 0 deletions app/assets/stylesheets/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,11 @@
text-decoration: none;
}
}

@mixin header-font-size($heading-tag) {
@each $size, $headers in $header-styles {
@include breakpoint($size) {
font-size: rem-calc(map-get(map-get($headers, $heading-tag), font-size));
}
}
}
2 changes: 1 addition & 1 deletion app/components/widgets/feeds/feed_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section id="feed_<%= kind %>" class="widget-feed feed-<%= kind %>">
<header>
<h3 class="title"><%= t("welcome.feed.most_active.#{kind}") %></h3>
<h2 class="title"><%= t("welcome.feed.most_active.#{kind}") %></h2>
</header>

<div class="feed-content">
Expand Down
2 changes: 1 addition & 1 deletion app/views/welcome/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="row">
<% if @cards.any? %>
<div class="small-12 column <%= "large-8" if feed_processes_enabled? %>">
<h3 class="title"><%= t("welcome.cards.title") %></h3>
<h2 class="title"><%= t("welcome.cards.title") %></h2>

<%= render "shared/cards" %>
</div>
Expand Down