mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-07 05:12:31 +02:00
More consistent headers (#140)
* More consistent headers * Clean up mobile blog posts styles
This commit is contained in:
parent
967970eaa5
commit
fd05bb3239
2 changed files with 40 additions and 44 deletions
|
@ -39,9 +39,12 @@ class BlogPost extends React.Component {
|
||||||
|
|
||||||
renderAuthorPhoto() {
|
renderAuthorPhoto() {
|
||||||
const post = this.props.post;
|
const post = this.props.post;
|
||||||
|
const className = "authorPhoto" + ((post.author && post.authorTitle)
|
||||||
|
? " authorPhoto-big"
|
||||||
|
: "");
|
||||||
if (post.authorFBID) {
|
if (post.authorFBID) {
|
||||||
return (
|
return (
|
||||||
<div className="authorPhoto">
|
<div className={className}>
|
||||||
<a href={post.authorURL} target="_blank">
|
<a href={post.authorURL} target="_blank">
|
||||||
<img
|
<img
|
||||||
src={
|
src={
|
||||||
|
@ -55,7 +58,7 @@ class BlogPost extends React.Component {
|
||||||
);
|
);
|
||||||
} else if (post.authorImage) {
|
} else if (post.authorImage) {
|
||||||
return (
|
return (
|
||||||
<div className="authorPhoto">
|
<div className={className}>
|
||||||
<a href={post.authorURL} target="_blank">
|
<a href={post.authorURL} target="_blank">
|
||||||
<img
|
<img
|
||||||
src={post.authorImage}
|
src={post.authorImage}
|
||||||
|
@ -102,20 +105,21 @@ class BlogPost extends React.Component {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header className="postHeader">
|
<header className="postHeader">
|
||||||
{this.renderAuthorPhoto()}
|
|
||||||
{post.author ? (
|
|
||||||
<p className="post-authorName">
|
|
||||||
<a href={post.authorURL} target="_blank">
|
|
||||||
{post.author}
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
{post.authorTitle}
|
|
||||||
</p>
|
|
||||||
) : null}
|
|
||||||
{this.renderTitle()}
|
{this.renderTitle()}
|
||||||
<p className="post-meta">
|
<p className="post-meta">
|
||||||
{month} {day}, {year}
|
{month} {day}, {year}
|
||||||
</p>
|
</p>
|
||||||
|
<div className="authorBlock">
|
||||||
|
{post.author ? (
|
||||||
|
<p className="post-authorName">
|
||||||
|
<a href={post.authorURL} target="_blank">
|
||||||
|
{post.author}
|
||||||
|
</a>
|
||||||
|
{post.authorTitle}
|
||||||
|
</p>
|
||||||
|
) : null}
|
||||||
|
{this.renderAuthorPhoto()}
|
||||||
|
</div>
|
||||||
</header>
|
</header>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,20 +315,14 @@ header h2 {
|
||||||
.mainContainer .wrapper .post ol {
|
.mainContainer .wrapper .post ol {
|
||||||
list-style: decimal outside none;
|
list-style: decimal outside none;
|
||||||
}
|
}
|
||||||
.mainContainer .wrapper .post .postHeader {
|
|
||||||
padding: 2em 0 0;
|
|
||||||
}
|
|
||||||
.mainContainer .wrapper .post .postHeader h1 {
|
.mainContainer .wrapper .post .postHeader h1 {
|
||||||
font-size: 150%;
|
font-size: 150%;
|
||||||
line-height: 1em;
|
line-height: 1em;
|
||||||
padding: 0.4em 0 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
.mainContainer .wrapper .post .postHeader h1 a {
|
.mainContainer .wrapper .post .postHeader h1 a {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
.mainContainer .wrapper .post .postHeader .post-meta {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.mainContainer .wrapper .post .postSocialPlugins {
|
.mainContainer .wrapper .post .postSocialPlugins {
|
||||||
padding-top: 1em;
|
padding-top: 1em;
|
||||||
}
|
}
|
||||||
|
@ -363,9 +357,6 @@ header h2 {
|
||||||
.mainContainer .wrapper .post .docPagination a .pagerTitle {
|
.mainContainer .wrapper .post .docPagination a .pagerTitle {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.mainContainer .wrapper .posts .post {
|
|
||||||
margin-bottom: 6vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mainContainer .wrapper .post h1,
|
.mainContainer .wrapper .post h1,
|
||||||
.mainContainer .wrapper .post h2,
|
.mainContainer .wrapper .post h2,
|
||||||
|
@ -474,7 +465,6 @@ header h2 {
|
||||||
font-size: 250%;
|
font-size: 250%;
|
||||||
}
|
}
|
||||||
.mainContainer .wrapper .posts .post {
|
.mainContainer .wrapper .posts .post {
|
||||||
margin-bottom: 4vh;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -863,7 +853,6 @@ a:hover code {
|
||||||
float: right;
|
float: right;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
margin-top: 20px;
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
@media only screen and (min-device-width: 360px) and (max-device-width: 736px) {
|
@media only screen and (min-device-width: 360px) and (max-device-width: 736px) {
|
||||||
|
@ -1533,10 +1522,6 @@ nav.toc .toggleNav .navBreadcrumb h2 {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sideNavVisible .navPusher .mainContainer {
|
|
||||||
padding-top: 35px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (min-width: 900px) {
|
@media only screen and (min-width: 900px) {
|
||||||
nav.toc section .navGroups {
|
nav.toc section .navGroups {
|
||||||
padding: 40px 0 0;
|
padding: 40px 0 0;
|
||||||
|
@ -1633,42 +1618,52 @@ table tr th {
|
||||||
font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif;
|
font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
.mainContainer:not(.blogContainer) .wrapper .post,
|
||||||
.blogContainer .posts {
|
.blogContainer .posts,
|
||||||
margin-top: 60px;
|
.blogContainer .lonePost {
|
||||||
|
padding-top: 40px;
|
||||||
}
|
}
|
||||||
.blogContainer .posts .post {
|
.blogContainer .posts .post {
|
||||||
border-bottom: 1px solid #e0e0e0;
|
border-bottom: 1px solid #e0e0e0;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 0 10px 20px;
|
margin-bottom: 20px;
|
||||||
|
padding-bottom: 20px;
|
||||||
}
|
}
|
||||||
.blogContainer .lonePost {
|
|
||||||
margin-top: 60px;
|
.blogContainer .postHeader {
|
||||||
}
|
margin-bottom: 10px;
|
||||||
.blogContainer .postHeader h1 {
|
|
||||||
text-align: center;
|
|
||||||
}
|
}
|
||||||
.blogContainer .postHeader a {
|
.blogContainer .postHeader a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
.blogContainer .postHeader p.post-meta {
|
.blogContainer .postHeader p.post-meta {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.blogContainer .postHeader .authorBlock {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
.blogContainer .postHeader .post-authorName {
|
.blogContainer .postHeader .post-authorName {
|
||||||
color: rgba(57, 57, 57, 0.7);
|
color: rgba(57, 57, 57, 0.7);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
justify-content: center;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
|
margin-right: 10px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
text-align: center;
|
|
||||||
}
|
}
|
||||||
.blogContainer .postHeader .authorPhoto {
|
.blogContainer .postHeader .authorPhoto {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
height: 70px;
|
height: 30px;
|
||||||
margin: 0 auto;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
width: 70px;
|
width: 30px;
|
||||||
|
}
|
||||||
|
.blogContainer .postHeader .authorPhoto.authorPhoto-big {
|
||||||
|
height: 50px;
|
||||||
|
width: 50px;
|
||||||
}
|
}
|
||||||
.blog-recent {
|
.blog-recent {
|
||||||
margin: 20px 0;
|
margin: 20px 0;
|
||||||
|
@ -1680,9 +1675,6 @@ table tr th {
|
||||||
.blog-recent {
|
.blog-recent {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
}
|
}
|
||||||
.blogContainer .lonePost {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-link {
|
.header-link {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue