Implement dark mode

This commit is contained in:
Eduardo 2019-10-05 22:45:34 +02:00
parent 747302604a
commit c73678c4f0
10 changed files with 25 additions and 26 deletions

View file

@ -38,7 +38,9 @@ into the {body} of the default.hbs template --}}
</div> </div>
<div class="m-article-card__info"> <div class="m-article-card__info">
<a href="{{url}}" class="m-article-card__info-link"> <a href="{{url}}" class="m-article-card__info-link">
{{#if bio}}
<p class="m-article-card__excerpt">{{bio}}</p> <p class="m-article-card__excerpt">{{bio}}</p>
{{/if}}
</a> </a>
<div class="m-article-card__author-stats"> <div class="m-article-card__author-stats">
<span> <span>

View file

@ -49,7 +49,7 @@ into the {body} of the default.hbs template --}}
<button class="m-icon-button filled in-share progress js-scrolltop" aria-label="Scroll to top"> <button class="m-icon-button filled in-share progress js-scrolltop" aria-label="Scroll to top">
<span class="icon-arrow-top"></span> <span class="icon-arrow-top"></span>
<svg> <svg>
<circle class="progress-ring__circle js-progress" stroke="#04aeee" fill="transparent" r="0" /> <circle class="progress-ring__circle js-progress" fill="transparent" r="0" />
</svg> </svg>
</button> </button>
</div> </div>

View file

@ -2,8 +2,8 @@
@import "common/reset"; @import "common/reset";
@import "common/mixins"; @import "common/mixins";
@import "common/colors";
@import "common/variables"; @import "common/variables";
@import "common/themes";
@import "common/helpers"; @import "common/helpers";
@import "common/global"; @import "common/global";
@import "common/icons"; @import "common/icons";

View file

@ -8,9 +8,13 @@
--link-color: #293951; --link-color: #293951;
--primary-border-color: #9b9b9b; --primary-border-color: #9b9b9b;
--secondary-border-color: aliceblue; --secondary-border-color: aliceblue;
--article-shadow: 0 4px 60px 0 rgba(0,0,0,.2); --article-shadow-normal: 0 10px 10px rgba(0,0,0,0.08);
--article-shadow-hover: 0 4px 60px 0 rgba(0,0,0,0.2);
--transparent-background-color: rgba(255,255,255,0.99); --transparent-background-color: rgba(255,255,255,0.99);
--foter-background-color: #293951; --foter-background-color: #293951;
--submenu-shadow-color-opacity: 0.25;
--button-shadow-color-normal: rgba(108, 108, 108, 0.2);
--button-shadow-color-hover: rgba(108, 108, 108, 0.3);
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
@ -24,8 +28,12 @@
--link-color: #2c2fe6; --link-color: #2c2fe6;
--primary-border-color: #1d1d1d; --primary-border-color: #1d1d1d;
--secondary-border-color: #0f0f0f; --secondary-border-color: #0f0f0f;
--article-shadow: 0 4px 0px 10px rgba(0,0,0,.2); --article-shadow-normal: 0 4px 5px 5px rgba(0,0,0,0.1);
--article-shadow-hover: 0 4px 5px 10px rgba(0,0,0,0.1);
--transparent-background-color: rgba(0,0,0,0.99); --transparent-background-color: rgba(0,0,0,0.99);
--foter-background-color: #080808; --foter-background-color: #080808;
--submenu-shadow-color-opacity: 0.55;
--button-shadow-color-normal: rgba(10, 10, 10, 0.5);
--button-shadow-color-hover: rgba(10, 10, 10, 0.5);
} }
} }

View file

@ -2,11 +2,7 @@
$white: #fff; $white: #fff;
$black: #000; $black: #000;
$main-color: #04aeee;
$titles: #333; $titles: #333;
$body: #4a4a4a;
$light-blue: #f4f8fd;
$dark-blue: #293951;
$gray: #9b9b9b; $gray: #9b9b9b;
/** Config */ /** Config */

View file

@ -14,7 +14,7 @@
@include transform(translateY(-5px)); @include transform(translateY(-5px));
&:before { &:before {
@include bs(var(--article-shadow)); @include bs(var(--article-shadow-hover));
} }
.m-article-card__author { .m-article-card__author {
@ -85,7 +85,7 @@
bottom: 0; bottom: 0;
left: 10px; left: 10px;
border-radius: 10px; border-radius: 10px;
@include bs(0 10px 10px rgba(0,0,0,0.08)); @include bs(var(--article-shadow-normal));
@include transition(all .25s cubic-bezier(.02,.01,.47,1)); @include transition(all .25s cubic-bezier(.02,.01,.47,1));
} }
} }
@ -261,15 +261,6 @@
letter-spacing: 0.3px; letter-spacing: 0.3px;
line-height: 1.5; line-height: 1.5;
font-size: 1rem; font-size: 1rem;
&:after {
content: '';
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 20px;
background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 );
}
} }
.m-article-card__timestamp, .m-article-card__timestamp,

View file

@ -11,7 +11,7 @@
} }
&:before { &:before {
@include bs(0 4px 60px 0 rgba(0,0,0,.2)); @include bs(var(--article-shadow-hover));
} }
} }
@ -36,7 +36,7 @@
bottom: 0; bottom: 0;
left: 10px; left: 10px;
border-radius: 10px; border-radius: 10px;
@include bs(0 10px 10px rgba(0,0,0,0.08)); @include bs(var(--article-shadow-normal));
@include transition(all .25s cubic-bezier(.02,.01,.47,1)); @include transition(all .25s cubic-bezier(.02,.01,.47,1));
} }
} }

View file

@ -11,7 +11,7 @@
background-color: var(--background-color); background-color: var(--background-color);
border-top: 1px solid var(--secondary-border-color); border-top: 1px solid var(--secondary-border-color);
z-index: 5; z-index: 5;
@include bs(0 60px 60px rgba(0,0,0,0.25)); @include bs(0 60px 60px rgba(0,0,0,var(--submenu-shadow-color-opacity)));
} }
@include respond-to('extra-large') { @include respond-to('extra-large') {

View file

@ -16,16 +16,17 @@
@include transition(all .25s cubic-bezier(.02,.01,.47,1)); @include transition(all .25s cubic-bezier(.02,.01,.47,1));
&.outlined { &.outlined {
color: var(--titles-color);
border: 1px solid var(--primary-foreground-color); border: 1px solid var(--primary-foreground-color);
} }
&.filled, &.filled,
&.primary { &.primary {
@include bs(0 2px 4px rgba(108, 108, 108, 0.2)); @include bs(0 2px 4px var(--button-shadow-color-normal));
&:hover { &:hover {
@include transform(translateY(-2px)); @include transform(translateY(-2px));
@include bs(0 4px 8px rgba(108, 108, 108, 0.3)); @include bs(0 4px 8px var(--button-shadow-color-hover));
} }
} }

View file

@ -17,11 +17,11 @@
&.filled { &.filled {
background-color: var(--background-color); background-color: var(--background-color);
border-radius: 50%; border-radius: 50%;
@include bs(0 2px 4px rgba(108, 108, 108, 0.2)); @include bs(0 2px 4px var(--button-shadow-color-normal));
@include transition(all .25s cubic-bezier(.02,.01,.47,1)); @include transition(all .25s cubic-bezier(.02,.01,.47,1));
&:hover { &:hover {
@include bs(0 4px 8px rgba(108, 108, 108, 0.3)); @include bs(0 4px 8px var(--button-shadow-color-hover));
} }
} }
@ -207,6 +207,7 @@
opacity: 0; opacity: 0;
circle { circle {
stroke: var(--primary-subtle-color);
transform-origin: 50% 50%; transform-origin: 50% 50%;
@include transform(rotate(-90deg)); @include transform(rotate(-90deg));
@include transition(stroke-dashoffset 0.2s); @include transition(stroke-dashoffset 0.2s);