Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@stolinski
Last active August 5, 2020 21:00
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 stolinski/b0565d2464d0ac655935144cf50bda40 to your computer and use it in GitHub Desktop.
Save stolinski/b0565d2464d0ac655935144cf50bda40 to your computer and use it in GitHub Desktop.
levelup-classless.css
@import url("https://fonts.googleapis.com/css?family=Space+Mono:400|Work+Sans:400");
:root {
/* Define Colors as colors */
--green: #00ebc7;
--red: #ff5470;
--yellow: #fde24f;
--black: #1b2d45;
--darkBlue: #00214d;
--darkGrey: #222;
--grey: #bfbfbf;
--lightGrey: #f2f4f6;
--white: #fff;
/* Define Colors intentions */
--primary: var(--green);
--danger: var(--red);
--background: var(--lightGrey);
--textColor: var(--black);
--buttonTextColor: var(--black);
--lineColor: var(--grey);
--cardBg: var(--white);
--headerBackground: var(--darkBlue);
--footerBackground: var(--black);
/* Styles */
--line: solid 1px var(--lineColor);
/* Type */
--headingFont: "Space Mono", monospace;
--bodyFont: "Work Sans", sans-serif;
--baseFontSize: 100%;
--h1: 3.052em;
--h2: 2.441em;
--h3: 1.953em;
--h4: 1.563em;
--h5: 1.25em;
--smallText: 0.8em;
/* Elevation */
--level-1: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
--level-2: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06);
--level-3: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
0 4px 6px -2px rgba(0, 0, 0, 0.05);
--level-4: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
0 10px 10px -5px rgba(0, 0, 0, 0.04);
/* Positioning */
--containerPadding: 2.5%;
--headerHeight: 3rem;
--borderRadius: 10px;
}
/* FROM Type Scale */
html {
font-size: var(--baseFontSize);
box-sizing: border-box;
} /*18px*/
*,
*::before,
*::after {
box-sizing: inherit;
}
body {
font-family: var(--bodyFont);
font-weight: 400;
line-height: 1.65;
background: var(--background);
color: var(--textColor);
}
header {
color: white;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: var(--headerHeight);
background: var(--headerBackground);
box-shadow: var(--level-2);
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 var(--containerPadding);
}
header nav a {
color: white;
text-decoration: none;
}
header nav a + a {
margin-left: 10px;
}
footer {
--footerTextColor: var(--lightGrey);
color: var(--footerTextColor);
background: var(--footerBackground);
padding: 2rem var(--containerPadding);
text-align: center;
}
footer a {
color: var(--footerTextColor);
}
footer p {
margin-bottom: 0;
max-width: none;
}
p {
margin-bottom: 1.15rem;
max-width: 40em;
}
p a,
blockquote a {
color: var(--textColor);
text-decoration: none;
border-bottom: solid 2px var(--primary);
}
h1,
h2,
h3,
h4,
h5 {
margin: 2.75rem 0 1.05rem;
font-family: var(--headingFont);
font-weight: 400;
line-height: 1.15;
}
h1 {
margin-top: 0;
font-size: var(--h1);
}
h2 {
font-size: var(--h2);
}
h3 {
font-size: var(--h3);
}
h4 {
font-size: var(--h4);
}
h5 {
font-size: var(--h5);
}
small,
.text_small {
font-size: var(--smallText);
}
/* End typescale */
blockquote {
margin: 10px;
padding: 2em;
background: var(--cardBg);
box-shadow: var(--level-3);
}
label {
display: block;
font-size: var(--smallText);
}
input,
textarea {
padding: 4px 5px;
border: var(--line);
border-radius: 4px;
}
textarea {
width: 100%;
height: 5rem;
}
::placeholder {
color: var(--grey);
}
select {
border: var(--line);
}
hr {
border-top: var(--line);
}
button {
--buttonColor: var(--primary);
appearance: none;
color: var(--buttonTextColor);
background-color: var(--buttonColor);
border: none;
border-radius: 10px;
padding: 5px 25px;
box-shadow: var(--level-1);
transition: 0.3s ease-in-out box-shadow;
}
button:hover {
box-shadow: var(--level-2);
}
button[disabled] {
opacity: 0.4;
}
/* .cancel can mean anything */
button.cancel {
--buttonColor: var(--danger);
--textColor: white;
}
button.small {
font-size: var(--smallText);
}
.layout {
/* top padding header height + whatever visual padding we want */
padding: calc(3rem + var(--headerHeight)) var(--containerPadding);
}
.grid {
--gridCols: 2;
display: block;
grid-template-columns: repeat(var(--gridCols), 1fr);
}
.grid--split {
grid-template-columns: 33% 67%;
grid-gap: 20px;
}
.cols-3 {
--gridCols: 3;
}
.split {
display: grid;
grid-template-columns: 33% 67%;
grid-gap: 20px;
}
.flex {
--justifyContent: space-between;
display: block;
justify-content: var(--justifyContent);
}
.flex-around {
--justifyContent: space-around;
}
@media only screen and (min-width: 500px) {
:root {
--baseFontSize: 112.5%;
}
.grid {
display: grid;
}
.flex {
display: flex;
}
}
.fake-logo {
font-size: var(--baseFontSize);
margin: 0;
}
.card {
padding: 2em;
background: var(--cardBg);
box-shadow: var(--level-3);
border-radius: var(--borderRadius);
}
/* First item will never have margin top */
.card > *:first-child {
margin-top: 0;
}
/* Last item will never have margin bottom */
.card > *:last-child {
margin-bottom: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment