From fec6b6caa594d0c72b7b8a6d2a261d56f648721c Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 19 Aug 2018 00:26:22 +0200 Subject: [PATCH] Converting application less to sass. --- app/assets/sass/_bootstrap-custom.scss | 32 +++ app/assets/sass/_mixins.scss | 3 + app/assets/sass/_variables.scss | 212 ++++++++++++++++++ app/assets/sass/application.scss | 44 ++++ app/assets/sass/base/_global.scss | 5 + app/assets/sass/base/_typography.scss | 14 ++ app/assets/sass/components/_badge.scss | 18 ++ app/assets/sass/components/_blankslate.scss | 36 +++ app/assets/sass/components/_button.scss | 76 +++++++ .../sass/components/_callback-list.scss | 78 +++++++ app/assets/sass/components/_icon.scss | 4 + app/assets/sass/components/_pagination.scss | 33 +++ app/assets/sass/components/_request-item.scss | 126 +++++++++++ app/assets/sass/components/_section.scss | 24 ++ app/assets/sass/components/_spacer.scss | 6 + app/assets/sass/components/_url.scss | 8 + app/assets/sass/layout/_footer.scss | 40 ++++ app/assets/sass/layout/_masthead.scss | 26 +++ app/assets/sass/layout/_navigation.scss | 157 +++++++++++++ app/assets/sass/layout/_sections.scss | 43 ++++ app/assets/sass/mixins/_button.scss | 64 ++++++ app/assets/sass/mixins/_icon-vcenter.scss | 5 + app/assets/sass/views/_about.scss | 13 ++ app/assets/sass/views/_landingpage.scss | 43 ++++ app/assets/sass/views/_login.scss | 24 ++ app/assets/sass/views/_register.scss | 6 + 26 files changed, 1140 insertions(+) create mode 100644 app/assets/sass/_bootstrap-custom.scss create mode 100644 app/assets/sass/_mixins.scss create mode 100644 app/assets/sass/_variables.scss create mode 100644 app/assets/sass/application.scss create mode 100644 app/assets/sass/base/_global.scss create mode 100644 app/assets/sass/base/_typography.scss create mode 100644 app/assets/sass/components/_badge.scss create mode 100644 app/assets/sass/components/_blankslate.scss create mode 100644 app/assets/sass/components/_button.scss create mode 100644 app/assets/sass/components/_callback-list.scss create mode 100644 app/assets/sass/components/_icon.scss create mode 100644 app/assets/sass/components/_pagination.scss create mode 100644 app/assets/sass/components/_request-item.scss create mode 100644 app/assets/sass/components/_section.scss create mode 100644 app/assets/sass/components/_spacer.scss create mode 100644 app/assets/sass/components/_url.scss create mode 100644 app/assets/sass/layout/_footer.scss create mode 100644 app/assets/sass/layout/_masthead.scss create mode 100644 app/assets/sass/layout/_navigation.scss create mode 100644 app/assets/sass/layout/_sections.scss create mode 100644 app/assets/sass/mixins/_button.scss create mode 100644 app/assets/sass/mixins/_icon-vcenter.scss create mode 100644 app/assets/sass/views/_about.scss create mode 100644 app/assets/sass/views/_landingpage.scss create mode 100644 app/assets/sass/views/_login.scss create mode 100644 app/assets/sass/views/_register.scss diff --git a/app/assets/sass/_bootstrap-custom.scss b/app/assets/sass/_bootstrap-custom.scss new file mode 100644 index 0000000..0d09224 --- /dev/null +++ b/app/assets/sass/_bootstrap-custom.scss @@ -0,0 +1,32 @@ + +// --------------------------- +// Custom bootstrap variables. +// --------------------------- + +$body-bg: #f5f5f8; + +$font-size-base: 15px; +$nav-link-hover-bg: none; + +// --------------------------- +// Source imports +// --------------------------- + +@import "bootstrap/variables"; +@import "bootstrap/mixins"; + +@import "bootstrap/normalize"; +@import "bootstrap/close"; +@import "bootstrap/alerts"; +@import "bootstrap/print"; +@import "bootstrap/type"; +@import "bootstrap/code"; +@import "bootstrap/tables"; +@import "bootstrap/forms"; +@import "bootstrap/scaffolding"; +@import "bootstrap/grid"; +@import "bootstrap/utilities"; +@import "bootstrap/navs"; +@import "bootstrap/dropdowns"; +@import "bootstrap/modals"; +@import "bootstrap/component-animations"; diff --git a/app/assets/sass/_mixins.scss b/app/assets/sass/_mixins.scss new file mode 100644 index 0000000..1d56b71 --- /dev/null +++ b/app/assets/sass/_mixins.scss @@ -0,0 +1,3 @@ + +@import "mixins/button"; +@import "mixins/icon-vcenter"; diff --git a/app/assets/sass/_variables.scss b/app/assets/sass/_variables.scss new file mode 100644 index 0000000..9053952 --- /dev/null +++ b/app/assets/sass/_variables.scss @@ -0,0 +1,212 @@ + +// ---------------------------------- +// Paths +// ---------------------------------- +$base-path: '..'; +$image-path: #{$base-path}/img; + +// ---------------------------------- +// Colors +// ---------------------------------- +$gray-lightest: #f9f9f9; +$gray-light: #dcdcdc; +$gray-dark: #444; +$gray-darker: #202020; +$black: #000; +$white: #fff; + +// Text +$text-color: #333; +$text-secondary-color: #666; +$text-light-color: #f1f1f1; + +// Layout +$foreground-color: $white; +$hover-color: $gray-lightest; +$border-color: $gray-light; + +// Brand +$brand-color: #03a9f4; +$brand-info: hsl(210, 70%, 50%); +$google-color: #db4437; +$github-color: #4183c4; +$gitlab-color: #548; +$linkedin-color: #0077B5; + +// ---------------------------------- +// Font +// ---------------------------------- + + +$font-size-navigation: 20px; +$text-size-large: 20px; +$font-size-small: 14px; + +$font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif; +$font-family-serif: Georgia, "Times New Roman", Times, serif; +//** Default monospace fonts for ``, ``, and `
`.
+$font-family-monospace:   Menlo, Monaco, Consolas, "Courier New", monospace;
+$font-family-base:        $font-family-sans-serif;
+
+// ----------------------------------
+//   Layout
+// ----------------------------------
+$header-text-shadow:					1px 3px 4px rgba(0, 0, 0, 0.45);
+
+// navigation
+$navbar-breakpoint-min:                 $screen-md-min;
+
+$navbar-height:                         60px;
+$navbar-link-vertical-spacing:          8px;
+$navbar-link-underline-height:          2px;
+$navbar-link-spacing:                   20px;
+
+$navbar-background:                     rgba(29, 126, 209, 0.5);
+$navbar-link-text-shadow: 				0px 2px 1px rgba(0, 0, 0, 0.3);
+$navbar-link-color:             		white;
+$navbar-link-hover-color:       		lighten($navbar-link-color, 10%);
+$navbar-link-hover-underline:   		$navbar-link-color;
+
+$navbar-link-active-color:      		$navbar-link-color;
+$navbar-link-active-underline:  		$navbar-link-color;
+
+$navbar-brand-color:            		$brand-color;
+$navbar-brand-hover-color:      		darken($brand-color, 15%);
+
+// User menu
+$usermenu-button-bg:                    $navbar-background;
+$usermenu-button-hover-bg:              darken($usermenu-button-bg, 8%);
+
+// Footer
+$footer-height:             80px;
+$footer-border-color:       $border-color;
+$footer-text-color:			$text-secondary-color;
+$footer-link-color:			$footer-text-color;
+$footer-link-hover-color:	darken($footer-link-color, 10%);
+
+// ----------------------------------
+//   Buttons
+// ----------------------------------
+$button-bg-color:		    #f1f1f1;
+$button-hover-color:		darken($button-bg-color, 10%);
+$button-border:				darken($button-bg-color, 10%);
+$button-shadow:				0 2px 2px 0 rgba(0, 0, 0, 0.12),
+                            0 1px 5px 0 rgba(0, 0, 0, 0.1);
+
+// Variations
+
+$button-primary-color:         white;
+$button-primary-bg:            #5fbc49;
+
+$button-brand-color:           white;
+$button-brand-bg:              $brand-color;
+
+// State
+$button-info-color:            white;
+$button-info-bg:               $brand-info;
+$button-success-color:         white;
+$button-success-bg:            $brand-success;
+$button-warning-color:         white;
+$button-warning-bg:            $brand-warning;
+$button-danger-color:          white;
+$button-danger-bg:             $brand-danger;
+
+// Company.
+
+$button-google-color:          white;
+$button-google-bg:             $google-color;
+$button-google-border:         darken($button-google-bg, 5%);
+
+$button-github-color:          white;
+$button-github-bg:             $github-color;
+$button-github-border:         darken($button-github-bg, 5%);
+
+$button-gitlab-color:          white;
+$button-gitlab-bg:             $gitlab-color;
+
+$button-linkedin-color:        white;
+$button-linkedin-bg:           $linkedin-color;
+
+// ----------------------------------
+//   Shadows
+// ----------------------------------
+
+$block-shadow:                  0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
+$block-shadow-2:                0 3px 3px 0 rgba(0, 0, 0, 0.14), 0 1px 7px 0 rgba(0, 0, 0, 0.12);
+$block-shadow-3:                0 3px 3px 0 rgba(0, 0, 0, 0.16);
+
+// ----------------------------------
+//   Dropdown
+// ----------------------------------
+
+$dropdown-shadow:           0 2px 4px rgba(0,0,0,0.1);
+
+// ----------------------------------
+//   Blankslate
+// ----------------------------------
+
+$blankslate-bg:         $gray-lightest;
+$blankslate-color:      $text-secondary-color;
+$blankslate-border:     $border-color;
+$blankslate-spacing:    25px 10px;
+$blankslate-spacing-sm: 15px 5px;
+
+// ----------------------------------
+//   Spacer
+// ----------------------------------
+
+$spacer-color: $gray-light;
+$spacer-margin: 1em 0;
+
+// ----------------------------------
+//   Pagination
+// ----------------------------------
+
+$pagination-color:          $text-color;
+$pagination-border:         $border-color;
+$pagination-hover:          $hover-color;
+
+$pagination-active-color:   $white;
+$pagination-active-bg:      $brand-color;
+$pagination-active-border:  darken($brand-color, 5%);
+
+// ----------------------------------
+//   Section
+// ----------------------------------
+
+$section-bg:        $foreground-color;
+$section-border:    rgb(200, 200, 200);
+$section-padding:   20px;
+
+// ----------------------------------
+//   Callback list
+// ----------------------------------
+
+$callback-list-hover-color:         $gray-lightest;
+$callback-list-info-color:          $text-secondary-color;
+
+$callback-list-border-size:         1px;
+$callback-list-border-color:        $gray-light;
+$callback-list-border-radius:       3px;
+
+$callback-list-name-text-size:      24px;
+$callback-list-name-color:          $text-color;
+$callback-list-name-hover-color:    $link-color;
+
+$callback-list-arrow-color:         $callback-list-border-color;
+
+// ----------------------------------
+//   Request list
+// ----------------------------------
+
+$request-item-color:                $text-color;
+$request-item-secondary-color:      $text-secondary-color;
+$request-item-background:           transparent;
+$request-item-border-color:         $gray-light;
+
+$request-item-active-color:         $request-item-color;
+$request-item-active-background:    $gray-lightest;
+$request-item-active-border-color:  $request-item-border-color;
+$request-item-hover-background:     $request-item-active-background;
+
+$request-detail-background:         lighten($brand-color, 45%);
diff --git a/app/assets/sass/application.scss b/app/assets/sass/application.scss
new file mode 100644
index 0000000..4bb2f13
--- /dev/null
+++ b/app/assets/sass/application.scss
@@ -0,0 +1,44 @@
+
+// ---------------------------
+//  Bootstrap & Fonts
+// ---------------------------
+
+@import "bootstrap-custom";
+@import url('https://fonts.googleapis.com/css?family=Lato:400,400i,700,700i');
+@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700,700i');
+
+// ---------------------------
+//  Site
+// ---------------------------
+
+// variables & mixins.
+@import "variables";
+@import "mixins";
+
+// Base
+@import "base/global";
+@import "base/typography";
+
+// Layout
+@import "layout/sections";
+@import "layout/navigation";
+@import "layout/masthead";
+@import "layout/footer";
+
+// Components
+@import "components/url";
+@import "components/icon";
+@import "components/button";
+@import "components/badge";
+@import "components/section";
+@import "components/spacer";
+@import "components/pagination";
+@import "components/blankslate";
+@import "components/request-item";
+@import "components/callback-list";
+
+// Views
+@import "views/landingpage";
+@import "views/about";
+@import "views/login";
+@import "views/register";
diff --git a/app/assets/sass/base/_global.scss b/app/assets/sass/base/_global.scss
new file mode 100644
index 0000000..a507247
--- /dev/null
+++ b/app/assets/sass/base/_global.scss
@@ -0,0 +1,5 @@
+
+html {
+    position: relative;
+    min-height: 100%;
+}
diff --git a/app/assets/sass/base/_typography.scss b/app/assets/sass/base/_typography.scss
new file mode 100644
index 0000000..93ac4c4
--- /dev/null
+++ b/app/assets/sass/base/_typography.scss
@@ -0,0 +1,14 @@
+
+// Section header (part of .section)
+
+.hdr-center {
+    display: inline-block;
+    padding: 20px 80px;
+    margin: 30px auto;
+    border-bottom: 2px solid $border-color;
+}
+
+.text-github { color: $github-color; }
+.text-gitlab { color: $gitlab-color; }
+.text-google { color: $google-color; }
+.text-linkedin { color: $linkedin-color; }
diff --git a/app/assets/sass/components/_badge.scss b/app/assets/sass/components/_badge.scss
new file mode 100644
index 0000000..46107e7
--- /dev/null
+++ b/app/assets/sass/components/_badge.scss
@@ -0,0 +1,18 @@
+
+.badge {
+    display: inline-block;
+    padding: .2em .4em;
+    line-height: 1;
+    text-align: center;
+    border-radius: 2px;
+    vertical-align: baseline;
+
+    &:empty {
+        display: none;
+    }
+
+    &-primary {
+        color: white;
+        background-color: $brand-color;
+    }
+}
diff --git a/app/assets/sass/components/_blankslate.scss b/app/assets/sass/components/_blankslate.scss
new file mode 100644
index 0000000..8220f6f
--- /dev/null
+++ b/app/assets/sass/components/_blankslate.scss
@@ -0,0 +1,36 @@
+
+
+// ----------------------------------
+//  Base style.
+// ----------------------------------
+
+
+.blankslate {
+    border-radius: 4px;
+    @include box-shadow(inset 0 0 4px rgba(0,0,0, .1));
+    border: solid 1px $blankslate-border;
+
+    color: $blankslate-color;
+    background-color: $blankslate-bg;
+    padding: $blankslate-spacing;
+
+    h3, p {
+        text-align: center;
+    }
+
+    :last-child {
+        margin-bottom: 0;
+    }
+}
+
+
+// ----------------------------------
+//  Variants
+// ----------------------------------
+
+
+//    Sizes
+// ----------------------------------
+.blankslate-sm {
+    padding: $blankslate-spacing-sm;
+}
diff --git a/app/assets/sass/components/_button.scss b/app/assets/sass/components/_button.scss
new file mode 100644
index 0000000..8c00811
--- /dev/null
+++ b/app/assets/sass/components/_button.scss
@@ -0,0 +1,76 @@
+
+
+// ----------------------------------
+//  Base style.
+// ----------------------------------
+
+
+.button {
+    display: inline-block;
+    padding: 0.5rem 2rem;
+    cursor: pointer;
+    vertical-align: middle;
+    // Resets for