diff --git a/app/assets/stylesheets/foundation_and_overrides.scss b/app/assets/stylesheets/foundation_and_overrides.scss index a765f1761..b093af62b 100644 --- a/app/assets/stylesheets/foundation_and_overrides.scss +++ b/app/assets/stylesheets/foundation_and_overrides.scss @@ -43,9 +43,7 @@ @include foundation-table; @include foundation-tabs; @include foundation-thumbnail; -@include foundation-title-bar; @include foundation-tooltip; -@include foundation-top-bar; @include foundation-visibility-classes; @include foundation-float-classes; @include motion-ui-transitions; diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index d0ef59c55..96f9b4bdf 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -514,26 +514,6 @@ body > header, border-bottom: 1px solid #fff; } - .remote-translations-button { - - &.callout { - margin: 0; - padding: rem-calc(6); - - [type="submit"] { - @include brand-color; - background: none; - border: 0; - cursor: pointer; - font-weight: bold; - - &:hover { - text-decoration: underline; - } - } - } - } - .external-links { padding: rem-calc(6) 0; text-align: center; @@ -562,90 +542,32 @@ body > header, } .top-bar { - background-color: inherit; - padding: 0; + align-items: center; + display: flex; + padding-bottom: $topbar-padding; + padding-top: $topbar-padding; - @include breakpoint(medium) { - justify-content: flex-start; + @include breakpoint(small only) { + flex-direction: row-reverse; + flex-wrap: wrap; - .top-bar-title { - flex-grow: 1; - } - } + .responsive-menu { + width: 100%; - ul { - background: none; - } - - .menu > li { - display: block; - width: 100%; - - @include breakpoint(medium) { - width: auto; - } - - a { - color: inherit; - line-height: inherit; - padding-left: 0; - - @include breakpoint(medium) { - font-size: $small-font-size; - padding: rem-calc(8) rem-calc(16); + a { + display: inline-block; } } - .button { - background: none; - text-align: left; - - @include breakpoint(medium) { - @include brand-color; - background: $body-background; - text-align: center; - } + [data-responsive-toggle] { + flex-grow: 1000; } } - .has-submenu { - - &.is-active a { - font-weight: bold; - } - } - - .menu { - - @include breakpoint(small only) { - border-bottom: 1px solid $border; - margin-bottom: $line-height; - margin-top: $line-height / 2; - padding-bottom: $line-height; - - .submenu { - margin-top: 0; - } - } - - &.is-dropdown-submenu { - @extend %body-colors; - margin: 0; - margin-top: rem-calc(-12); - padding: 0; - z-index: 9; - } - - .is-submenu-item { - display: block; - height: auto; - margin-bottom: 0; - } - } - - .top-bar-title { + h1 { + flex-grow: 1; line-height: $line-height; - margin-right: 0; + margin-bottom: 0; a img { height: rem-calc(48); @@ -671,11 +593,6 @@ body > header, cursor: inherit; } -.title-bar { - background: none; - float: right; -} - .dropdown.menu > li { a { @@ -731,104 +648,6 @@ body > header, } } -.subnavigation { - display: flex; - flex-direction: column; - - @include breakpoint(medium) { - @include background-with-text-contrast($subnavigation, subnavigation); - flex-direction: row; - padding-bottom: 0; - - > :first-child { - flex-grow: 1; - } - } - - ul { - list-style-type: none; - margin: 0; - - li { - @include breakpoint(medium) { - display: inline-block; - margin-right: rem-calc(20); - } - } - } - - a { - color: inherit; - display: inline-block; - padding-bottom: $line-height / 2; - padding-top: $line-height / 2; - position: relative; - text-align: left; - width: 100%; - - @include breakpoint(medium) { - display: block; - font-weight: bold; - width: auto; - - &:hover { - @include anchor-color; - } - - &.is-active { - @include brand-color; - border-bottom: 2px solid; - margin-bottom: 1px; - } - } - - &:focus { - z-index: 1; - } - } - - .input-group { - padding-top: $line-height / 4; - - @include breakpoint(medium) { - margin-bottom: 0; - } - } - - .input-group-field { - margin-bottom: 0 !important; - } - - .input-group-button { - line-height: $line-height * 1.5; - padding-bottom: 0; - - button { - @include background-with-text-contrast($border); - border: 1px solid #ccc; - border-left: 0; - height: $line-height * 1.5; - line-height: $line-height * 1.5; - padding-top: 0; - } - } - - input { - height: $line-height * 1.5 !important; - margin-bottom: 0; - margin-right: 0; - width: 100%; - } -} - -.top-bar-right { - - .is-active { - font-weight: bold; - text-decoration: underline; - } -} - .submenu { border-bottom: 1px solid $border; clear: both; @@ -1167,9 +986,7 @@ form { } &.primary { - background-color: $info-bg; - border-color: $info-border; - color: $color-info; + @include info-colors; } &.warning { diff --git a/app/assets/stylesheets/layout/account_menu.scss b/app/assets/stylesheets/layout/account_menu.scss new file mode 100644 index 000000000..385513af8 --- /dev/null +++ b/app/assets/stylesheets/layout/account_menu.scss @@ -0,0 +1,64 @@ +.account-menu.menu { + + @include breakpoint(small only) { + margin-top: $line-height / 2; + + &, + .menu { + border-bottom: 1px solid $border; + margin-bottom: $line-height; + padding-bottom: $line-height; + } + } + + .is-dropdown-submenu { + @extend %body-colors; + margin: 0; + margin-top: rem-calc(-12); + padding: 0; + z-index: 9; + } + + .is-submenu-item { + display: block; + margin-bottom: 0; + } + + li { + display: block; + width: 100%; + + @include breakpoint(medium) { + width: auto; + } + + a { + color: inherit; + line-height: inherit; + padding-left: 0; + + @include breakpoint(medium) { + font-size: $small-font-size; + padding: rem-calc(8) rem-calc(16); + } + } + + .button { + background: none; + text-align: left; + + @include breakpoint(medium) { + @include brand-color; + background: $body-background; + text-align: center; + } + } + } + + .has-submenu { + + &.is-active a { + font-weight: bold; + } + } +} diff --git a/app/assets/stylesheets/layout/admin_header.scss b/app/assets/stylesheets/layout/admin_header.scss index 758f1782a..105aa3f35 100644 --- a/app/assets/stylesheets/layout/admin_header.scss +++ b/app/assets/stylesheets/layout/admin_header.scss @@ -15,30 +15,21 @@ } .top-bar { - height: auto; - padding-top: $line-height / 2; - @include breakpoint(small only) { - .top-bar-left ul { - display: inline-block; - } - - .top-bar-right { - - > ul { - border-bottom: 0; - padding-bottom: 0; - margin-bottom: 0; - } - - .submenu { - position: initial; - } + .account-menu { + border-bottom: 0; + padding-bottom: 0; + margin-bottom: 0; a { font-weight: normal; } + + .is-active { + font-weight: bold; + text-decoration: underline; + } } [class^="icon-"] { @@ -46,17 +37,16 @@ } } + @include breakpoint(medium) { + padding-bottom: 0.8rem; + padding-top: 0.8rem; + } + [class^="icon-"] { font-size: $base-font-size; } h1 { - margin-top: $line-height / 2; - margin-bottom: 0; - - @include breakpoint(medium) { - margin-top: 0; - } small { color: inherit; @@ -69,21 +59,7 @@ font-family: "Lato" !important; font-size: rem-calc(24); font-weight: lighter; - line-height: 1; } } } - - .top-bar .menu > li { - - @include breakpoint(medium) { - height: auto !important; - } - } - - .title-bar { - color: inherit; - position: absolute; - right: 12px; - } } diff --git a/app/assets/stylesheets/layout/remote_translations_button.scss b/app/assets/stylesheets/layout/remote_translations_button.scss new file mode 100644 index 000000000..5e796f274 --- /dev/null +++ b/app/assets/stylesheets/layout/remote_translations_button.scss @@ -0,0 +1,13 @@ +.remote-translations-button { + @include info-colors; + font-size: $small-font-size; + text-align: center; + padding: rem-calc(6); + + [type="submit"] { + @include link; + background: none; + border: 0; + font-weight: bold; + } +} diff --git a/app/assets/stylesheets/layout/subnavigation.scss b/app/assets/stylesheets/layout/subnavigation.scss new file mode 100644 index 000000000..e67a3b5a5 --- /dev/null +++ b/app/assets/stylesheets/layout/subnavigation.scss @@ -0,0 +1,87 @@ +.subnavigation { + display: flex; + flex-direction: column; + + @include breakpoint(medium) { + @include background-with-text-contrast($subnavigation, subnavigation); + flex-direction: row; + padding-bottom: 0; + + > :first-child { + flex-grow: 1; + } + } + + ul { + list-style-type: none; + margin: 0; + + li { + @include breakpoint(medium) { + display: inline-block; + margin-right: rem-calc(20); + } + } + } + + a { + color: inherit; + display: inline-block; + padding-bottom: $line-height / 2; + padding-top: $line-height / 2; + position: relative; + text-align: left; + + @include breakpoint(medium) { + display: block; + font-weight: bold; + + &:hover { + @include anchor-color; + } + + &.is-active { + @include brand-color; + border-bottom: 2px solid; + margin-bottom: 1px; + } + } + + &:focus { + z-index: 1; + } + } + + .input-group { + padding-top: $line-height / 4; + + @include breakpoint(medium) { + margin-bottom: 0; + } + } + + .input-group-field { + margin-bottom: 0 !important; + } + + .input-group-button { + line-height: $line-height * 1.5; + padding-bottom: 0; + + button { + @include background-with-text-contrast($border); + border: 1px solid #ccc; + border-left: 0; + height: $line-height * 1.5; + line-height: $line-height * 1.5; + padding-top: 0; + } + } + + input { + height: $line-height * 1.5 !important; + margin-bottom: 0; + margin-right: 0; + width: 100%; + } +} diff --git a/app/assets/stylesheets/mixins/colors.scss b/app/assets/stylesheets/mixins/colors.scss index d40c9b9a4..9454d55d2 100644 --- a/app/assets/stylesheets/mixins/colors.scss +++ b/app/assets/stylesheets/mixins/colors.scss @@ -94,6 +94,12 @@ @include text-color($anchor-color-hover, anchor-color-hover); } +@mixin info-colors { + background-color: $info-bg; + border-color: $info-border; + color: $color-info; +} + %brand-background { @include brand-background; } diff --git a/app/components/layout/account_menu_component.html.erb b/app/components/layout/account_menu_component.html.erb index 7c6875c84..8c34d82a7 100644 --- a/app/components/layout/account_menu_component.html.erb +++ b/app/components/layout/account_menu_component.html.erb @@ -1,4 +1,4 @@ -