From e801ecf736dcd0ff7ea9888c62ea63d806cd1a45 Mon Sep 17 00:00:00 2001 From: Miki Hobgood Date: Sun, 30 Apr 2017 13:11:01 -0700 Subject: [PATCH 1/2] site-section markup and initial styles --- app/assets/stylesheets/static_pages.css.scss | 25 ++++++++++++++++++++ app/views/static_pages/front_page.html.erb | 7 +++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/static_pages.css.scss b/app/assets/stylesheets/static_pages.css.scss index 0f289e5..7384c28 100644 --- a/app/assets/stylesheets/static_pages.css.scss +++ b/app/assets/stylesheets/static_pages.css.scss @@ -2,6 +2,31 @@ // // They will automatically be included in application.css. // // You can use Sass (SCSS) here: http://sass-lang.com/ +$base-font-size: 10px; + +//convert px value to rem value +@function px-to-rem($px, $base:$base-font-size) { + @return ($px / $base) * 1rem; +} + +.site-section { + text-align: center; + + h2 { + font-size: px-to-rem(36px); + margin-bottom: px-to-rem(30px); + } + + p { + font-size: px-to-rem(18px); + } + + a { + color: black; + } +} + + // .front-page { // padding-top: 20px; // padding-bottom: 40px; diff --git a/app/views/static_pages/front_page.html.erb b/app/views/static_pages/front_page.html.erb index 2e6ee71..2ebee7f 100644 --- a/app/views/static_pages/front_page.html.erb +++ b/app/views/static_pages/front_page.html.erb @@ -1,5 +1,11 @@ <%# render "layouts/navbar", page: "" %> +
+

Header Text Goes Here

+

Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass.

+ page name here +
+ - \ No newline at end of file From 92a3e62290b56594ee5b9ace1e7eec857231580f Mon Sep 17 00:00:00 2001 From: jadefaerie Date: Tue, 25 Jul 2017 20:35:46 -0700 Subject: [PATCH 2/2] created mixins --- .rspec | 2 + app/assets/stylesheets/_mixins.scss | 20 ++++ app/assets/stylesheets/_variables.scss | 4 + app/assets/stylesheets/static_pages.css.scss | 41 +++++++- app/views/static_pages/front_page.html.erb | 46 ++++++++- spec/models/resource_spec.rb | 16 ++++ spec/rails_helper.rb | 77 +++++++++++++++ spec/spec_helper.rb | 99 ++++++++++++++++++++ spec/views/resources_views_spec.rb | 43 +++++++++ 9 files changed, 343 insertions(+), 5 deletions(-) create mode 100644 .rspec create mode 100644 app/assets/stylesheets/_mixins.scss create mode 100644 spec/models/resource_spec.rb create mode 100644 spec/rails_helper.rb create mode 100644 spec/spec_helper.rb create mode 100644 spec/views/resources_views_spec.rb diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..83e16f8 --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/app/assets/stylesheets/_mixins.scss b/app/assets/stylesheets/_mixins.scss new file mode 100644 index 0000000..deeef95 --- /dev/null +++ b/app/assets/stylesheets/_mixins.scss @@ -0,0 +1,20 @@ +@mixin arrow() { + position: relative; + text-indent: -9999999rem; + &::before { // the line of the arrow + content: ''; + position: absolute; + top: calc(50% - .2rem); //change the rem value when we know the height + height: .4rem; + width: 2rem; + background-color: black; + } + &::after { // the head of the arrow + content: '>'; + position: absolute; + top: calc(50% - .5rem); //change the rem value when we know the height + height: 1rem; + width: 1rem; + color: black; + } +} diff --git a/app/assets/stylesheets/_variables.scss b/app/assets/stylesheets/_variables.scss index 2934932..4600d27 100644 --- a/app/assets/stylesheets/_variables.scss +++ b/app/assets/stylesheets/_variables.scss @@ -7,3 +7,7 @@ // Bootstrap variables // $navbar-height: 70px; + +// Media Query Min-Width +$width-md: 38.75em; // ~620px +$width-lg: 64em; // ~1024px diff --git a/app/assets/stylesheets/static_pages.css.scss b/app/assets/stylesheets/static_pages.css.scss index 7384c28..ade019e 100644 --- a/app/assets/stylesheets/static_pages.css.scss +++ b/app/assets/stylesheets/static_pages.css.scss @@ -2,6 +2,9 @@ // // They will automatically be included in application.css. // // You can use Sass (SCSS) here: http://sass-lang.com/ +@import "./_variables"; +@import "./_mixins"; + $base-font-size: 10px; //convert px value to rem value @@ -11,7 +14,7 @@ $base-font-size: 10px; .site-section { text-align: center; - + h2 { font-size: px-to-rem(36px); margin-bottom: px-to-rem(30px); @@ -23,7 +26,43 @@ $base-font-size: 10px; a { color: black; + @include arrow(); } + + &.resources { + //resources-specific styles here + background-color: red; //temp color + } + + &.community { + //community-specific styles here + background-color: green; // temp color + } + + &.mentorship { + //mentorship-specific styles here + background-color: blue; // temp color + } + + @media (min-width: $width-md) { + + padding: 0 px-to-rem(20px); + + .primary { + padding: px-to-rem(20px) px-to-rem(30px); + } + } + + //use this for larger screen sizes, define the width of the screen in _variables.scss + @media (min-width: $width-lg) { + + } +} + +//testing only -- this is not the "real" featured-list +.featured-list { + display: block; + background-color: pink; } diff --git a/app/views/static_pages/front_page.html.erb b/app/views/static_pages/front_page.html.erb index 2ebee7f..d9eb8eb 100644 --- a/app/views/static_pages/front_page.html.erb +++ b/app/views/static_pages/front_page.html.erb @@ -1,11 +1,49 @@ <%# render "layouts/navbar", page: "" %> + + + + +
+
+

Resources

+

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula.

+ arrow goes here +
+ + + +
+ +
+
+

Community

+

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula.

+ arrow goes here +
+ + -
-

Header Text Goes Here

-

Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass.

- page name here
+
+
c +

Mentorship

+

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula.

+ arrow goes here +
+ + + +