X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/2443e7dd650a3d3aaae9ab14d14d2fde6a582755..f16d4977031f8790d6b97e4117e3446c04eb5600:/app/assets/stylesheets/common.scss diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 3e4b30a70..9ec7fb3f4 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -55,30 +55,28 @@ small, aside { .icon.clipboard { /* no-r2 */ background-position: -160px 0; } .icon.link { /* no-r2 */ background-position: -180px 0; } .icon.close { /* no-r2 */ background-position: -200px 0; } -.close-wrap:hover .icon.close, .icon.close:hover { /* no-r2 */ background-position: -200px -20px; } .icon.check { /* no-r2 */ background-position: -220px 0; } .icon.note { /* no-r2 */ background-position: -240px 0; } .icon.note.grey { /* no-r2 */ background-position: -240px -20px; } .icon.query { /* no-r2 */ background-position: -260px 0; } -/* Rules for links */ - -a { - color: #24d; - text-decoration: none; - outline: 0; - &:hover { - text-decoration: underline; - } -} - /* Utility for de-emphasizing content */ .text-muted a { color: $blue; } +/* Rules for borders */ +/* These add additional colours to those provided by bootstrap */ +.border-grey { + border-color: $grey !important; +} + +.border-lightgrey { + border-color: $lightgrey !important; +} + /* Rules for the header */ #menu-icon { @@ -192,7 +190,7 @@ nav.secondary { .login-menu { .btn-outline-secondary { - @include button-outline-variant($darkgrey); + @include button-outline-variant($darkgrey, $white, null, null, $white); } } @@ -203,24 +201,12 @@ nav.secondary { &:hover { border-color: $grey; } - &:focus { - background-color: white; - box-shadow: none; - } } &.show .btn-outline-secondary { background-color: white; - &:focus { - box-shadow: none; - } } } - img.user_thumbnail_tiny { - border: 0; - border-radius: 3px; - } - #inboxanchor { display: inline-block; height: 25px; @@ -290,7 +276,8 @@ body.compact-nav { margin-bottom: 10px; outline: none; - &:hover { + &:hover, + &:focus { background-color: black; } @@ -364,49 +351,6 @@ body.compact-nav { clear: both; width: 100%; } - - h2 { - font-size: 1.5rem; - } - - h3, h4 { - margin-top: $lineheight; - margin-bottom: $lineheight/2; - font-size: 1.25rem; - } - - .close-wrap { - cursor: pointer; - position: absolute; - top: 0; - right: 0; - width: 60px; - height: 60px; - - .icon.close { - pointer-events: none; - position: absolute; - right: 20px; - top: 20px; - } - } - - .icon.close { - float: right; - cursor: pointer; - } - - .flash { - padding: 15px; - - picture { - margin-right: -25px; - } - - div.message { - margin-left: 30px; - } - } } .overlay-sidebar #sidebar { @@ -658,11 +602,6 @@ body.compact-nav { padding: $lineheight/2 $lineheight; // background: $offwhite; // border-bottom: 1px solid $grey; - > .close { - float: right; - margin-top: 2px; - cursor: pointer; - } } #browse_status { @@ -700,6 +639,28 @@ form { } } +/* Stop bootstrap 5 from floating legends when they don't need to be */ +legend { + float: none; +} + +/* Override the text colour for primary and secondary buttons, to match our + bootstrap 4 colours. Note this has accessibility issues, which is why + bootstrap 5 calculates black as the appropriate colour, and we should + reconsider our colours at some point with that in mind. */ + +.btn-primary { + @include button-variant($primary, $primary, $white, null, null, $white, null, null, $white, null, null, $white); +} + +.btn-secondary { + @include button-variant($secondary, $secondary, $white, null, null, $white, null, null, $white, null, null, $white); +} + +.btn-outline-secondary { + @include button-outline-variant($secondary, $white, null, null, $white); +} + /* Rules for the search and direction forms */ header .search_forms, @@ -791,7 +752,6 @@ tr.turn:hover { } .comments { - float: right; color: $darkgrey; } @@ -814,7 +774,6 @@ tr.turn:hover { border-bottom: 1px solid $grey; h4:first-child { - margin-top: 0; word-wrap: break-word; } } @@ -823,42 +782,13 @@ tr.turn:hover { border-bottom: none; } - .paginate { - float: right; - padding: 1px 6px; - border: 1px solid $lightgrey; - border-radius: 3px; - } - - .browse-field { - margin-bottom: 10px; - - h4 { - padding: 5px 0 5px 10px; - font-size: 12px; - border: 1px solid $grey; - border-radius: 4px 4px 0 0; - background-color: $offwhite; - } - - p { - padding: 7px 10px; - font-size: 12px; - background-color: #FFF; - border: 1px solid $grey; - border-top: 0; - border-radius: 0 0 4px 4px; - } - } - .browse-tag-list { background-color: $offwhite; - border: 1px solid $grey; - border-radius: 3px; table-layout: fixed; border-collapse: separate; border-spacing: 0; width: 100%; + margin-bottom: $spacer; th, td { border-bottom: 1px solid $grey; @@ -905,16 +835,6 @@ tr.turn:hover { } } - .comments-header { - float: left; - } - - .subscribe-buttons { - float: left; - margin: 18px 10px 10px; - min-width: 80px; - } - .subscribe-buttons input { font-size: 90%; line-height: 15px; @@ -967,7 +887,7 @@ tr.turn:hover { } .export_area_inputs { - margin-bottom: $lineheight/2; + margin-bottom: $spacer; input[type="text"] { width: 100px; text-align: center; @@ -976,8 +896,6 @@ tr.turn:hover { .export_boxy { background: $lightgrey; - border: 1px solid $grey; - border-radius: 3px; #maxlat { margin-top: -1px; } #minlon { @@ -1035,15 +953,11 @@ tr.turn:hover { /* Overrides for pages that use new layout conventions */ -.header-illustration-heading { - height: 200px; -} - .header-illustration { background-position: 0 0; background-repeat: no-repeat; - position: absolute; - height: 200px; + position: relative; + min-height: 200px; width: 100%; left: 0; bottom: 0; @@ -1063,10 +977,12 @@ tr.turn:hover { &.new-user-arm { height: 110px; width: 130px; - left: 260px; - top: 160px; + left: 280px; + top: 180px; background-image: image-url("sign-up-illustration-arm.png"); + position: absolute; z-index: 100; + pointer-events: none; } } @@ -1087,7 +1003,6 @@ tr.turn:hover { .content_map { height: 200px; - border: 1px solid $grey; margin-bottom: $lineheight; } @@ -1097,49 +1012,6 @@ tr.turn:hover { } } -/* Rules for the user profile page */ - -#userinformation { - min-height: 100px; - .userinformation-inner { - float: left; - } - .user-description { - width: 100%; - clear: both; - } -} - -.admin-user-info small { - margin-bottom: $lineheight/2; - display: inline; - margin-right: $lineheight; -} - -.contact-activity { - margin-top: $lineheight; - width: 100%; -} - -.activity-details p { - margin-left: 70px; - margin-bottom: 0; -} - -.users-show { - // Silly exception; remove when user page is redesigned. - .content-inner { - max-width: none; - } - p#no_home_location { - margin: $lineheight; - } - .user_thumbnail { - margin-top: $lineheight/4; - float: left; - } -} - /* Rules for the user map */ .content_map .leaflet-popup-content { @@ -1156,30 +1028,12 @@ tr.turn:hover { margin-top: 0 0 0 60px; font-size: 12px; } - img.user_thumbnail { - float: left; - margin: 0 $lineheight/2 0 0; - } } /* Rules for the user list */ #user_list { width: 100%; - - tr { - vertical-align: middle; - } - - p { - margin-top: 0px; - margin-bottom: 0px; - } -} - -#user_list_actions { - float: right; - margin-top: $lineheight/2; } /* Rules for the diary list page */ @@ -1190,26 +1044,9 @@ tr.turn:hover { padding-bottom: $lineheight/2; border-top: 1px solid $grey; - &:first-of-type { - margin-top: $lineheight/2; - } - &.deleted { background-color: #fee; } - - .post_heading { - margin-bottom: $lineheight; - - h2 { - margin-top: 0; - margin-bottom: $lineheight/2; - } - } - - img.user_thumbnail { - float: left; - } } /* Rules for the diary entry page */ @@ -1217,7 +1054,6 @@ tr.turn:hover { .diary_entries { #map { height: 400px; - border: 1px solid $grey; display: none; margin-bottom: $lineheight; } @@ -1246,10 +1082,6 @@ tr.turn:hover { } } -.diary_entries-show img.user_thumbnail { - float: left; -} - /* Rules for the log in page */ #login_auth_buttons { @@ -1265,7 +1097,6 @@ tr.turn:hover { .users-terms { .legale { - border: 1px solid $grey; padding: $lineheight; margin-bottom: $lineheight; overflow: auto; @@ -1326,8 +1157,9 @@ tr.turn:hover { /* Rules for messages pages */ .messages { - input[type="submit"] { + button[type="submit"] { margin: auto; + white-space: nowrap; } .inbox-row { @@ -1378,8 +1210,6 @@ tr.turn:hover { /* Rules for "flash" notice boxes shown at the top of the content area */ .flash { - padding: $lineheight; - &.error { background-color: #ff7070; } @@ -1452,10 +1282,6 @@ tr.turn:hover { vertical-align: middle; } } - - a.reverse_directions { - cursor: pointer; - } } /* Rules for user images */ @@ -1463,17 +1289,11 @@ tr.turn:hover { img.user_image { max-width: 100px; max-height: 100px; - border: 1px solid $grey; - margin-bottom: $lineheight; - float: left; - margin-right: $lineheight; } img.user_thumbnail { max-width: 50px; max-height: 50px; - border: 1px solid $grey; - margin-right: $lineheight; } img.user_thumbnail_tiny { @@ -1481,7 +1301,6 @@ img.user_thumbnail_tiny { height: auto; max-width: 25px; max-height: 25px; - border: 1px solid $grey; } /* Rules for geo microformats */ @@ -1492,28 +1311,28 @@ abbr.geo { /* General styles for action lists / subnavs / pager navs */ -ul.secondary-actions { - font-style: normal; - margin-bottom: 0; - margin-left: 0; - padding: 0; - &.pager { - display: inline-block; - margin-right: 60px; - } - > li { - display: block; - float: left; - list-style: none; - border-left: 1px solid $grey; - padding-left: $lineheight/2; - margin-right: $lineheight/2; - &:first-child { - border-left: 0; - padding-left: 0; + +nav.secondary-actions { + margin-left: -11px; + overflow: hidden; + > ul { + display: flex; + flex-direction: row; + flex-wrap: wrap; + margin-bottom: 0; + margin-left: -1px; + padding: 0; + &.pager { + display: inline-block; + margin-right: 60px; } - &:last-child { - margin-right: 0px; + > li { + flex-basis: auto; + list-style: none; + border-left: 1px solid $grey; + padding-left: $lineheight/2; + margin-right: $lineheight/2; + margin-bottom: $lineheight/8; } } } @@ -1577,11 +1396,15 @@ div.secondary-actions { } } -/* Customise the background colour of striped tables */ +/* Create a single-line dl */ -.table-striped > tbody > tr:nth-child(2n+1) > td, -.table-striped > tbody > tr:nth-child(2n+1) > th { - background-color: $offwhite; +dl.dl-inline { + dt, dd { + display: inline-block; + } + dd { + margin-right: 1em; + } } /* Rules for OpenID logo */ @@ -1596,13 +1419,11 @@ div.secondary-actions { .richtext, .prose { code { - font-size: 13px; background: $lightgrey; padding: 2px 3px; } pre { - font-size: 13px; background: $lightgrey; padding: 2px 3px; white-space: pre-wrap; @@ -1628,10 +1449,6 @@ div.secondary-actions { } } -.comments .richtext { - margin-left: 70px; -} - /* Rules for the user notes list */ .note_list { @@ -1649,19 +1466,10 @@ div.secondary-actions { /* Rules for the "Welcome" page */ .site-welcome, .site-fixthemap { - .center { - text-align: center; - .sprite { - float: none; - margin: auto; - } - } - .sprite { background-image: image-url("welcome-sprite.png"); background-size: 500px 250px; display: block; - float: left; } .icon-list { @@ -1711,15 +1519,6 @@ div.secondary-actions { /* no-r2 */ background-position: -350px 0; } - .start-mapping { - margin: auto; - cursor: pointer; - border: none; - padding: 20px 40px; - font-size: 30px; - text-decoration: none; - } - .icon.note { background-color: #333; border-radius: 4px; @@ -1761,8 +1560,8 @@ div.secondary-actions { .byosm span { display: inline-block; - width: 20px; - margin-left: -20px; + width: 1em; + margin-left: -1em; } }