From 7df2cc45ef03dfc44579bb26682c38a842ebc9b6 Mon Sep 17 00:00:00 2001 From: Tanner Welsh Date: Wed, 29 Oct 2014 13:39:29 -0400 Subject: [PATCH 1/8] Significant improvements to display styles - Header is white text on dark bg - Jobs and skills are organized into adjacent columns - Better whitespacing all around Some structural changes to HTML were added to accomodate new styles. --- public/main.css | 65 ++++++++++++++++++++++++++++++ views/resumes/edit.erb | 90 +++++++++++++++++++++--------------------- views/resumes/show.erb | 48 +++++++++++----------- 3 files changed, 137 insertions(+), 66 deletions(-) diff --git a/public/main.css b/public/main.css index 7ba924b..56e75a1 100644 --- a/public/main.css +++ b/public/main.css @@ -1,9 +1,74 @@ header { min-width: 100%; text-align: center; + background-color: #555; + color: #fff; + padding: 0.5em; } +header h1 { + margin: 0; + font-size: 1.5em; +} + +/* Résumé page content is centered and has a default width */ .resume { margin: 0 auto; width: 720px; } + +/* The page header is separated from the main content with a border */ +.page_header { + padding-bottom: 0.25em; + border-bottom: 1px solid; +} + +.page_header a { + float: right; +} + +/* Profile section */ +.profile { margin-bottom: 3em; } + +.profile p { font-size: 1.5em; } + +/* Professional info section (wraps jobs and skills) */ +.professional_info { + display: block; + clear: both; +} + +.professional_info:after { + display: block; + content: ""; + line-height: 0; + clear: both; +} + +/* Cancel extra whitespace and list markers in job and skill lists */ +.jobs ul, .skills ul { + padding: 0; + list-style-type: none; +} + +/* Jobs section takes up 2/3rds of page (720 * 2/3 - margin) */ +.jobs { + float: left; + width: 460px; + margin-right: 20px; +} + +.jobs li { margin-bottom: 2.5em; } +.jobs li h4 { margin-bottom: 0; } + +/* Skills section takes up 1/3rd of page */ +.skills { + float: left; + width: 240px; +} + +.skills li { + padding: 0.25em; + margin-bottom: 1em; + background-color: #ccc; +} diff --git a/views/resumes/edit.erb b/views/resumes/edit.erb index be2f667..7b62883 100644 --- a/views/resumes/edit.erb +++ b/views/resumes/edit.erb @@ -29,48 +29,50 @@ -
-

Jobs

- -
- -
-

Skills

- -
+
+
+

Jobs

+
    + <% @jobs.each do |job| %> +
  • +
    + + + + + at + +
    + + + +
    + + +
    +
  • + <% end %> +
+
+ +
+

Skills

+
    + <% @skills.each do |skill| %> +
  • +
    + + + + + +
    + + +
    +
  • + <% end %> +
+
+
diff --git a/views/resumes/show.erb b/views/resumes/show.erb index 6cb3a62..a340ee1 100644 --- a/views/resumes/show.erb +++ b/views/resumes/show.erb @@ -1,36 +1,40 @@
-

My Résumé

- Edit +

<%= default_user.name %>

<%= default_user.email %> | <%= default_user.phone %> - | <%= default_user.website %> + | <%= default_user.website %>

<%= default_user.bio %>

-
-

Jobs

-
    - <% @jobs.each do |job| %> -
  • -

    <%= job.job_title %> at <%= job.company_name %>

    -

    <%= job.job_description %>

    -
  • - <% end %> -
-
+
+
+

Jobs

+
    + <% @jobs.each do |job| %> +
  • +

    <%= job.job_title %> at <%= job.company_name %>

    +

    <%= job.job_description %>

    +
  • + <% end %> +
+
-
-

Skills

-
    - <% @skills.each do |skill| %> -
  • <%= skill.name %>
  • - <% end %> -
-
+
+

Skills

+
    + <% @skills.each do |skill| %> +
  • <%= skill.name %>
  • + <% end %> +
+
+
From dea518b3deef5cdd7443361c1b4cdfceb4163800 Mon Sep 17 00:00:00 2001 From: Tanner Welsh Date: Wed, 29 Oct 2014 18:42:40 -0400 Subject: [PATCH 2/8] Improvements to form styling in /resumes/edit - Align labels and inputs in profile form - Boost size of textarea inputs - Make skill edit forms one-line - Simplify form submit button values --- public/main.css | 25 ++++++++++++++++++++++++- views/resumes/edit.erb | 9 ++++----- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/public/main.css b/public/main.css index 56e75a1..802e63b 100644 --- a/public/main.css +++ b/public/main.css @@ -29,7 +29,6 @@ header h1 { /* Profile section */ .profile { margin-bottom: 3em; } - .profile p { font-size: 1.5em; } /* Professional info section (wraps jobs and skills) */ @@ -72,3 +71,27 @@ header h1 { margin-bottom: 1em; background-color: #ccc; } + +/* General form styling */ +textarea { + width: 360px; + height: 48px; +} + +/* Profile form styling */ +.profile form label { + display: inline-block; + min-width: 120px; + vertical-align: top; +} + +.profile form input { margin-bottom: 5px; } + +.profile form input[type="submit"] { + margin-left: 124px; + padding: 5px; +} + +/* Skills form styling */ +.skills form input[type="text"] { max-width: 160px; } +.skills form input[type="submit"] { float: right; } diff --git a/views/resumes/edit.erb b/views/resumes/edit.erb index 7b62883..f968daa 100644 --- a/views/resumes/edit.erb +++ b/views/resumes/edit.erb @@ -25,7 +25,7 @@
- + @@ -44,11 +44,11 @@
- +

- + <% end %> @@ -66,9 +66,8 @@ -
- + <% end %> From b3394f8c1abddc5c3bb9f9dccb46cf2631928deb Mon Sep 17 00:00:00 2001 From: Tanner Welsh Date: Wed, 29 Oct 2014 18:59:58 -0400 Subject: [PATCH 3/8] Decouple CSS styles from content CSS should be generic, with classes that describe the style changes but are not tied to the content of the page. In this commit, I've moved as much styling as possible into generic classes like "row" and "page" instead of using class names closely linked to the HTML content. Also added some better formatting of the CSS in general, with comment headers separating related styles. --- public/main.css | 110 ++++++++++++++++++++++++++--------------- views/resumes/edit.erb | 21 ++++---- views/resumes/show.erb | 18 +++---- 3 files changed, 90 insertions(+), 59 deletions(-) diff --git a/public/main.css b/public/main.css index 802e63b..f57fce3 100644 --- a/public/main.css +++ b/public/main.css @@ -1,3 +1,6 @@ +/* + * HEADER + */ header { min-width: 100%; text-align: center; @@ -11,87 +14,112 @@ header h1 { font-size: 1.5em; } -/* Résumé page content is centered and has a default width */ -.resume { + +/* + * PAGE + */ +.page { margin: 0 auto; width: 720px; } -/* The page header is separated from the main content with a border */ -.page_header { +/* Separate page nav area from the main content with a border */ +.page nav { padding-bottom: 0.25em; border-bottom: 1px solid; + margin-bottom: 0.5em; } -.page_header a { +.page nav a { float: right; } -/* Profile section */ -.profile { margin-bottom: 3em; } -.profile p { font-size: 1.5em; } +/* Highlight section for featured content */ +.highlight { + width: 100%; + margin-bottom: 3em; +} + +.highlight p { font-size: 1.5em; } -/* Professional info section (wraps jobs and skills) */ -.professional_info { + +/* + * GRID + */ +.row { display: block; clear: both; } -.professional_info:after { +.row:after { display: block; content: ""; line-height: 0; clear: both; } -/* Cancel extra whitespace and list markers in job and skill lists */ -.jobs ul, .skills ul { - padding: 0; - list-style-type: none; +/* 1/3 column (720 * 1/3) */ +.one_third { + float: left; + width: 240px; } -/* Jobs section takes up 2/3rds of page (720 * 2/3 - margin) */ -.jobs { +/* 2/3 column (720 * 2/3 - margin) */ +.two_thirds { float: left; width: 460px; margin-right: 20px; } -.jobs li { margin-bottom: 2.5em; } -.jobs li h4 { margin-bottom: 0; } - -/* Skills section takes up 1/3rd of page */ -.skills { - float: left; - width: 240px; -} - -.skills li { - padding: 0.25em; - margin-bottom: 1em; - background-color: #ccc; -} -/* General form styling */ +/* + * FORMS + */ textarea { width: 360px; - height: 48px; + height: 3em; } -/* Profile form styling */ -.profile form label { +form.vertical label { display: inline-block; min-width: 120px; vertical-align: top; } -.profile form input { margin-bottom: 5px; } +form.vertical input { margin-bottom: 0.25em; } -.profile form input[type="submit"] { +form.vertical input[type="submit"] { margin-left: 124px; - padding: 5px; + padding: 0.25em; +} + +form.mini input[type="text"] { max-width: 160px; } +form.mini input[type="submit"] { float: right; } + + +/* + * UTILITY CLASSES + */ +.no_bullets { + list-style-type: none; } -/* Skills form styling */ -.skills form input[type="text"] { max-width: 160px; } -.skills form input[type="submit"] { float: right; } +.no_padding { + padding: 0; +} + + +/* + * SECTION STYLING + */ + +/* Jobs section */ +.jobs li { margin-bottom: 2.5em; } +.jobs li h4 { margin-bottom: 0; } + +/* Skills section */ +.skills li { + padding: 0.25em; + margin-bottom: 1em; + background-color: #ccc; +} diff --git a/views/resumes/edit.erb b/views/resumes/edit.erb index f968daa..2448dcf 100644 --- a/views/resumes/edit.erb +++ b/views/resumes/edit.erb @@ -1,8 +1,11 @@ -
-

Edit My Résumé

+
+
-
+ @@ -29,10 +32,10 @@
-
-
+
+

Jobs

-
    +
      <% @jobs.each do |job| %>
    • @@ -55,12 +58,12 @@
-
+

Skills

-
    +
      <% @skills.each do |skill| %>
    • - + diff --git a/views/resumes/show.erb b/views/resumes/show.erb index a340ee1..1d1d1b9 100644 --- a/views/resumes/show.erb +++ b/views/resumes/show.erb @@ -1,10 +1,10 @@ -
      -