diff --git a/Gemfile b/Gemfile index c7bc863..3db2165 100644 --- a/Gemfile +++ b/Gemfile @@ -9,6 +9,7 @@ gem 'font-awesome-rails' gem 'jbuilder', '~> 2.6' gem 'jquery-rails' gem 'json', '~> 2.0.2' +gem 'normalize-rails' gem 'puma', '~> 3.0' gem 'sass-rails', '~> 5.0' gem 'settingslogic', '~> 2.0.9' diff --git a/Gemfile.lock b/Gemfile.lock index f860fd6..c58f802 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -126,6 +126,7 @@ GEM nokogiri (1.6.8) mini_portile2 (~> 2.1.0) pkg-config (~> 1.1.7) + normalize-rails (4.1.1) notiffany (0.1.1) nenv (~> 0.1) shellany (~> 0.0) @@ -251,6 +252,7 @@ DEPENDENCIES listen (~> 3.0) minitest-reporters mysql2 (>= 0.3.18, < 0.5) + normalize-rails pry-byebug pry-rails puma (~> 3.0) diff --git a/Guardfile b/Guardfile index 5113fbf..d78c84d 100644 --- a/Guardfile +++ b/Guardfile @@ -1,16 +1,16 @@ -# guard 'livereload' do -# watch(%r{app/assets/.+\.(scss|css|js|erb)}) -# watch(%r{app/views/.+\.(erb|haml|slim)$}) -# watch(%r{app/controllers/.+\.rb}) -# watch(%r{app/helpers/.+\.rb}) -# watch(%r{public/.+\.(css|js|html)}) -# watch(%r{config/locales/.+\.yml}) -# -# # Rails Assets Pipeline -# watch(%r{(app|vendor)(/assets/\w+/(.+\.(scss|css|js|erb|html|png|jpg))).*}) do |m| -# "/assets/#{m[3]}" -# end -# end +guard 'livereload' do + watch(%r{app/assets/.+\.(scss|css|js|erb)}) + watch(%r{app/views/.+\.(erb|haml|slim)$}) + watch(%r{app/controllers/.+\.rb}) + watch(%r{app/helpers/.+\.rb}) + watch(%r{public/.+\.(css|js|html)}) + watch(%r{config/locales/.+\.yml}) + + # Rails Assets Pipeline + watch(%r{(app|vendor)(/assets/\w+/(.+\.(scss|css|js|erb|html|png|jpg))).*}) do |m| + "/assets/#{m[3]}" + end +end guard :minitest, spring: true, all_after_pass: true do watch(%r{^test/test_helper\.rb$}) { 'test' } diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 8ab7d9a..22a77b6 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -13,4 +13,5 @@ //= require jquery //= require jquery_ujs //= require turbolinks -//= require main +// +//= require passwords diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/passwords.js similarity index 100% rename from app/assets/javascripts/main.js rename to app/assets/javascripts/passwords.js diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.scss similarity index 75% rename from app/assets/stylesheets/application.css rename to app/assets/stylesheets/application.scss index 6807ffb..696a933 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.scss @@ -10,34 +10,16 @@ * files in this directory. Styles in this file should be added after the last require_* statement. * It is generally better to create a new file per style scope. * + *= require normalize-rails *= require font-awesome - *= require_tree . *= require_self */ -table { - width: 100%; -} +@import 'atoms/variables'; -th { - text-align: left; -} +@import 'atoms/base'; -td { - padding: 5px 0; -} +@import 'molecules/passwords'; -.field { - margin: 5px 0; -} - -td.passwd { - width: 20em; -} - -.passwd a, -.passwd i { - color: #000; - cursor: pointer; - text-decoration: none; -} +@import 'organisms/tables'; +@import 'organisms/forms'; diff --git a/app/assets/stylesheets/atoms/_base.scss b/app/assets/stylesheets/atoms/_base.scss new file mode 100644 index 0000000..c4b498c --- /dev/null +++ b/app/assets/stylesheets/atoms/_base.scss @@ -0,0 +1,4 @@ +body { + margin: 20px auto; + width: 850px; +} diff --git a/app/assets/stylesheets/atoms/_variables.scss b/app/assets/stylesheets/atoms/_variables.scss new file mode 100644 index 0000000..2314f2f --- /dev/null +++ b/app/assets/stylesheets/atoms/_variables.scss @@ -0,0 +1,6 @@ +$copy: #000; + +// gutters +$gutter: 30px; +$half-gutter: 15px; +$mini-gutter: 5px; diff --git a/app/assets/stylesheets/molecules/_passwords.scss b/app/assets/stylesheets/molecules/_passwords.scss new file mode 100644 index 0000000..1d5bd0f --- /dev/null +++ b/app/assets/stylesheets/molecules/_passwords.scss @@ -0,0 +1,10 @@ +.passwd { + width: 20em; + + a, + i { + color: $copy; + cursor: pointer; + text-decoration: none; + } +} diff --git a/app/assets/stylesheets/organisms/_forms.scss b/app/assets/stylesheets/organisms/_forms.scss new file mode 100644 index 0000000..7d07602 --- /dev/null +++ b/app/assets/stylesheets/organisms/_forms.scss @@ -0,0 +1,21 @@ +label { + display: block; + font-weight: 600; + margin: $half-gutter 0 $mini-gutter; +} + +.field { + margin: $mini-gutter 0; +} + +input:not([type]), +[type=text], +[type=password], +[type=email] { + padding: $mini-gutter; +} + +[type=submit] { + margin: $half-gutter 0; + padding: $half-gutter; +} diff --git a/app/assets/stylesheets/organisms/_tables.scss b/app/assets/stylesheets/organisms/_tables.scss new file mode 100644 index 0000000..eeec69a --- /dev/null +++ b/app/assets/stylesheets/organisms/_tables.scss @@ -0,0 +1,11 @@ +table { + width: 100%; +} + +th { + text-align: left; +} + +td { + padding: 5px 0; +}