Skip to content

Instantly share code, notes, and snippets.

@dbismut
Last active April 9, 2018 07:51
Show Gist options
  • Select an option

  • Save dbismut/7827ee3151310d7d639d45093c48bb9e to your computer and use it in GitHub Desktop.

Select an option

Save dbismut/7827ee3151310d7d639d45093c48bb9e to your computer and use it in GitHub Desktop.
Part 1 - Basic styling of our app
.App {
position: relative;
}
.full-width {
max-width: 480px;
width: 100vw;
}
.cover {
position: relative;
width: 100%;
background-position: center;
background-size: cover;
}
.page {
position: absolute;
top: 0;
display: flex;
justify-content: center;
min-height: 100vh;
}
h1.title {
position: relative;
z-index: 10;
margin: 0;
margin: 50px 20px;
width: 70%;
color: #fff;
font-size: 3em;
line-height: 0.9;
}
html {
margin: 0;
padding: 0;
}
body {
margin: 0 auto;
padding: 0;
min-height: 100vh;
max-width: 480px;
width: 100vw;
background: #fff;
font-family: system-ui;
}
* {
box-sizing: border-box;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.page-list {
.list {
display: flex;
flex-direction: column;
padding: 50px 20px;
width: 100%;
}
.preview {
display: flex;
align-items: flex-end;
flex-basis: 440px;
flex-shrink: 0;
margin: 15px 0;
border-radius: 16px;
box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
cursor: pointer;
user-select: none;
}
}
.page-post .post {
position: absolute;
top: 0;
z-index: 100;
width: 100%;
height: 100vh;
background: #fff;
transition: box-shadow 350ms ease;
.cover-wrapper {
position: absolute;
top: 0;
left: 0;
z-index: 10;
display: flex;
overflow: hidden;
align-items: flex-end;
max-height: 64vh;
width: 100%;
height: 100%;
.cover {
position: absolute;
top: 0;
left: 0;
height: 100%;
}
}
.content {
position: absolute;
top: 64%;
margin-left: 50%;
padding: 20px;
background: #fff;
line-height: 1.8;
transition: opacity 800ms 200ms ease;
transform: translateX(-50%);
}
}
.page-post {
.close {
position: fixed;
top: 20px;
z-index: 1000;
margin-left: 20px;
width: 36px;
height: 36px;
border-radius: 18px;
background: #fff;
opacity: 0.7;
cursor: pointer;
transition: opacity 350ms ease;
&::after,
&::before {
position: absolute;
top: 17px;
left: 8px;
width: 20px;
height: 3px;
border-radius: 1.5px;
background: #000;
content: '';
transform: rotateZ(45deg);
}
&::before {
transform: rotateZ(-45deg);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment