Style navigation a bit

This commit is contained in:
Charlotte Van Petegem 2025-05-23 17:11:53 +02:00
parent 32557190bd
commit fbcea15e35
Signed by: chvp
SSH key fingerprint: SHA256:s9rb8jBVfdahqWHuBAcHCBP1wmj4eYQXZfqgz4H3E9E
3 changed files with 29 additions and 4 deletions

View file

@ -21,6 +21,29 @@ h4 {
padding: 6rem 4rem;
}
header {
display: flex;
gap: 1rem;
align-items: center;
}
.section-link {
word-break: keep-all;
white-space: nowrap;
color: black;
text-transform: uppercase;
font-weight: 500;
padding: 1rem 0.5rem;
line-height: 2.125rem;
text-underline-offset: 0.25rem;
text-decoration-line: none;
text-decoration-thickness: 0.125rem;
}
.section-link-active {
text-decoration-line: underline;
}
.title-card-grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr;

View file

@ -1,6 +1,6 @@
class ApplicationController < ActionController::Base
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
allow_browser versions: :modern
# allow_browser versions: :modern
before_action :require_authorization

View file

@ -1,7 +1,9 @@
<% content_for(:header) do %>
<div class="section-links">
<% @sections.each do |section| %>
<%= link_to section.title, section_url(section) %>
<%= link_to section.title, section_url(section), html_options = { class: { "section-link": true, "section-link-active": current_page?(section_url(section)) } } %>
<% end %>
</div>
<% end %>
<h4><%= @section.title %></h4>