From a2a5863561f9990509551a63e8628261da44157b Mon Sep 17 00:00:00 2001 From: Thomas Levine Date: Mon, 10 Jun 2013 19:05:56 -0400 Subject: [PATCH] Make more use of SCSS nesting --- app/assets/stylesheets/common.css.scss | 454 ++++++++++++------------- 1 file changed, 216 insertions(+), 238 deletions(-) diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss index f6a34534e..5aebc464b 100644 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@ -214,12 +214,10 @@ table { .sidebar-copy { padding: 5px 10px; + p { + margin: 5px 0; + } } - -.sidebar-copy p { - margin: 5px 0; -} - .sidebar-copy.intro { border-top: 1px solid #ccc; } @@ -272,31 +270,30 @@ table { list-style-type: none; border-bottom: 1px solid #ccc; border-top: 1px solid #ccc; -} - -.left_menu img { - margin: 10px 0px; -} - -.left_menu ul { - padding: 0; - margin: 0; -} - -.left_menu li { - list-style-type: none; - padding: 0; - margin: 0; -} - -.left_menu h4 { - padding: 5px 0 5px 0; - font-size: 12px; - margin: 0; -} + img { + margin: 10px 0px; + } -.left_menu li:last-child h4 { - padding-top: 0; + ul { + padding: 0; + margin: 0; + } + + li { + list-style-type: none; + padding: 0; + margin: 0; + } + + h4 { + padding: 5px 0 5px 0; + font-size: 12px; + margin: 0; + } + + li:last-child h4 { + padding-top: 0; + } } /* Rules for SOTM advert */ @@ -307,10 +304,9 @@ table { padding: 0px; border: 0px; background: #fff; -} - -#sotm img { - width: 165px; + img { + width: 165px; + } } /* @@ -328,43 +324,42 @@ table { /* Rules for the search box */ -#search_field form { - width: 165px; -} - #search_field { position: relative; -} -#search_field input[type="text"] { - width: 165px; - padding: 3px; - font-size: 14px; - line-height: 1.1; - height: 25px; - padding: 2px 0px 2px 5px; - box-shadow: inset #DDD 0px 1px 3px; -} - -#search_field input[type="text"]:focus { - outline: none; - border: 1px solid #000; -} - -#search_field input[type="submit"] { - border: 0; - margin: 0; - padding: 0; - width: 15px; - height: 15px; - min-width: 15px; - text-indent: -1000px; - overflow: hidden; - background: image-url("sprite.png") 0 0 no-repeat; - position: absolute; - top: 5px; - right: 5px; - cursor: pointer; + form { + width: 165px; + } + + input[type="text"] { + width: 165px; + padding: 3px; + font-size: 14px; + line-height: 1.1; + height: 25px; + padding: 2px 0px 2px 5px; + box-shadow: inset #DDD 0px 1px 3px; + } + + input[type="text"]:focus { + outline: none; + border: 1px solid #000; + } + + input[type="submit"] { + border: 0; + margin: 0; + padding: 0; + width: 15px; + height: 15px; + text-indent: -1000px; + overflow: hidden; + background: image-url("sprite.png") 0 0 no-repeat; + position: absolute; + top: 5px; + right: 5px; + cursor: pointer; + } } .search_help { @@ -436,24 +431,22 @@ table { height: 30px; margin-bottom:0; overflow: hidden; -} - -#tabnav li { - display: inline; -} - -#tabnav a, #tabnav a:link, #tabnav a:visited { - float: left; - font-weight: bold; - padding: 3px 10px; - text-decoration: none; - color: #333; - float: left; - margin-right: 1px; - -webkit-transition: color 200ms ease-in; - -moz-transition: color 200ms ease-in; - -o-transition: color 200ms ease-in; - transition: color 200ms ease-in; + li { + display: inline; + } + a, a:link, a:visited { + float: left; + font-weight: bold; + padding: 3px 10px; + text-decoration: none; + color: #333; + float: left; + margin-right: 1px; + -webkit-transition: color 200ms ease-in; + -moz-transition: color 200ms ease-in; + -o-transition: color 200ms ease-in; + transition: color 200ms ease-in; + } } .site-index #tabnav a#viewanchor, @@ -475,13 +468,9 @@ table { #tabnav a:visited:hover.disabled { color: #ccc; cursor: default; -} - -#tabnav a:link.disabled:hover, -#tabnav a:visited.disabled:hover, -#tabnav a:link:hover.disabled:hover, -#tabnav a:visited:hover.disabled:hover { - text-decoration: none; + &:hover { + text-decoration: none; + } } /* Utility for styling notification numbers */ @@ -577,16 +566,14 @@ table { background-color: #ffffff; border: 1px solid #cccccc; border-top: 0px; -} - -.menu ul { - margin: 0px; -} - -.menu li { - padding: 2px 5px; - border-top: 1px solid #eee; - white-space: nowrap; + ul { + margin: 0px; + } + li { + padding: 2px 5px; + border-top: 1px solid #eee; + white-space: nowrap; + } } /* Rules for attribution text under the main map shown on printouts */ @@ -661,16 +648,14 @@ table { #mapkey { padding: 20px; -} - -#mapkey .mapkey-table-key img { - display: block; - margin-left: auto; - margin-right: auto; -} - -#mapkey td { - padding: 0 5px 5px 5px; + .mapkey-table-key img { + display: block; + margin-left: auto; + margin-right: auto; + } + td { + padding: 0 5px 5px 5px; + } } /* Rules for search results which appear in the popout sidebar */ @@ -829,12 +814,11 @@ ul.results-list li { border-bottom: 1px solid #ccc; } position: absolute; top: 0px; margin-right: 5px; -} - -#slim_header img { - vertical-align: middle; - margin-bottom: 5px; - margin-right: 5px; + img { + vertical-align: middle; + margin-bottom: 5px; + margin-right: 5px; + } } .content-heading { @@ -1006,31 +990,31 @@ ul.results-list li { border-bottom: 1px solid #ccc; } font-size: 10px; border-width: 0px; text-align: right; -} - -#trace_list .trace_summary { - font-size: 12px; - color: gray; -} - -#trace_list .trace_pending { - color: red; -} - -#trace_list .trace_public { - color: green; -} - -#trace_list .trace_identifiable { - color: green; -} - -#trace_list .trace_trackable { - color: red; -} - -#trace_list .trace_private { - color: red; + + .trace_summary { + font-size: 12px; + color: gray; + } + + .trace_pending { + color: red; + } + + .trace_public { + color: green; + } + + .trace_identifiable { + color: green; + } + + .trace_trackable { + color: red; + } + + .trace_private { + color: red; + } } /* Rules for the user profile page */ @@ -1082,13 +1066,14 @@ ul.results-list li { border-bottom: 1px solid #ccc; } margin-left: 72px; } -.user-view p#no_home_location { - margin: 20px; -} - -.user-view .user_thumbnail { - margin-top: 5px; - float: left; +.user-view { + p#no_home_location { + margin: 20px; + } + .user_thumbnail { + margin-top: 5px; + float: left; + } } /* Rules for the user map */ @@ -1102,25 +1087,20 @@ ul.results-list li { border-bottom: 1px solid #ccc; } .user_popup { min-width: 200px; -} -.user_popup p { - padding-top:0; - padding-bottom: 5px; - margin-top: 0; -} - -.user_popup img.user_thumbnail { - float: left; - margin: 0 10px 0 0; -} - -/* Rules for user popups on maps */ - -.user_popup p { - margin-bottom: 0; - margin-left: 60px; - font-size: 12px; + p { + padding-top: 0; + padding-bottom: 5px; + margin-top: 0; + margin-bottom: 0; + margin-left: 60px; + font-size: 12px; + } + + img.user_thumbnail { + float: left; + margin: 0 10px 0 0; + } } /* Rules for the user list */ @@ -1128,15 +1108,15 @@ ul.results-list li { border-bottom: 1px solid #ccc; } #user_list { font-size: 10px; width: 100%; -} -#user_list tr { - vertical-align: middle; -} - -#user_list p { - margin-top: 0px; - margin-bottom: 0px; + tr { + vertical-align: middle; + } + + p { + margin-top: 0px; + margin-bottom: 0px; + } } #user_list_actions { @@ -1323,27 +1303,27 @@ ul.results-list li { border-bottom: 1px solid #ccc; } .messages { width: 100%; border: 1px solid #ddd; -} - -.messages tbody tr { - border-top: 1px solid #ccc; -} - -.messages .inbox-row { - background: #f8f8ff; -} -.messages .inbox-row-unread { - background:#CBEEA7; -} - -.right { - float: right; -} - -.messages tr td, -.messages tr th { - padding: 5px; + tbody tr { + border-top: 1px solid #ccc; + } + + .inbox-row { + background: #f8f8ff; + } + + .inbox-row-unread { + background:#CBEEA7; + } + + .right { + float: right; + } + + tr td, + tr th { + padding: 5px; + } } .inbox-row .inbox-mark-read { @@ -1354,11 +1334,10 @@ ul.results-list li { border-bottom: 1px solid #ccc; } margin-bottom: 20px; padding: 5px 0px 4px 0px; border-bottom: 1px solid #ccc; -} -.info-line form, -.info-line form div { - display: inline; + form, form div { + display: inline; + } } .info-line .user_thumbnail_tiny { @@ -1400,50 +1379,49 @@ ul.results-list li { border-bottom: 1px solid #ccc; } padding: 10px; margin-bottom: 20px; background-color: #f0f0f0; -} - -#errorExplanation h2 { - margin: -10px; - padding: 5px 5px 5px 15px; - font-weight: bold; - font-size: 12px; - background-color: #c00; - color: #fff; - text-align: left; -} + h2 { + margin: -10px; + padding: 5px 5px 5px 15px; + font-weight: bold; + font-size: 12px; + background-color: #c00; + color: #fff; + text-align: left; + } -#errorExplanation p { - color: #333; - margin-bottom: 0px; - padding: 5px; -} + p { + color: #333; + margin-bottom: 0px; + padding: 5px; + } + + ul li { + font-size: 12px; + list-style: disc; + } -#errorExplanation ul li { - font-size: 12px; - list-style: disc; } /* Rules for forms */ -.standard-form fieldset { - margin-bottom: 20px; -} - -.standard-form label { - display: block; - width: 300px; - margin-right: 10px; - font-size: 14px; - font-weight: bold; - line-height: 1.5; -} - -.standard-form .form-row { - margin-bottom: 10px; -} - -.standard-form input[name=remember_me] { - float: left; +.standard-form { + fieldset { + margin-bottom: 20px; + } + label { + display: block; + width: 300px; + margin-right: 10px; + font-size: 14px; + font-weight: bold; + line-height: 1.5; + } + .form-row { + margin-bottom: 10px; + } + input[name=remember_me] { + float: left; + } } #remember_me_openid { -- 2.43.2