From dc9c10b58fa80e894900b56376e648a7326bc739 Mon Sep 17 00:00:00 2001 From: Alex Basson Date: Thu, 23 Sep 2021 10:57:18 -0400 Subject: [PATCH] Use bootstrap to style dashboard --- app/assets/stylesheets/_sizes.scss | 8 ---- app/assets/stylesheets/_variables.scss | 2 +- app/assets/stylesheets/application.scss | 12 +++++- app/assets/stylesheets/borders.scss | 4 +- app/assets/stylesheets/spacing.scss | 55 ------------------------- app/views/dashboard/index.html.erb | 12 +++--- 6 files changed, 19 insertions(+), 74 deletions(-) delete mode 100644 app/assets/stylesheets/_sizes.scss delete mode 100644 app/assets/stylesheets/spacing.scss diff --git a/app/assets/stylesheets/_sizes.scss b/app/assets/stylesheets/_sizes.scss deleted file mode 100644 index 8028dd36..00000000 --- a/app/assets/stylesheets/_sizes.scss +++ /dev/null @@ -1,8 +0,0 @@ -$unit: 8px; - -$xsmall: $unit / 4; // 2px -$small: $unit / 2; // 4px -$medium: $unit; // 8px -$large: $unit * 2; // 16px -$xlarge: $unit * 3; // 24px -$xxlarge: $unit * 4; // 32px diff --git a/app/assets/stylesheets/_variables.scss b/app/assets/stylesheets/_variables.scss index 431654af..31f6c396 100644 --- a/app/assets/stylesheets/_variables.scss +++ b/app/assets/stylesheets/_variables.scss @@ -5,4 +5,4 @@ $lightgreen: #C8E6C9; // lightgreen $lightred: #FFCDD2; // lightred $lightyellow: #fcf5e2; // lightyellow $orange: #ffab40; // orange -$link: #007bff +$link: #007bff; diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 8395f764..0fed07c3 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,5 +1,15 @@ +$spacer: 8px; +$spacers: ( + 0: 0, + 1: ($spacer * .25), + 2: ($spacer * .5), + 3: $spacer, + 4: ($spacer * 1.5), + 5: ($spacer * 3), + 6: ($spacer * 5) +); + @import "bootstrap"; -@import "spacing"; @import "fonts"; @import "colors"; @import "borders"; diff --git a/app/assets/stylesheets/borders.scss b/app/assets/stylesheets/borders.scss index 4a7aa653..ba56ce08 100644 --- a/app/assets/stylesheets/borders.scss +++ b/app/assets/stylesheets/borders.scss @@ -1,5 +1,3 @@ -@import "sizes"; - .border-radius-8 { - border-radius: $unit; + border-radius: 8px; } \ No newline at end of file diff --git a/app/assets/stylesheets/spacing.scss b/app/assets/stylesheets/spacing.scss deleted file mode 100644 index 19164611..00000000 --- a/app/assets/stylesheets/spacing.scss +++ /dev/null @@ -1,55 +0,0 @@ -@import 'sizes'; - -.pv80 { - padding-top: 80px; - padding-bottom: 80px; -} - -.ph120 { - padding-left: 120px; - padding-right: 120px; -} - -$whitespace-keys: (p padding, m margin, a '', v -top -bottom, h -left -right, t -top, r -right, b -bottom, l -left); - -@function expand_whitespace_key($key) { - @each $pair in $whitespace-keys { - $short: nth($pair, 1); - $long: nth($pair, 2); - - // v and h need to pass in 2 parameters - @if (length($pair) == 3) { - $long: (nth($pair, 2) nth($pair, 3)); - } - @if $short == $key { - @return $long; - } - } - @warn "Couldn't export #{$key}"; - @return $key; -} - -$types: (p, m); -$locations: (a, v, h, t, r, b, l); -$t-shirt-sizes: (n, xs, s, m, l, xl, xxl); - -@mixin whitespace($units: ()) { - $units: join(0, $units); - - @for $i from 1 through length($units) { - $t-shirt-size: nth($t-shirt-sizes, $i); - $size: nth($units, $i); - - @each $location in $locations { - @each $type in $types { - .#{$type}#{$location}#{$t-shirt-size} { - @each $whitespace-location in expand_whitespace_key($location) { - #{expand_whitespace_key($type)}#{$whitespace-location}: $size !important; - } - } - } - } - } -} - -@include whitespace(($xsmall, $small, $medium, $large, $xlarge, $xxlarge)); diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb index 848c81c6..348ce773 100644 --- a/app/views/dashboard/index.html.erb +++ b/app/views/dashboard/index.html.erb @@ -1,24 +1,24 @@

<%= @school.name %>

-
+

Areas Of Interest

-
- - -
-
+

Distance from benchmark

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