From c960964d48cb8b0bb488089e9372247a9c486756 Mon Sep 17 00:00:00 2001 From: Steven Harley Date: Fri, 23 Sep 2016 14:08:51 -0700 Subject: [PATCH] Create components folder for reused SCSS * Add normalize-rails gem, remove normailze vendor file --- Gemfile | 3 ++- Gemfile.lock | 1 + app/assets/stylesheets/application.scss | 13 ++++--------- .../stylesheets/application/_helpers.scss | 19 ------------------- app/assets/stylesheets/base/_helpers.scss | 8 ++++++++ app/assets/stylesheets/base/_typography.scss | 4 ++++ .../stylesheets/components/_components.scss | 3 +++ .../{application => components}/_footer.scss | 0 .../{application => components}/_header.scss | 0 .../{ => components}/_toggle_switch.scss | 0 .../{home/_index.scss => pages/_home.scss} | 0 app/assets/stylesheets/pages/_pages.scss | 1 + vendor/assets/stylesheets/_normalize.scss | 2 -- 13 files changed, 23 insertions(+), 31 deletions(-) delete mode 100644 app/assets/stylesheets/application/_helpers.scss create mode 100644 app/assets/stylesheets/components/_components.scss rename app/assets/stylesheets/{application => components}/_footer.scss (100%) rename app/assets/stylesheets/{application => components}/_header.scss (100%) rename app/assets/stylesheets/{ => components}/_toggle_switch.scss (100%) rename app/assets/stylesheets/{home/_index.scss => pages/_home.scss} (100%) delete mode 100644 vendor/assets/stylesheets/_normalize.scss diff --git a/Gemfile b/Gemfile index 1d0de43fa..2fe076e49 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,8 @@ gem "haml-rails" gem "high_voltage" gem "inifile" gem "jquery-rails", "~> 4.0.0" -gem 'rails-assets-lodash', source: 'https://rails-assets.org' +gem "rails-assets-lodash", source: "https://rails-assets.org" +gem "normalize-rails" gem "neat" gem "octokit" gem "omniauth-github" diff --git a/Gemfile.lock b/Gemfile.lock index 53d3aa92e..9b9b7a2db 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -381,6 +381,7 @@ DEPENDENCIES jquery-rails (~> 4.0.0) launchy neat + normalize-rails octokit omniauth-github paranoia (~> 2.0) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index b7c72797b..ce7fb354b 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,17 +1,12 @@ @import "bourbon"; @import "neat"; -@import "normalize"; +@import "normalize-rails"; @import "font-awesome"; @import "base/base"; - -@import "application/helpers"; - -@import "toggle_switch"; +@import "components/components"; @import "pages/pages"; -@import "accounts/show"; -@import "application/footer"; -@import "application/header"; -@import "home/index"; @import "repos/repos"; + +@import "accounts/show"; @import "sessions/new"; diff --git a/app/assets/stylesheets/application/_helpers.scss b/app/assets/stylesheets/application/_helpers.scss deleted file mode 100644 index 0114e42b1..000000000 --- a/app/assets/stylesheets/application/_helpers.scss +++ /dev/null @@ -1,19 +0,0 @@ -.pull-left { - float: left; -} - -.pull-right { - float: right; -} - -.va-wrapper { - @include size(100%); - display: table; -} - -.va-cell { - @include size(100%); - display: table-cell; - text-align: center; - vertical-align: middle; -} diff --git a/app/assets/stylesheets/base/_helpers.scss b/app/assets/stylesheets/base/_helpers.scss index 2385de475..5c7bc2dc3 100644 --- a/app/assets/stylesheets/base/_helpers.scss +++ b/app/assets/stylesheets/base/_helpers.scss @@ -8,3 +8,11 @@ text-align: center; vertical-align: middle; } + +.pull-left { + float: left; +} + +.pull-right { + float: right; +} diff --git a/app/assets/stylesheets/base/_typography.scss b/app/assets/stylesheets/base/_typography.scss index 2004954c7..d5c29a8bb 100644 --- a/app/assets/stylesheets/base/_typography.scss +++ b/app/assets/stylesheets/base/_typography.scss @@ -87,3 +87,7 @@ em.code { margin: 1em 0 2em; white-space: pre-wrap; } + +figure { + margin: 0; +} diff --git a/app/assets/stylesheets/components/_components.scss b/app/assets/stylesheets/components/_components.scss new file mode 100644 index 000000000..0078e3b3e --- /dev/null +++ b/app/assets/stylesheets/components/_components.scss @@ -0,0 +1,3 @@ +@import "footer"; +@import "header"; +@import "toggle_switch"; diff --git a/app/assets/stylesheets/application/_footer.scss b/app/assets/stylesheets/components/_footer.scss similarity index 100% rename from app/assets/stylesheets/application/_footer.scss rename to app/assets/stylesheets/components/_footer.scss diff --git a/app/assets/stylesheets/application/_header.scss b/app/assets/stylesheets/components/_header.scss similarity index 100% rename from app/assets/stylesheets/application/_header.scss rename to app/assets/stylesheets/components/_header.scss diff --git a/app/assets/stylesheets/_toggle_switch.scss b/app/assets/stylesheets/components/_toggle_switch.scss similarity index 100% rename from app/assets/stylesheets/_toggle_switch.scss rename to app/assets/stylesheets/components/_toggle_switch.scss diff --git a/app/assets/stylesheets/home/_index.scss b/app/assets/stylesheets/pages/_home.scss similarity index 100% rename from app/assets/stylesheets/home/_index.scss rename to app/assets/stylesheets/pages/_home.scss diff --git a/app/assets/stylesheets/pages/_pages.scss b/app/assets/stylesheets/pages/_pages.scss index c6875d733..14b21547b 100644 --- a/app/assets/stylesheets/pages/_pages.scss +++ b/app/assets/stylesheets/pages/_pages.scss @@ -1,2 +1,3 @@ @import "builds"; @import "docs"; +@import "home"; diff --git a/vendor/assets/stylesheets/_normalize.scss b/vendor/assets/stylesheets/_normalize.scss deleted file mode 100644 index 4d32b4cf5..000000000 --- a/vendor/assets/stylesheets/_normalize.scss +++ /dev/null @@ -1,2 +0,0 @@ -article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace, serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:\201C \201D \2018 \2019}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],/* 1 */ -input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}body,figure{margin:0}legend,button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}