Style header links to be heavier when active

pull/1/head
Alex Basson 4 years ago
parent 8da3194e26
commit 45c5392b2e

@ -29,6 +29,10 @@ $ideal: #C0FF73;
color: $white; color: $white;
} }
.color-blue {
color: $blue;
}
.bg-color-beige { .bg-color-beige {
background-color: $beige; background-color: $beige;
} }

@ -59,8 +59,6 @@
} }
.link { .link {
@extend .font-cabin; @extend .color-blue;
@extend .weight-600; text-decoration: none;
font-size: 16px;
color: $blue;
} }

@ -0,0 +1,104 @@
// reset.css
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
border: 0;
font: inherit;
font-size: 100%;
margin: 0;
padding: 0;
vertical-align: baseline;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}

@ -11,6 +11,7 @@ $spacers: (
); );
@import "bootstrap"; @import "bootstrap";
@import "reset";
@import "fonts"; @import "fonts";
@import "colors"; @import "colors";
@import "borders"; @import "borders";

@ -16,6 +16,10 @@ module HeaderHelper
dashboard_link(district_slug: school.district.slug, school_slug: school.slug, academic_year_range: academic_year.range, uri_path: request.fullpath) dashboard_link(district_slug: school.district.slug, school_slug: school.slug, academic_year_range: academic_year.range, uri_path: request.fullpath)
end end
def link_weight(path:)
active?(path: path) ? 'weight-700' : 'weight-400'
end
private private
def dashboard_link(district_slug:, school_slug:, academic_year_range:, uri_path:) def dashboard_link(district_slug:, school_slug:, academic_year_range:, uri_path:)
@ -25,4 +29,8 @@ module HeaderHelper
"/districts/#{district_slug}/schools/#{school_slug}/browse/teachers-and-leadership?year=#{academic_year_range}" "/districts/#{district_slug}/schools/#{school_slug}/browse/teachers-and-leadership?year=#{academic_year_range}"
end end
def active?(path:)
request.fullpath.include? path
end
end end

@ -6,7 +6,7 @@
<div> <div>
<h2 class="h1 color-red">Distance from benchmark</h2> <h2 class="h1 color-red">Distance from benchmark</h2>
<p class="body-large">This graph shows how much a score is above or below the benchmark of any given scale.</p> <p class="body-large mb-6">This graph shows how much a score is above or below the benchmark of any given scale.</p>
</div> </div>
<%= render partial: "variance_graph", locals: { presenters: @presenters } %> <%= render partial: "variance_graph", locals: { presenters: @presenters } %>

@ -4,10 +4,10 @@
<div class="col d-flex justify-content-start align-items-center"> <div class="col d-flex justify-content-start align-items-center">
<p class="me-6"><%= link_to image_tag('logo.png', class: 'height-56'), root_path %></p> <p class="me-6"><%= link_to image_tag('logo.png', class: 'height-56'), root_path %></p>
<p class="me-4"> <p class="me-4">
<a class="h3" href="<%= link_to_dashboard(district: @district, school: @school, academic_year: @academic_year) %>">Dashboard</a> <a class="h3 link <%= link_weight(path: 'dashboard') %>" href="<%= link_to_dashboard(district: @district, school: @school, academic_year: @academic_year) %>">Dashboard</a>
</p> </p>
<p> <p>
<a class="h3" href="<%= link_to_browse(district: @district, school: @school, academic_year: @academic_year) %>">Browse</a> <a class="h3 link <%= link_weight(path: 'browse') %>" href="<%= link_to_browse(district: @district, school: @school, academic_year: @academic_year) %>">Browse</a>
</p> </p>
</div> </div>

Loading…
Cancel
Save