diff --git a/src/App.js b/src/App.js index 75fa3a3c0..39ef62e70 100644 --- a/src/App.js +++ b/src/App.js @@ -50,6 +50,16 @@ export default { window.removeEventListener('resize', this.updateMobileState) }, computed: { + classes () { + return [ + { + '-reverse': this.reverseLayout, + '-no-sticky-headers': this.noSticky, + '-has-new-post-button': this.newPostButtonShown + }, + '-' + this.layoutType + ] + }, currentUser () { return this.$store.state.users.currentUser }, userBackground () { return this.currentUser.background_image }, instanceBackground () { @@ -72,6 +82,10 @@ export default { !this.$store.getters.mergedConfig.hideISP && this.$store.state.instance.instanceSpecificPanelContent }, + newPostButtonShown () { + if (this.$route.name === 'chat' || this.$route.name === 'chats') return false + return this.$store.getters.mergedConfig.alwaysShowNewPostButton || this.layoutType === 'mobile' + }, showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel }, shoutboxPosition () { return this.$store.getters.mergedConfig.showNewPostButton || false diff --git a/src/App.scss b/src/App.scss index 678c44104..c8470c8a5 100644 --- a/src/App.scss +++ b/src/App.scss @@ -1,16 +1,15 @@ // stylelint-disable rscss/class-format @import './_variables.scss'; +:root { + --navbar-height: 50px; +} + html { font-size: 14px; - overflow: hidden; - max-height: 100vh; } body { - overflow: hidden; - max-height: 100vh; - max-width: 100vw; font-family: sans-serif; font-family: var(--interfaceFont, sans-serif); margin: 0; @@ -19,6 +18,7 @@ body { overflow-x: hidden; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; + overscroll-behavior-y: none; &.hidden { display: none; @@ -26,6 +26,10 @@ body { } @media (any-pointer: fine) { + body { + background: var(--bg); + } + * { scrollbar-color: var(--btn) transparent; @@ -106,33 +110,26 @@ nav { box-shadow: var(--topBarShadow); box-sizing: border-box; height: var(--navbar-height); -} - -#app-loaded { - min-height: 100vh; - min-width: 100vw; - overflow: hidden; - - --navbar-height: 50px; -} - -#content { - overscroll-behavior-y: none; - overflow-y: scroll; - overflow-x: hidden; - position: sticky; + position: fixed; } #sidebar { grid-area: sidebar; } -#notifs-column { - grid-area: notifs; +.column.-scrollable { + top: var(--navbar-height); + position: sticky; } #main-scroller { + margin-top: var(--navbar-height); grid-area: content; + position: relative; +} + +#notifs-column { + grid-area: notifs; } .app-bg-wrapper { @@ -175,11 +172,11 @@ nav { grid-template-rows: 1fr; box-sizing: border-box; margin: 0 auto; - height: calc(100vh - var(--navbar-height)); align-content: flex-start; flex-wrap: wrap; - padding: 0 10px; + padding: 0 calc(var(--columnGap) / 2); justify-content: center; + min-height: 100vh; .column { --___columnMargin: var(--columnGap); @@ -187,19 +184,19 @@ nav { display: grid; grid-template-columns: 100%; box-sizing: border-box; - padding-top: 10px; grid-row-start: 1; grid-row-end: 1; margin: 0 calc(var(--___columnMargin) / 2); + padding: calc(var(--___columnMargin) / 2) 0; row-gap: var(--___columnMargin); align-content: start; &.-scrollable { --___paddingIncrease: calc(var(--columnGap) / 2); - padding-top: 10px; + padding-top: calc(var(--columnGap) / 2); position: sticky; - top: 0; + top: var(--navbar-height); max-height: calc(100vh - var(--navbar-height)); overflow-y: auto; overflow-x: hidden; @@ -220,11 +217,17 @@ nav { } .panel-heading.-sticky { - top: -10px; + top: calc(var(--columnGap) / -2); } } } + &.-has-new-post-button { + .column { + padding-bottom: 20em; + } + } + &.-no-sticky-headers { .column { .panel-heading.-sticky { @@ -271,6 +274,12 @@ nav { display: none; } } + + &.-normal { + #notifs-column { + display: none; + } + } } .text-center { @@ -728,35 +737,6 @@ i[class*=icon-], flex: 1; } -@media all and (min-width: 800px) { - .sidebar-bounds { - overflow: hidden; - max-height: 100vh; - width: 345px; - position: fixed; - margin-top: -10px; - - .sidebar-scroller { - height: 96vh; - width: 365px; - padding-top: 10px; - padding-right: 50px; - overflow-x: hidden; - overflow-y: scroll; - } - - .sidebar { - width: 345px; - } - } - - .sidebar-flexer { - max-height: 96vh; - flex-shrink: 0; - flex-grow: 0; - } -} - @media all and (max-width: 800px) { .mobile-hidden { display: none; diff --git a/src/App.vue b/src/App.vue index b5f6e7d36..094a8ab98 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,7 +13,7 @@