Ghost/ghost/admin/app/styles/layouts/main.css
Kevin Ansfield 42eb736b15 🐛 Fixed posts list scrolling and missing momentum scroll on all screens in iOS
closes https://github.com/TryGhost/Ghost/issues/9494, refs https://github.com/TryGhost/Ghost/issues/10365
- removed `overflow-y: auto` on posts list to fix the vertical scrolling
- added `overflow-wrap: break-word` so that post previews are forced to wrap for long words such as URLs
- added `-webkit-overflow-scrolling: touch` to the main scrollable pane so that iOS Safari uses momentum scrolling
2019-04-15 17:23:09 +01:00

614 lines
12 KiB
CSS

/* Global Layout
/* ---------------------------------------------------------- */
/* Main viewport, contains main content, and alerts */
/* Use `position: fixed`, covering full window area so scrolling on mobile doesn't trigger elastic scroll */
.gh-app {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: flex;
flex-direction: column;
overflow: hidden;
height: 100%;
}
/* Content viewport, contains everything else */
.gh-viewport {
flex-grow: 1;
display: flex;
overflow: hidden;
max-height: 100%;
}
.gh-main {
position: relative;
flex-grow: 1;
display: flex;
background: #fff;
overflow-y: auto;
/* prevent horizontal scroll in IE11 */
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
}
/* Flexbox fix. https://github.com/TryGhost/Ghost/issues/5804#issuecomment-141416812 */
.gh-main > section {
width: 1px;
position: relative; /* for the editor in safari */
}
/* Global Nav
/* ---------------------------------------------------------- */
.gh-nav {
position: relative;
z-index: 800;
flex: 0 0 312px;
display: flex;
flex-direction: column;
min-width: 0; /* TODO: This is a bullshit Firefox hack */
background: color-mod(var(--lightgrey) l(+5%) s(-2%));
transform: translateX(0);
border-right: 1px solid var(--lightgrey);
}
.gh-nav-menu {
flex-shrink: 0;
display: flex;
align-items: center;
padding: 24px;
cursor: pointer;
outline: none;
}
.gh-nav-menu-dropdown.ember-basic-dropdown--transitioning-in {
animation: fade-in-scale 0.2s;
animation-fill-mode: forwards;
}
.gh-nav-menu-dropdown.ember-basic-dropdown--transitioning-out {
animation: fade-out 0.5s;
animation-fill-mode: forwards;
}
.gh-nav-menu svg {
margin-right: 8px;
width: 12px;
height: 12px;
transition: margin-top 0.2s ease;
}
.gh-nav-menu svg path {
stroke-width: 1.5px;
stroke: color-mod(var(--midlightgrey) l(-5%));
}
.gh-nav-menu-icon {
flex-shrink: 0;
margin-right: 10px;
width: 32px;
height: 32px;
background-color: transparent;
background-size: 32px;
border-radius: 4px;
}
.gh-nav-menu-details {
flex-grow: 1;
padding-right: 10px;
min-width: 0; /* TODO: This is a bullshit Firefox hack */
}
.gh-nav-menu-details-blog {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 1.5rem;
line-height: 1.3em;
font-weight: 600;
}
.gh-nav-menu-details-user {
overflow: hidden;
color: var(--midgrey);
text-overflow: ellipsis;
white-space: nowrap;
font-size: 1.2rem;
line-height: 1.2em;
}
.gh-nav-body {
display: flex;
flex-direction: column;
justify-content: space-between;
flex-grow: 1;
overflow-y: auto;
}
.gh-nav-search {
position: relative;
margin: 0 24px 15px;
}
.gh-nav-search .ember-power-select-trigger {
outline: 0;
background: #fff;
}
.gh-nav-search-button {
position: absolute;
top: 0;
right: 0;
bottom: 0;
z-index: 1;
padding: 0 8px 0 5px;
}
.gh-nav-search-button svg {
width: 13px;
height: 13px;
fill: color-mod(var(--midlightgrey) l(+10%));
line-height: 13px;
transition: color 0.2s ease;
transform: rotate(90deg);
vertical-align: -1px;
}
.gh-nav-search-button svg path {
stroke: inherit;
}
.gh-nav-search-button:hover svg {
fill: var(--darkgrey);
}
.gh-nav-list {
margin: 0;
padding: 10px 0 0;
list-style: none;
font-size: 1.4rem;
line-height: 1.6em;
}
.gh-nav-list li {
margin: 0;
padding: 0;
}
.gh-nav-list .gh-nav-list-h {
overflow: hidden;
margin-top: 32px;
padding: 10px 24px;
color: color-mod(var(--darkgrey));
text-overflow: ellipsis;
text-transform: uppercase;
white-space: nowrap;
letter-spacing: 0.1em;
font-size: 1.2rem;
line-height: 1.1em;
font-weight: 500;
}
.gh-nav-list a {
display: flex;
align-items: center;
padding: 7px 24px;
color: color-mod(var(--midgrey) l(-10%) s(+5%));
opacity: 0.9;
transition: none;
}
.gh-nav-list .active {
background: color-mod(var(--lightgrey) l(-1%) s(-3%));
color: var(--darkgrey);
font-weight: 600;
opacity: 1;
}
.gh-nav-list a:not(.active):hover {
background: color-mod(var(--lightgrey) l(+2%) s(-2%));
opacity: 1;
}
/* Icons */
.gh-nav-list svg {
margin-right: 8px;
width: 16px;
height: 16px;
fill: color-mod(var(--midgrey) l(+5%));
line-height: 1;
}
.gh-nav-list .active svg {
fill: color-mod(var(--blue) l(-3%) s(+3%));
}
.gh-nav-list svg g {
stroke: color-mod(var(--midgrey) l(+5%));
}
.gh-nav-list .gh-nav-new-post {
position: absolute;
z-index: 999;
padding: 6px;
margin: 0;
right: 22px;
}
.gh-nav-list .gh-nav-new-post span {
color: color-mod(var(--blue) l(-3%) s(+5%));
width: 22px;
height: 22px;
border: 1px solid color-mod(var(--blue) l(-3%) s(+5%));
border-radius: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.gh-nav-list .gh-nav-new-post span svg {
margin-right: 0;
width: 10px;
height: 10px;
}
.gh-nav-list .gh-nav-new-post span svg path {
stroke: color-mod(var(--blue) l(-3%) s(+5%));
stroke-width: 3px;
}
.gh-nav-list a.gh-nav-new-post:hover,
.gh-nav-list a.gh-nav-new-post.active {
background: none;
}
.gh-nav-list a.gh-nav-new-post:hover span {
background: color-mod(var(--blue) l(-3%) s(+5%));
}
.gh-nav-list .gh-nav-new-post:hover span svg path {
stroke: var(--white);
}
.gh-nav-list .gh-nav-nightshift {
position: absolute;
z-index: 999;
padding: 6px;
margin: 0;
right: 20px;
}
.gh-nav-list .gh-nav-nightshift span svg {
margin-right: 0;
width: 20px;
height: 20px;
}
.gh-nav-list .gh-nav-nightshift span svg path {
fill: color-mod(var(--midgrey) l(+5%));
}
.gh-nav-list a.gh-nav-nightshift:hover,
.gh-nav-list a.gh-nav-nightshift.active {
background: none;
}
.gh-nav-list .gh-nav-nightshift:hover span svg path {
fill: color-mod(var(--blue) l(-3%) s(+5%));
}
.gh-nav-main {
margin-top: -10px;
}
.gh-nav-manage .gh-nav-list-h {
margin-top: 20px;
}
.gh-nav-labs {
margin-bottom: 20px;
padding: 0;
}
/* Mobile Nav Menu (Slides out)
/* ---------------------------------------------------------- */
.gh-mobilemenu-button {
display: none;
}
@media (max-width: 800px) {
.view-header {
padding-left: 0 !important;
}
.gh-mobilemenu-button {
flex-shrink: 0;
display: flex;
align-items: center;
margin: 0;
padding: 24px;
font-size: 18px;
line-height: 18px;
}
.gh-mobilemenu-button .icon-gh {
margin: 0;
width: 20px;
height: 18px;
}
/* Hide the nav */
.gh-nav {
position: absolute;
top: 0;
left: 0;
width: 205px;
height: 100%;
transition: transform 0.4s cubic-bezier(0.1, 0.7, 0.1, 1);
transform: translate3d(-205px, 0px, 0px);
}
.mobile-menu-expanded .gh-nav {
transform: translate3d(0,0,0);
}
}
@media (max-width: 500px) {
.gh-mobilemenu-button {
padding: 24px 15px 24px 16px;
}
.gh-nav {
width: 80vw;
transform: translate3d(-80vw, 0px, 0px);
}
.mobile-menu-expanded .gh-nav {
transform: translate3d(0,0,0);
}
.mobile-menu-expanded .content-cover {
width: 20vw;
cursor: pointer;
transform: translate3d(80vw, 0, 0);
}
.gh-nav-list {
font-size: 1.5rem;
}
.gh-nav-list-h {
font-size: 1.2rem;
}
.gh-nav-list svg {
margin-right: 8px;
width: 17px;
height: 17px;
text-align: center;
font-size: 17px;
}
}
/* Mobile Nav Bar (Sits at bottom of screen)
/* ---------------------------------------------------------- */
.gh-mobile-nav-bar { display: none; }
@media (max-width: 800px) {
/* Make space for the mobile nav bar */
.gh-viewport {
padding-bottom: 55px;
}
.gh-mobile-nav-bar {
display: flex;
align-items: center;
justify-content: space-around;
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: #fff;
border-top: var(--lightgrey) 1px solid;
}
.gh-mobile-nav-bar a,
.gh-mobile-nav-bar-more {
height: 55px;
padding: 10px 15px 5px 15px;
text-align: center;
cursor: pointer;
color: var(--darkgrey);
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
font-size: 1.2rem;
}
.gh-mobile-nav-bar a.active {
background: color-mod(var(--blue) lightness(+10%));
color: #fff;
}
.gh-mobile-nav-bar a.active svg {
fill: #fff;
}
.gh-mobile-nav-bar a.active.gh-nav-main-users g,
.gh-mobile-nav-bar a.active.gh-nav-main-users path {
fill: transparent;
stroke: white;
}
.gh-mobile-nav-bar svg,
.gh-mobile-nav-bar svg g {
width: 15px;
fill: var(--darkgrey);
}
.gh-mobile-nav-bar svg g path {
stroke: var(--darkgrey);
}
/* non-authed pages shouldn't have the mobile bar */
.ghost-setup .gh-viewport,
.ghost-reset .gh-viewport,
.ghost-signup .gh-viewport,
.ghost-login .gh-viewport {
padding-bottom: 0;
}
.ghost-setup .gh-mobile-nav-bar,
.ghost-reset .gh-mobile-nav-bar,
.ghost-signup .gh-mobile-nav-bar,
.ghost-login .gh-mobile-nav-bar {
display: none;
}
}
/* Container for App View
/* ---------------------------------------------------------- */
.gh-view {
flex-grow: 1;
display: flex;
flex-direction: column;
}
.gh-canvas {
flex-grow: 1;
padding: 24px 4vw 3vw 4vw;
margin: 0 auto;
max-width: 1200px;
}
.gh-canvas-header {
flex-shrink: 0;
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 0 2vw 0;
}
.gh-canvas-title {
display: flex;
align-items: center;
overflow: hidden;
margin: 0;
padding: 0;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 2.9rem;
line-height: 1.2em;
font-weight: 700;
letter-spacing: 0.4px;
/* match button height to avoid jump on navigation between screens*/
min-height: 35px;
}
@media (max-width: 500px) {
.gh-canvas-title {
display: block;
}
.gh-canvas-title svg {
margin: 0 5px;
}
}
.gh-canvas-title a {
color: var(--darkgrey);
}
.gh-canvas-title span {
display: inline-block;
height: 100%;
vertical-align: baseline;
}
.gh-canvas-title svg {
width: 0.6em;
height: 0.6em;
margin: 0 10px;
}
.view-header {
flex-shrink: 0;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px;
height: 65px;
border-bottom: var(--lightgrey) 1px solid;
}
.view-title {
display: flex;
align-items: center;
overflow: hidden;
margin: 0;
padding: 0;
text-overflow: ellipsis;
font-size: 2rem;
line-height: 1.2em;
font-weight: 400;
}
.view-title a {
color: inherit;
}
.view-title a:hover {
color: var(--blue);
}
.view-title svg {
margin: 0 10px;
height: 14px;
}
.view-title svg path {
fill: #818181;
}
.view-actions {
flex-shrink: 0;
display: flex;
align-items: center;
}
.view-container,
.view-content {
position: relative;
flex-grow: 1;
padding-bottom: 4vw;
}
.view-content {
padding: 20px;
}
.view-content p,
.view-content p * {
user-select: text;
}
@media (max-width: 400px) {
.view-header {
padding: 0 7px;
height: 50px;
}
.view-title {
font-size: 1.8rem;
}
.view-content {
padding: 15px;
}
}