Skip to content

Instantly share code, notes, and snippets.

@jupegarnica
Created December 18, 2020 15:04
Show Gist options
  • Save jupegarnica/d01e2faabb569c360f7ebcde93fa90c8 to your computer and use it in GitHub Desktop.
Save jupegarnica/d01e2faabb569c360f7ebcde93fa90c8 to your computer and use it in GitHub Desktop.
:root {
/* Colors */
--color-background: white;
--color-text: #333;
--color-text-muted: #777;
--color-border: #eee;
--color-primary: hsl(210, 70%, 50%);
--color-background-faded: #f2f2f2;
--color-background-sidebar: #fafafa;
--color-background-code: #f2f2f2;
--box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.1);
/* Layout */
--height-header: 3rem;
--width-sidebar: 18rem;
--width-toc: 12rem;
/* Typography */
--font-size: 18px;
--font-size-small: 0.8rem;
--line-height: 1.5;
--line-height-small: 1.25;
--font-weight-bold: 600;
/* Safari for OS X and iOS (San Francisco) */
/* Chrome for OS X (San Francisco) */
/* Chinese font for OSX and iOS */
/* Android */
/* Windows */
/* Chinese font for Windows */
/* Linux */
/* Basic web fallback */
/* Emoji */
--font-family: '-apple-system', 'BlinkMacSystemFont',
'Hiragino Sans GB', 'Roboto', 'Segoe UI', 'Microsoft Yahei',
'微软雅黑', 'Oxygen-Sans', 'Ubuntu', 'Cantarell', 'Helvetica',
'Arial', 'STHeiti', sans-serif, 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol';
--font-family-monospace: 'Menlo', 'Monaco', 'Consolas',
'Liberation Mono', 'Courier New', monospace;
/* z-index */
--z-index-sidebar: 100;
--z-index-header: 200;
--z-index-popover: 300;
/* Others */
--opacity: 0.7;
--transition-duration: 0.3s;
}
html.is_dark {
--color-background: #222;
--color-text: #aaa;
--color-text-muted: #777;
--color-border: #333;
--color-primary: hsl(210, 60%, 60%);
--color-background-faded: #111;
--color-background-sidebar: #1a1a1a;
--color-background-code: #333;
--box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.8);
}
/* RESPONSIVE FONT SIZE */
html {
font-size: clamp(16px, 4vw, 22px);
}
html {
font-size: min(max(16px, 4vw), 22px);
}
/*
html {
font-size: 16px;
}
@media screen and (min-width: 320px) {
html {
font-size: calc(16px + 6 * ((100vw - 320px) / 680));
}
}
@media screen and (min-width: 1000px) {
html {
font-size: 22px;
}
} */
/* SCROLLBAR */
/* body::-webkit-scrollbar {
width: 1em;
}
body::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
} */
*::-webkit-scrollbar {
width: 0.2rem; /* width of the entire scrollbar */
}
*::-webkit-scrollbar-track {
background: var(
--color-background-code
); /* color of the tracking area */
}
*::-webkit-scrollbar-thumb {
background-color: var(
--color-background-faded
); /* color of the scroll thumb */
border-radius: var(
--font-size
); /* roundness of the scroll thumb */
border: 0.1rem solid var(--color-background-code); /* creates padding around scroll thumb */
}
/**
* Resets
*
* Global resets to common HTML elements.
* Doesn't depend on any third party libraries.
* Inspired by Normalise.css and bootstrap/_reboot.scss
* Doesn't reset form and table because it's hard to set styles back in third-party libraries
*/
/* #region html and body */
html {
box-sizing: border-box;
/* Prevent adjustments of font size after orientation changes in IE and iOS. */
text-size-adjust: 100%;
font-size: var(--font-size);
line-height: var(--line-height);
color: var(--color-text);
background-color: var(--color-background);
}
*,
*::before,
*::after {
box-sizing: inherit;
}
body {
margin: 0;
}
/* #endregion */
/* #region Typography */
body,
button,
input,
select,
textarea {
font-family: var(--font-family);
}
code,
kbd,
samp,
pre,
time {
font-family: var(--font-family-monospace);
}
h1,
h2,
h3,
h4 {
margin-top: 2rem;
}
h5 {
margin-top: 1.5rem;
}
h6 {
margin-top: 1rem;
}
p,
blockquote,
table,
dl,
ul,
ol,
address,
figure {
margin: 1rem 0 0 0;
}
hr {
margin: 2rem 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: var(--font-weight-bold);
line-height: var(--line-height-small);
margin-bottom: 0.5rem;
}
h1 {
font-size: 32px;
}
h2 {
font-size: 24px;
}
h3 {
font-size: 18px;
}
h4,
h5,
h6 {
font-size: var(--font-size);
}
a {
color: var(--color-primary);
text-decoration: none;
/* Remove gaps in links underline in iOS 8+ and Safari 8+. */
-webkit-text-decoration-skip: objects;
}
a:active,
a:hover {
text-decoration: underline;
}
b,
strong,
dt {
font-weight: var(--font-weight-bold);
}
code,
kbd,
samp {
background-color: var(--color-background-code);
font-size: var(--font-size-small);
padding: 0.2em 0.3em;
}
pre {
background-color: var(--color-background-faded);
font-size: 12px;
line-height: var(--line-height-small);
overflow: auto;
-webkit-overflow-scrolling: touch;
margin: 1rem 0 0 0;
padding: 1rem;
}
pre[class*='language-'] {
margin: 1rem 0 0 0 !important;
padding: 0.75rem 1rem !important;
font-size: 12px !important;
}
code[class*='language-'] {
font-size: 12px !important;
}
/* Override the code styles */
pre code {
background-color: transparent;
padding: 0;
}
blockquote {
border-left: 5px solid var(--color-border);
color: var(--color-text-muted);
padding: 0.5rem 0 0.5rem 1rem;
}
blockquote > *:first-child {
margin-top: 0;
}
ul,
ol {
padding: 0 0 0 1.5em;
line-height: var(--line-height-small);
}
dt,
dd,
ol ol,
ul ul,
ol ul,
ul ol {
margin: 0;
}
li {
margin-top: 0.5rem;
}
table {
font-size: 14px;
line-height: var(--line-height-small);
}
hr {
border: 0;
border-top: 1px solid var(--color-border);
}
small {
font-size: var(--font-size-small);
}
/* Prevent `sub` and `sup` elements from affecting the line height in all browsers. */
sub,
sup {
font-size: var(--font-size-small);
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.2em;
}
sup {
top: -0.4em;
}
address,
time {
font-style: normal;
color: var(--color-text-muted);
}
mark {
background-color: yellow;
color: var(--color-text);
padding: 0 0.2em;
}
rt {
font-size: 60%;
}
abbr[title] {
border-bottom: 0;
text-decoration: underline;
text-decoration: underline dotted;
}
/* #endregion */
/* #region Embedded Content */
/* Add the correct display in iOS 4-7. */
audio:not([controls]) {
display: none;
height: 0;
}
img {
max-width: 100%;
vertical-align: middle;
/* Remove the border on images inside links in IE 10-. */
border-style: none;
}
audio,
video {
max-width: 100%;
}
figcaption {
color: var(--color-text-muted);
font-size: var(--font-size-small);
}
table {
/* Reset for nesting within parents with `background-color`. */
background-color: var(--color-background);
border: 0;
border-collapse: collapse;
border-spacing: 0;
width: 100%;
}
table caption {
caption-side: bottom;
color: var(--color-text-muted);
font-size: var(--font-size-small);
padding: 5px 1rem;
text-align: left;
}
table th,
table td {
border: 0;
border-bottom: 1px solid var(--color-border);
padding: 5px 0.5rem;
text-align: left;
}
table th {
background-color: var(--color-background-faded);
font-weight: var(--font-weight-bold);
}
/* #endregion */
/* #region Forms */
/**
* iOS "clickable elements" fix for role="button"
*
* Fixes "clickability" issue (and more generally, the firing of events such as focus as well)
* for traditionally non-focusable elements with role="button"
* see https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
*/
[role='button'] {
cursor: pointer;
}
/* Avoid 300ms click delay on touch devices that support the `touch-action` CSS property. */
a,
area,
button,
[role='button'],
input,
label,
select,
summary,
textarea {
touch-action: manipulation;
}
button,
/* Prevent a WebKit bug where (*) destroys native `audio` and `video` controls in Android 4. */
html [type=button],
[type=reset],
[type=submit],
::-webkit-file-upload-button {
/* (*) Correct the inability to style clickable types in iOS and Safari. */
appearance: button;
}
[type='search'] {
/* Correct the odd appearance in Chrome and Safari. */
appearance: none;
}
/* Change font properties to `inherit` in Safari. */
::-webkit-file-upload-button {
font: inherit;
}
[hidden] {
display: none;
}
fieldset {
border: 1px solid var(--color-border);
margin: 1rem 0 0;
padding: 0 1rem 1rem;
}
legend {
padding: 0 0.2em;
}
optgroup {
color: var(--color-text-muted);
font-style: normal;
font-weight: normal;
}
option {
color: var(--color-text);
}
progress {
max-width: 100%;
}
/* #endregion */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment