From 45c5392b2e7ed068081cd56f3dc05eb672ada26d Mon Sep 17 00:00:00 2001 From: Alex Basson Date: Tue, 5 Oct 2021 11:51:59 -0400 Subject: [PATCH] Style header links to be heavier when active --- app/assets/stylesheets/colors.scss | 4 + app/assets/stylesheets/fonts.scss | 6 +- app/assets/stylesheets/reset.scss | 104 ++++++++++++++++++++ app/assets/stylesheets/sqm_application.scss | 1 + app/helpers/header_helper.rb | 8 ++ app/views/dashboard/index.html.erb | 2 +- app/views/layouts/sqm/_header.html.erb | 4 +- 7 files changed, 122 insertions(+), 7 deletions(-) create mode 100644 app/assets/stylesheets/reset.scss diff --git a/app/assets/stylesheets/colors.scss b/app/assets/stylesheets/colors.scss index cff276f5..4891e08d 100644 --- a/app/assets/stylesheets/colors.scss +++ b/app/assets/stylesheets/colors.scss @@ -29,6 +29,10 @@ $ideal: #C0FF73; color: $white; } +.color-blue { + color: $blue; +} + .bg-color-beige { background-color: $beige; } diff --git a/app/assets/stylesheets/fonts.scss b/app/assets/stylesheets/fonts.scss index 4de5509b..30a49fb4 100644 --- a/app/assets/stylesheets/fonts.scss +++ b/app/assets/stylesheets/fonts.scss @@ -59,8 +59,6 @@ } .link { - @extend .font-cabin; - @extend .weight-600; - font-size: 16px; - color: $blue; + @extend .color-blue; + text-decoration: none; } diff --git a/app/assets/stylesheets/reset.scss b/app/assets/stylesheets/reset.scss new file mode 100644 index 00000000..fb6cfb1c --- /dev/null +++ b/app/assets/stylesheets/reset.scss @@ -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; +} diff --git a/app/assets/stylesheets/sqm_application.scss b/app/assets/stylesheets/sqm_application.scss index d2d0a068..108101b9 100644 --- a/app/assets/stylesheets/sqm_application.scss +++ b/app/assets/stylesheets/sqm_application.scss @@ -11,6 +11,7 @@ $spacers: ( ); @import "bootstrap"; +@import "reset"; @import "fonts"; @import "colors"; @import "borders"; diff --git a/app/helpers/header_helper.rb b/app/helpers/header_helper.rb index 602de338..e9bd6192 100644 --- a/app/helpers/header_helper.rb +++ b/app/helpers/header_helper.rb @@ -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) end + def link_weight(path:) + active?(path: path) ? 'weight-700' : 'weight-400' + end + private 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}" end + def active?(path:) + request.fullpath.include? path + end + end diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb index 065bd99e..a3c42891 100644 --- a/app/views/dashboard/index.html.erb +++ b/app/views/dashboard/index.html.erb @@ -6,7 +6,7 @@

Distance from benchmark

-

This graph shows how much a score is above or below the benchmark of any given scale.

+

This graph shows how much a score is above or below the benchmark of any given scale.

<%= render partial: "variance_graph", locals: { presenters: @presenters } %> diff --git a/app/views/layouts/sqm/_header.html.erb b/app/views/layouts/sqm/_header.html.erb index a638c166..5b119b30 100644 --- a/app/views/layouts/sqm/_header.html.erb +++ b/app/views/layouts/sqm/_header.html.erb @@ -4,10 +4,10 @@

<%= link_to image_tag('logo.png', class: 'height-56'), root_path %>

- Dashboard + Dashboard

- Browse + Browse