Skip to content

Commit

Permalink
Add light styling
Browse files Browse the repository at this point in the history
  • Loading branch information
b2a3e8 committed Mar 26, 2019
1 parent 0e9a480 commit 5275668
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 12 deletions.
2 changes: 1 addition & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>{{ site.title }}{{ page.title }}</title>
{%- seo title=false -%}
<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
<link rel="stylesheet" href="{{ "/assets/main-dark.css" | relative_url }}">
{%- if jekyll.environment == 'production' and site.google_analytics -%}
{%- include google-analytics.html -%}
{%- endif -%}
Expand Down
18 changes: 17 additions & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@
{%- include footer.html -%}

</div>
</body>

<script>
function enableLightStyles(number) {
var cssId = 'main-light';
if (!document.getElementById(cssId))
{
var head = document.getElementsByTagName('head')[0];
var link = document.createElement('link');
link.id = cssId;
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = "{{ "/assets/main-light.css" | relative_url }}";
link.media = 'all';
head.appendChild(link);
}
}
</script>
</body>
</html>
9 changes: 0 additions & 9 deletions _sass/jekyll-theme-console.scss → _sass/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ $base-font-family: 'Source Code Pro', monospace !default;
$base-font-size: 12.5px !default;
$mobile-font-size: 12px !default;
$base-line-height: 1.5 !default;
$base-color: #DBDBDB !default;
$primary-color: #a1fc8f !default;
$text-color: $base-color !default;
$placeholder-color: $base-color !default;
$link-color: $base-color !default;
$border: dashed 1px rgba(219,219,219,0.9) !default;
$selection-background: rgba(219,219,219,0.99) !default;
$selection-text: #000 !default;
$background-color: #000 !default;
$container-width: 90% !default;
$container-max-width: 600px !default;

Expand Down
15 changes: 15 additions & 0 deletions _sass/dark.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Style variables
*/
$base-color: #DBDBDB !default;
$primary-color: #a1fc8f !default;
$text-color: $base-color !default;
$placeholder-color: $base-color !default;
$link-color: $base-color !default;
$border: dashed 1px rgba(219,219,219,0.9) !default;
$selection-background: rgba(219,219,219,0.99) !default;
$selection-text: #000 !default;
$background-color: #000 !default;


@import "base";
15 changes: 15 additions & 0 deletions _sass/light.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Style variables
*/
$base-color: #000 !default;
$primary-color: #a1fc8f !default;
$text-color: $base-color !default;
$placeholder-color: $base-color !default;
$link-color: $base-color !default;
$border: dashed 1px rgba(219,219,219,0.9) !default;
$selection-background: rgba(219,219,219,0.99) !default;
$selection-text: #000 !default;
$background-color: #DBDBDB !default;


@import "base";
2 changes: 1 addition & 1 deletion assets/main.scss → assets/main-dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Only the main Sass file needs front matter (the dashes are enough)
---

@import "jekyll-theme-console";
@import "dark";
5 changes: 5 additions & 0 deletions assets/main-light.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
# Only the main Sass file needs front matter (the dashes are enough)
---

@import "light";
13 changes: 13 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: /
layout: page
permalink: /
---

# Lorem ipsum

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.



<a href="#" onclick="enableLightStyles()">light mode</a>

0 comments on commit 5275668

Please sign in to comment.