Skip to content

Instantly share code, notes, and snippets.

@mayinx
Last active July 9, 2021 10:30
Show Gist options
  • Save mayinx/619bba622dbe84cec99866bf9bc2b74c to your computer and use it in GitHub Desktop.
Save mayinx/619bba622dbe84cec99866bf9bc2b74c to your computer and use it in GitHub Desktop.
webprojects-utilities
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
font-size: 16px;
font-family: "News Cycle";
/* to prvgent scrolling of the body - we just want scrolling in the main container */
height: 100%;
overflow: hidden;
color: var(--page-font-color);
}
:root {
--primary-color: #56c6c6;
--secondary-color: #79d2d2;
--tertiary-color: #14b8b8;
--quaternary-color: #00bcd4;
--quinary-color: hsla(200, 0%, 0%, 0.7);
--senary-color: #e5eaf5;
/* quaternary, quinary, senary, septenary, octonary, nonary */
--header-height-mobile: 75px;
--page-bg-color: var(--senary-color);
--page-font-color: var(--quinary-color);
--hover-font-color: #eee;
/* HEADER */
--header-bg-color: var(--primary-color);
--header-font-color: var(--page-font-color);
--header-border-bottom-color: var(--secondary-color);
/* FOOTER*/
--footer-bg-color: var(--primary-color);
--footer-font-color: var(--page-font-color);
--footer-nav-item-link-color: var(--page-font-color);
--footer-nav-item-hover-bg-color: var(--secondary-color);
--footer-nav-item-hover-border-color: var(--tertiary-color);
--footer-nav-item-hover-font-color: var(--hover-font-color);
--form-inputs-bg-color: #f5f5f5;
--form-inputs-color: var(--page-font-color);
--form-inputs-border-color: #e7e7e7;
--form-inputs-focus-bg-color: #f0f0f0;
--form-inputs-focus-border-color: #00bcd4;
/* question cards */
--card-bg-color: #fff;
--question-card-answer-bg-color: var(--form-inputs-bg-color);
--question-card-bookmark-icon-color: var(--page-font-color);
--question-card-bookmarked-bookmark-icon-color: var(--secondary-color);
--question-card-bookmark-icon-bg-color: var(--card-bg-color);
--question-card-bookmark-icon-hover-color: var(--secondary-color);
--question-card-toggle-answer-btn-hover-font-color: var(--secondary-color);
/* --question-card-toggle-answer-btn-hover-bg-color: var(--secondary-color); */
--question-card-toggle-answer-btn-hover-border-color: var(--tertiary-color);
--question-card-answer-overlay-bg-color: #e7e7e7;
}
[data-theme="dark"] {
--primary-color: #3f3f3f;
--secondary-color: #999999;
--tertiary-color: #cccccc;
--quinary-color: #fff;
--senary-color: #e5eaf5;
/* question cards */
--card-bg-color: #3f3f3f;
/* form */
--form-inputs-bg-color: var(--tertiary-color);
--form-inputs-focus-bg-color: var(--secondary-color);
}
p {
padding: 1em;
}
.btn {
padding: 14px 28px;
font-size: 1rem;
cursor: pointer;
border: none;
color: white;
text-decoration: none; /* in case we use anchor tag instead of button tag */
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
display: inline-block;
text-align: center;
align-items: flex-start;
}
.green {
background-color: #04aa6d;
} /* Green */
.green:hover {
background-color: #46a049;
}
.blue {
background-color: #2196f3;
} /* Blue */
.blue:hover {
background: #0b7dda;
}
.orange {
background-color: #ff9800;
} /* Orange */
.orange:hover {
background: #e68a00;
}
.red {
background-color: #f44336;
} /* Red */
.red:hover {
background: #da190b;
}
.gray {
background-color: #e7e7e7;
color: black;
}
.gray:hover {
background: #ddd;
}
.black {
background-color: #5f5c5c;
color: white;
}
.black:hover {
background: #000;
}
.btn.rounded {
border-radius: 6px;
}
.btn.outlined {
border: 2px solid black;
background-color: white;
color: black;
}
/* Green */
.btn.outlined.green {
border-color: #04aa6d;
color: green;
}
.btn.outlined.green:hover {
background-color: #04aa6d;
color: white;
}
/* Blue */
.btn.outlined.blue {
border-color: #2196f3;
color: dodgerblue;
}
.btn.outlined.blue:hover {
background: #2196f3;
color: white;
}
/* Orange */
.btn.outlined.orange {
border-color: #ff9800;
color: orange;
}
.btn.outlined.orange:hover {
background: #ff9800;
color: white;
}
/* Red */
.btn.outlined.red {
border-color: #f44336;
color: red;
}
.btn.outlined.red:hover {
background: #f44336;
color: white;
}
/* Gray */
.btn.outlined.gray {
border-color: #e7e7e7;
color: black;
}
.btn.outlined.gray:hover {
background: #e7e7e7;
}
@media all and (min-width: 400px) {
}
@media all and (min-width: 600px) {
main section.card {
width: 80vw;
}
main section.card {
margin: 2rem;
padding: 2.5rem;
}
main section.card.question {
margin: 2rem;
padding: 2.5rem;
}
/* main section.card .bookmark-icon {
position: absolute;
top: -20px;
right: 30px;
} */
footer nav ul li a i {
margin-right: 0.5rem;
}
footer nav ul li a span {
display: inline-block;
}
body.profile .about-me {
width: 80%;
font-size: 1.3rem;
}
body.profile .tag-list {
width: 50%;
}
}
@media all and (min-width: 800px) {
header {
justify-content: space-between;
}
header .user-score {
display: block;
}
/* main section.card .bookmark-icon {
position: absolute;
top: -20px;
right: 30px;
font-size: 2.5rem;
} */
}
@media all and (min-width: 900px) {
header .game-area {
display: block;
}
body.create main form {
width: 80%;
}
}
.tag {
align-items: center;
background-color: #f5f5f5;
border-radius: 0.375em;
color: #4a4a4a;
display: inline-flex;
font-size: 0.75rem;
height: 2em;
justify-content: center;
line-height: 1.5;
padding-left: 0.75em;
padding-right: 0.75em;
white-space: nowrap;
font-size: 1rem;
}
.tag.blue {
background-color: #3e8ed0;
color: #fff;
}
.tag.dark-blue {
background-color: #485fc7;
color: #fff;
}
.tag.green {
background-color: #00d1b2;
color: #fff;
}
.tag.red {
background-color: #f14668;
color: #fff;
}
.tag.yellow {
background-color: #d1d100;
color: #fff;
}
.tag.medium {
font-size: 1.25rem;
}
.tag.large {
font-size: 1.75rem;
}
.tag.xl {
font-size: 2rem;
}
.tag.wow {
font-size: 3rem;
}
.tag-list {
display: flex;
flex-direction: row;
flex-wrap: wrap;
text-align: center;
}
.tag-list .tag {
margin: 2%;
}
/* 1. FONT BOLD 16 PX */
/* used in header h1 */
.font-bold-16-dark {
font-weight: 700; /* == bold */
font-size: 1rem; /* 1rem == 16px as per page font size */
letter-spacing: 1px;
color: var(--color-dark-blue);
}
/* 2. FONT SEMIBOLD 16 PX (DARKBLLUE) */
/* used in ... */
.font-sb-16-medium {
font-weight: 600;
font-size: 1rem; /* 1rem == 16px as per page font size */
/* color: var(--main-font-color); */
color: var(--color-medium-blue);
letter-spacing: 0.5px;
}
/* 3. FONT SEMIBOLD 16 PX (LIGHTBLLUE) */
/* used in simple list component */
.font-sb-16-light {
/* INFO: normally a font-weight of '600' woulb be semi-bold - but that doesn't look right - so we use '500' to achieve that desired semi-bold look specified in the artboard - plus: Roboto doesn't really specify a font-weight pf 600 according to google fonts */
font-weight: 500;
font-size: 1rem; /* 1rem == 16px as per page font size */
/* color: var(--main-font-color); */
color: var(--color-medium-blue);
letter-spacing: 0.5px;
}
/* FONT-SEMIBOLD-14PX */
.font-sb-14 {
font-weight: 600;
font-size: 0.875rem; /* == 14px as per page base font size of 16px == 1rem */
color: var(--color-dark-blue);
letter-spacing: 1px;
}
/* FONT-REGULAR-14PX */
.font-reg-12 {
font-weight: 400; /* 400 == normal / regular */
font-size: 0.75rem; /* 12px as per page font size of 16px */
color: var(--color-medium-blue);
letter-spacing: 1px;
}
.font-upper {
text-transform: uppercase;
}
.ta-left {
text-align: left;
}
.ta-right {
text-align: right;
}
.ta-center {
text-align: center;
}
/* utils for height */
/* usd for sizing (small / big) */
.height-50 {
height: 50px;
}
.height-75 {
height: 75px;
}
/* utils for margins */
.mb-0_25 {
margin-bottom: 0.25rem;
}
.mb-0_5 {
margin-bottom: 0.5rem;
}
.mb-1 {
margin-bottom: 1rem;
}
.mb-1_5 {
margin-bottom: 1.5rem;
}
.mb-2 {
margin-bottom: 2rem;
}
/* useful to left align an element*/
.mr-auto {
margin-right: auto;
}
/* useful to right align an element*/
.ml-auto {
margin-left: auto;
}
.mr-1 {
margin-right: 1rem;
}
.p-1 {
padding: 1rem;
}
.ptb-0_5 {
padding: 0.5rem 0;
}
.ptb-1 {
padding: 1rem 0;
}
.w-100 {
width: 100%;
}
/* UTILS FOR FLEX */
.d-flex {
display: flex;
}
.d-flex-column {
display: flex;
flex-direction: column;
}
.d-flex-row {
display: flex;
flex-direction: row;
}
.flex-nowrap {
flex-wrap: nowrap;
}
.justify-content-start {
justify-content: flex-start;
}
.justify-content-end {
justify-content: flex-end;
}
.justify-content-between {
justify-content: space-between;
}
.justify-content-around {
justify-content: space-around;
}
.justify-content-evenly {
justify-content: space-evenly;
}
.align-items-center {
align-items: center;
}
.align-items-start {
align-items: flex-start;
}
.align-items-end {
align-items: flex-end;
}
.align-self-start {
align-self: flex-start;
}
.align-self-end {
align-self: flex-end;
}
.flex-auto {
flex: auto;
}
/* grid related utils */
.d-grid {
display: grid;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment