Rewrite styles to scss and use i respective components

This commit is contained in:
Max Karkowski
2020-07-17 08:44:02 +02:00
committed by Bastian
parent be0241674c
commit 73865eb209
94 changed files with 969 additions and 974 deletions

42
src/styles/base.scss Normal file
View File

@@ -0,0 +1,42 @@
:root {
--color-gray-dark: #475157;
--color-gray-dark-alt: #4F585E;
--color-gray-dark-alt2: #434D53;
--color-gray-normal: #7f858a;
--color-gray-light: #7D878D;
--color-white: #fff;
--color-green: #5CB449;
--color-orange: #FAA03D;
--color-blue: #40A7D1;
--color-marine: #688190;
--color-red: #F1235A;
--color-brand: #F59134;
}
@custom-media --until-sm (max-width: 30em);
@custom-media --until-md (max-width: 48em);
@custom-media --until-lg (max-width: 61.875em);
@custom-media --until-xl (max-width: 75em);
body {
background: var(--color-gray-dark);
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: 'DIN';
font-weight: normal;
font-size: 14px;
line-height: 1.5;
& h1 {
color: blue;
}
}
#root {
min-height: 100vh;
overflow: hidden;
}

View File

@@ -0,0 +1,17 @@
.button {
border: none;
background: transparent;
position: relative;
padding: 10px 10px 10px 35px;
margin: 0;
font-size: 16px;
line-height: 16px;
color: var(--color-gray-normal);
&__icon {
position: absolute;
left: 5px;
top: 50%;
margin-top: -11px;
}
}

View File

@@ -0,0 +1,15 @@
.fullpage-content {
font-size: 16px;
color: var(--color-white);
& p,
& ul {
font-weight: lighter
}
& a {
color: var(--color-white);
}
}

View File

@@ -0,0 +1,8 @@
.filter {
margin-bottom: 40px;
/* @todo: re-enable filter for mobile */
@media (--until-sm) {
display: none;
}
}

View File

@@ -0,0 +1,4 @@
.footnote {
font-size: 12px;
color: var(--color-gray-normal);
}

View File

@@ -0,0 +1,11 @@
.headline {
margin: 0;
padding: 0;
color: var(--color-white);
font-size: 20px;
font-weight: normal;
&--dark {
color: var(--color-gray-light);
}
}

View File

@@ -0,0 +1,2 @@
/* copied from here: http://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/styles/darcula.min.css*/
.hljs{display:block;overflow-x:auto;padding:0.5em;background:#2b2b2b}.hljs{color:#bababa}.hljs-strong,.hljs-emphasis{color:#a8a8a2}.hljs-bullet,.hljs-quote,.hljs-link,.hljs-number,.hljs-regexp,.hljs-literal{color:#6896ba}.hljs-code,.hljs-selector-class{color:#a6e22e}.hljs-emphasis{font-style:italic}.hljs-keyword,.hljs-selector-tag,.hljs-section,.hljs-attribute,.hljs-name,.hljs-variable{color:#cb7832}.hljs-params{color:#b9b9b9}.hljs-string{color:#6a8759}.hljs-subst,.hljs-type,.hljs-built_in,.hljs-builtin-name,.hljs-symbol,.hljs-selector-id,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-template-tag,.hljs-template-variable,.hljs-addition{color:#e0c46c}.hljs-comment,.hljs-deletion,.hljs-meta{color:#7f7f7f}

View File

@@ -0,0 +1,36 @@
.icon-link {
display: inline-block;
position: relative;
text-decoration: none;
height: 25px;
font-size: 14px;
line-height: 25px;
border: 0;
background: none;
color: var(--color-gray-normal);
&--primary {
color: var(--color-brand);
}
&--big {
font-size: 16px;
}
&__icon {
margin-right: 6px;
position: relative;
top: -1px;
}
&:hover {
&:after {
content: '';
position: absolute;
left: 0;
bottom: -8px;
width: 100%;
border-bottom: 2px solid var(--color-gray-normal);
}
}
}

View File

@@ -0,0 +1,33 @@
.icon {
display: inline-block;
width: 22px;
height: 22px;
background-size: 22px 22px;
background-repeat: no-repeat;
background-position: 0 0;
vertical-align: middle;
&--pie {
background-image: url('../../icons/pie.svg');
}
&--question {
background-image: url('../../icons/question.svg');
}
&--overview {
background-image: url('../../icons/overview.svg');
}
&--search {
background-image: url('../../icons/search.svg');
}
&--back {
background-image: url('../../icons/back.svg');
}
&--close {
background-image: url('../../icons/close.svg');
}
}

View File

@@ -0,0 +1,24 @@
.letter-index {
margin-bottom: 60px;
&__group {
border-top: 1px solid var(--color-gray-normal);
position: relative;
padding: 0 0 0 200px;
min-height: 80px;
@media (--until-md) {
padding: 0 0 0 50px;
}
}
&__letter {
font-size: 50px;
line-height: 80px;
color: var(--color-gray-normal);
position: absolute;
left: 50px;
top: 0;
@media (--until-md) {
left: 0;
}
}
}

View File

@@ -0,0 +1,53 @@
.markdown {
color: var(--color-gray-normal);
font-size: 16px;
p {
margin: 20px 0;
}
a {
color: var(--color-gray-normal);
text-decoration: underline;
&:hover {
color: var(--color-gray-dark);
}
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: var(--color-gray-normal);
}
h1 {
font-size: 2em;
margin: 1em 0;
font-weight: 300;
}
h2 {
font-size: 1.5em;
margin: 1em 0;
}
h3 {
font-size: 1.2em;
margin: 1em 0;
}
img {
max-width: 100%;
margin: 10 0 10 0;
}
pre {
overflow-x: auto;
padding: 10px;
background: var(--color-gray-dark);
-webkit-overflow-scrolling: touch;
}
}

View File

@@ -0,0 +1,42 @@
.nav {
white-space: nowrap;
&__item {
display: inline-flex;
position: relative;
& + .nav__item {
margin-left: 20px;
}
}
&__search {
position: absolute;
right: 0;
top: 50%;
visibility: hidden;
overflow: hidden;
width: 0;
margin-top: -25px;
opacity: 0.8;
transition:
width 400ms cubic-bezier(0.24, 1.12, 0.71, 0.98) 100ms,
visibility 0s linear 500ms,
opacity 200ms linear;
&.is-open {
opacity: 1;
width: 600px;
visibility: visible;
transition-delay: 0s;
}
}
&--relations {
@media (--until-md) {
.nav__item {
display: block;
margin: 5px 0 0;
}
}
}
}

View File

@@ -0,0 +1,35 @@
.page {
max-width: 1200px;
min-height: 100%;
margin: 0 auto;
padding: 0 15px;
display: flex;
flex-direction: column;
min-height: 100vh;
&__header {
flex: 0 0 auto;
margin-bottom: 20px;
position: relative;
z-index: 100;
@media (--until-sm) {
margin: 0
}
@media (--until-lg) {
.nav {
display: none;
}
}
}
&__content {
flex: 1 1 auto;
}
&__footer {
margin-top: 5px;
flex: 0 0 auto;
}
}

View File

@@ -0,0 +1,8 @@
.publish-date {
color: var(--color-gray-normal);
text-align: right;
@media (--until-sm) {
text-align: center;
}
}

View File

@@ -0,0 +1,10 @@
.ring-list {
&__header {
margin-bottom: 20px;
}
&__item {
font-size: 13px;
display: block;
margin-bottom: 12px;
}
}

View File

@@ -0,0 +1,29 @@
.social-icon {
font-weight: normal;
font-style: normal;
font-size: 16px; /* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
background-color: var(--color-white);
border-radius: 50%;
padding: 7px;
margin: 0 5px 0 5px;
/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
/* Support for IE. */
font-feature-settings: 'liga';
}

View File

@@ -0,0 +1,25 @@
.split {
display: flex;
align-items: center;
justify-content: space-between;
&--align-top {
align-items: flex-start;
}
&--overview {
min-height: 40px;
}
&__left {
flex: 0 1 auto;
}
&__right {
flex: 0 1 auto;
}
@media (--until-sm) {
display: block;
}
}

17
src/styles/main.scss Normal file
View File

@@ -0,0 +1,17 @@
@import "./base";
@import "./components/button";
@import "./components/content";
@import "./components/filter";
@import "./components/footnote";
@import "./components/headline";
@import "./components/hljs";
@import "./components/icon";
@import "./components/icon-link";
@import "./components/letter-index";
@import "./components/markdown";
@import "./components/nav";
@import "./components/page";
@import "./components/publish-date";
@import "./components/ring-list";
@import "./components/social-icon";
@import "./components/split";