Skip to content

Instantly share code, notes, and snippets.

@verfasor
Created December 15, 2023 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save verfasor/3cec2fd34f6dd2438f86ffb40a6c528f to your computer and use it in GitHub Desktop.
Save verfasor/3cec2fd34f6dd2438f86ffb40a6c528f to your computer and use it in GitHub Desktop.
mgx-v1.0.0.css for bearblog
/* Settings */
:root {
--color-dark: #1a1a1a;
--color-light: #fafafa;
--color-primary: #1a0dab;
--spacing: 1rem;
--font-stack: system-ui;
--max-width: 700px;
}
/* Dark mode settings */
@media (prefers-color-scheme: dark) {
:root {
--color-dark: #dadce0;
--color-light: #202124;
--color-primary: #8ab4f8;
}
}
/* Basic styles */
@media screen and (min-width: 1000px) {
img {
min-width: 623px;
}
}
@media screen and (max-width: 1000px) {
header {
margin-bottom: -0.5rem;
}
footer {
margin-top: -1.5rem;
}
body {
padding: 4vw !important;
}
ul.blog-posts li {
margin-bottom: 1rem;
}
nav p {
gap: 1rem !important;
}
}
@media screen and (max-width: 620px) {
body {
font-size: 1.05rem !important;
}
h1 {
font-size: 1.7rem !important;
}
h2 {
font-size: 1.5rem !important;
}
h3 {
font-size: 1.2rem !important;
}
}
body {
background: var(--color-light);
color: var(--color-dark);
padding: 2vw;
font-family: var(--font-stack);
font-size: 1.125rem;
line-height: 1.575;
gap: calc(var(--spacing) * 2);
min-height: 100vh;
max-width: var(--max-width);
margin: 0 auto;
}
* {
box-sizing: border-box;
}
header,
main,
footer {
max-width: 61ch;
margin-inline: auto;
width: 100%;
}
/* Header styles */
header {
padding-bottom: var(--spacing);
flex-basis: 4rem;
flex-grow: 1;
}
/* Main content styles */
main {
flex-basis: 0;
flex-grow: 999;
padding-bottom: calc(var(--spacing) * 2);
flex-basis: 20rem;
}
/* Footer styles */
footer {
flex-basis: 0;
flex-grow: 1;
padding-top: var(--spacing);
}
/* Link styles */
a {
color: currentColor;
text-decoration-color: currentColor;
text-decoration-thickness: 0.1ex;
text-underline-offset: 0.3ex;
}
a:hover {
color: var(--color-primary);
text-decoration-color: var(--color-primary);
}
/* Image styles */
img {
display: block;
max-width: 100%;
height: auto;
}
/* Heading styles */
h1 {
font-weight: 700;
line-height: 1.3;
text-wrap: balance;
}
h2,
h3,
h4,
h5 {
font-weight: 600;
line-height: 1.3;
text-wrap: balance;
}
/* Adjustments for different heading levels */
h1 {
font-size: 2rem;
margin-top: .9rem;
}
h2 {
font-size: 1.5rem;
}
h3 {
font-size: 1.2rem;
}
h4 {
font-size: 1.1rem;
}
h5 {
font-size: 1rem;
}
/* List styles */
ul,
ol {
padding-inline-start: var(--spacing);
}
/* Blockquote styles */
blockquote {
padding-inline-start: 10px;
border-inline-start: 0.2em solid;
font-style: normal;
font-size: inherit;
margin-left: 0;
margin-right: 0;
}
/* Flow and rhythm */
:is(h1, h2, h3, h4, h5, blockquote) {
margin-block-end: calc(var(--spacing) / 2);
}
:is(h1, h2, h3, h4, h5) + * {
margin-block-start: calc(var(--spacing) / 3);
}
:is(h1, h2, h3, h4, h5) + :where(h2, h3, h4, h5) {
margin-block-start: calc(var(--spacing) * 2);
}
/* Line lengths */
h2,
h3 {
max-width: 32ch;
}
/* Bear Content */
.title {
display: none;
}
.title h1 {
font-size: 1.2rem;
margin-top: calc(var(--spacing) / 2);
}
nav {
position: sticky;
top: var(--spacing);
}
nav p {
display: flex;
gap: 1rem;
}
ul.blog-posts {
list-style-type: none;
padding: unset;
}
ul.blog-posts li {
display: flex;
flex-direction: column;
}
@media screen and (min-width: 600px) {
ul.blog-posts li {
flex-direction: row;
gap: calc(var(--spacing) / 2);
}
}
ul.blog-posts li span {
min-width: 8ch;
}
time {
opacity: 0.5;
font-style: normal;
font-size: 85%;
}
.highlight,
.code {
padding: 5px 15px;
background-color: rgba(0, 0, 0, 0.1);
border-radius: 3px;
overflow-x: auto;
line-height: 1.2;
font-size: 1rem;
}
table {
width: 100%;
}
th {
text-align: left;
}
hr {
border-color: rgba(0, 0, 0, 0.1);
}
/* extra */
footer a {
text-transform: lowercase;
}
.embedded.blog-posts {
text-transform: lowercase;
}
header a {
text-decoration: none;
}
#footer-directive {
line-height: 0;
}
.footnotes {
font-size: 90%;
}
sup a {
text-decoration: none;
border: 1px dotted;
}
.tags a, ul.blog-posts li a {
text-decoration: none;
}
ul.blog-posts {
list-style-type: none;
padding: unset;
}
td {
border: 1px dotted;
font-size: 90%;
padding: 5px;
}
.pagetitle {
margin-bottom: 1.25rem;
}
p.tags {
display: none;
}
/* Notion-like callouts */
.callout {
font-size:95%;
border-radius: 3px;
padding: 16px;
}
@media (prefers-color-scheme: light) {
.grey_callout {
background: rgb(241, 241, 239);
}
.brown_callout {
background: rgb(244, 238, 238);
}
.orange_callout {
background: rgb(251, 236, 221);
}
.yellow_callout {
background: rgb(251, 243, 219);
}
.green_callout {
background: rgb(237, 243, 236);
}
.blue_callout {
background: rgb(231, 243, 248);
}
.purple_callout {
background: rgba(244, 240, 247, 0.8);
}
.pink_callout {
background: rgba(249, 238, 243, 0.8);
}
.red_callout {
background: rgb(253, 235, 236);
}
}
@media (prefers-color-scheme: dark) {
.callout {
color: white;
}
.grey_callout {
background: rgba(124,139,154,.13);
}
.brown_callout {
background: rgb(55, 34, 13);
}
.orange_callout {
background: rgb(71, 45, 1);
}
.yellow_callout {
background: rgba(240,165,15,.13);
}
.green_callout {
background: rgba(52,183,67,.12);
}
.blue_callout {
background: rgba(33,172,232,.12);
}
.purple_callout {
background: rgba(135,85,236,.12);
}
.pink_callout {
background: rgba(225,71,174,.11);
}
.red_callout {
background: rgba(209,46,46,.11);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment