Clean up colors and docs

This commit is contained in:
Patrick Marsceill 2018-11-18 11:07:45 -05:00
parent b52f66a2ee
commit f0bb38e1b8
No known key found for this signature in database
GPG Key ID: 286B93882D828F40
12 changed files with 106 additions and 25 deletions

View File

@ -7,6 +7,11 @@
box-sizing: border-box; box-sizing: border-box;
} }
::selection {
color: $white;
background: $link-color;
}
html { html {
@include fs-4; @include fs-4;
} }

View File

@ -15,11 +15,11 @@
font-size: inherit; font-size: inherit;
font-weight: 500; font-weight: 500;
line-height: 1.5; line-height: 1.5;
color: $purple-200; color: $link-color;
text-decoration: none; text-decoration: none;
vertical-align: baseline; vertical-align: baseline;
cursor: pointer; cursor: pointer;
background-color: #f7f7f7; background-color: $base-button-color;
border-width: 0; border-width: 0;
border-radius: 3px; border-radius: 3px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08);
@ -38,7 +38,7 @@
&:hover, &:hover,
&.zeroclipboard-is-hover { &.zeroclipboard-is-hover {
color: $purple-300; color: darken($link-color, 2%);
} }
&:hover, &:hover,
@ -46,13 +46,13 @@
&.zeroclipboard-is-hover, &.zeroclipboard-is-hover,
&.zeroclipboard-is-active { &.zeroclipboard-is-active {
text-decoration: none; text-decoration: none;
background-color: #f4f4f4; background-color: darken($base-button-color, 1%);
} }
&:active, &:active,
&.selected, &.selected,
&.zeroclipboard-is-active { &.zeroclipboard-is-active {
background-color: #ededed; background-color: darken($base-button-color, 3%);
background-image: none; background-image: none;
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
} }
@ -83,7 +83,7 @@
&:active, &:active,
&.zeroclipboard-is-hover, &.zeroclipboard-is-hover,
&.zeroclipboard-is-active { &.zeroclipboard-is-active {
color: $grey-dk-100; color: darken($link-color, 4%);
text-decoration: none; text-decoration: none;
background-color: transparent; background-color: transparent;
box-shadow: inset 0 0 0 3px $grey-lt-300; box-shadow: inset 0 0 0 3px $grey-lt-300;

View File

@ -7,7 +7,8 @@ $body-text-color: $grey-lt-300;
$body-heading-color: $grey-lt-000; $body-heading-color: $grey-lt-000;
$nav-child-link-color: $grey-dk-000; $nav-child-link-color: $grey-dk-000;
$link-color: lighten($purple-000, 8%); $link-color: $blue-000;
$btn-primary-color: $purple-200; $btn-primary-color: $blue-200;
$base-button-color: $grey-dk-250;
$code-background-color: $grey-dk-250; $code-background-color: $grey-dk-250;

View File

@ -17,6 +17,7 @@
// $grey-dk-000: #959396; // $grey-dk-000: #959396;
// $grey-dk-100: #5c5962; // $grey-dk-100: #5c5962;
// $grey-dk-200: #44434d; // $grey-dk-200: #44434d;
// $grey-dk-250: #302d36 !default;
// $grey-dk-300: #27262b; // $grey-dk-300: #27262b;
// //
// $grey-lt-000: #f5f6fa; // $grey-lt-000: #f5f6fa;
@ -39,9 +40,16 @@
// $green-200: #009c7b; // $green-200: #009c7b;
// $green-300: #026e57; // $green-300: #026e57;
// //
// $body-text-color: $grey-dk-100; // $body-background-color: $white !default;
// $body-heading-color: $grey-dk-300; // $sidebar-color: $grey-lt-000 !default;
// $link-color: $purple-000; // $code-background-color: $grey-lt-000 !default;
// $body-text-color: $grey-dk-100 !default;
// $body-heading-color: $grey-dk-300 !default;
// $nav-child-link-color: $grey-dk-100 !default;
// $link-color: $purple-000 !default;
// $btn-primary-color: $purple-100 !default;
// $base-button-color: #f7f7f7 !default;
// //
// // // //
// // Media queries in pixels // // Media queries in pixels

View File

@ -45,7 +45,7 @@
position: absolute; position: absolute;
margin-top: 0.3em; margin-top: 0.3em;
margin-left: -0.8em; margin-left: -0.8em;
color: $border-color; color: rgba($body-text-color, 0.3);
content: "- "; content: "- ";
} }

View File

@ -39,7 +39,7 @@
display: block; display: block;
width: 300px; width: 300px;
margin-top: $gutter-spacing; margin-top: $gutter-spacing;
background: $white; background: lighten($body-background-color, 1%);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 14px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 14px rgba(0, 0, 0, 0.05);
} }
} }
@ -65,7 +65,7 @@
box-shadow: none; box-shadow: none;
+ .search-icon { + .search-icon {
fill: $purple-000; fill: $link-color;
} }
} }
@ -108,6 +108,7 @@
padding-left: $sp-3; padding-left: $sp-3;
&:hover { &:hover {
background-color: $grey-lt-000; color: $body-heading-color;
background-color: darken($body-background-color, 2%);
} }
} }

View File

@ -59,6 +59,7 @@ $body-heading-color: $grey-dk-300 !default;
$nav-child-link-color: $grey-dk-100 !default; $nav-child-link-color: $grey-dk-100 !default;
$link-color: $purple-000 !default; $link-color: $purple-000 !default;
$btn-primary-color: $purple-100 !default; $btn-primary-color: $purple-100 !default;
$base-button-color: #f7f7f7 !default;
// //
// Media queries in pixels // Media queries in pixels

View File

@ -25,7 +25,7 @@ td {
padding-right: $sp-3; padding-right: $sp-3;
padding-bottom: $sp-2; padding-bottom: $sp-2;
padding-left: $sp-3; padding-left: $sp-3;
background-color: lighten($body-background-color, 1%); background-color: lighten($body-background-color, 2%);
border-bottom: $border rgba($border-color, 0.5); border-bottom: $border rgba($border-color, 0.5);
border-left: $border $border-color; border-left: $border $border-color;

View File

@ -16,6 +16,10 @@
color: $grey-dk-200 !important; color: $grey-dk-200 !important;
} }
.text-grey-dk-250 {
color: $grey-dk-250 !important;
}
.text-grey-dk-300 { .text-grey-dk-300 {
color: $grey-dk-300 !important; color: $grey-dk-300 !important;
} }
@ -130,6 +134,10 @@
background-color: $grey-dk-200 !important; background-color: $grey-dk-200 !important;
} }
.bg-grey-dk-250 {
background-color: $grey-dk-250 !important;
}
.bg-grey-dk-300 { .bg-grey-dk-300 {
background-color: $grey-dk-300 !important; background-color: $grey-dk-300 !important;
} }

View File

@ -23,3 +23,28 @@ aux_links:
"Just the Docs on GitHub": "Just the Docs on GitHub":
- "//github.com/pmarsceill/just-the-docs" - "//github.com/pmarsceill/just-the-docs"
``` ```
## Color scheme
```yml
# Color scheme currently only supports "dark" or nil (default)
color_scheme: "dark"
```
<button class="btn js-toggle-dark-mode">Preview dark color scheme</button>
<script>
const toggleDarkMode = document.querySelector('.js-toggle-dark-mode')
const cssFile = document.querySelector('[rel="stylesheet"]')
const originalCssRef = cssFile.getAttribute('href')
const darkModeCssRef = originalCssRef.replace('just-the-docs.css', 'dark-mode-preview.css')
addEvent(toggleDarkMode, 'click', function(){
if (cssFile.getAttribute('href') === originalCssRef) {
cssFile.setAttribute('href', darkModeCssRef)
} else {
cssFile.setAttribute('href', originalCssRef)
}
})
</script>
See [Customization]({{site.baseurl }}{% link docs/customization.md %}) for more information.

View File

@ -15,11 +15,49 @@ nav_order: 6
--- ---
## Visual customization ## Color schemes
{: .d-inline-block :}
New
{: .label .label-green :}
Just the Docs supports two color schemes: light (default), and dark.
To enable a color scheme, set the `color_scheme` parameter in your site's `_config.yml` file:
#### Example
{: no_toc }
```yml
# Color scheme currently only supports "dark" or nil (default)
color_scheme: "dark"
```
<button class="btn js-toggle-dark-mode">Preview dark color scheme</button>
<script>
const toggleDarkMode = document.querySelector('.js-toggle-dark-mode')
const cssFile = document.querySelector('[rel="stylesheet"]')
const originalCssRef = cssFile.getAttribute('href')
const darkModeCssRef = originalCssRef.replace('just-the-docs.css', 'dark-mode-preview.css')
addEvent(toggleDarkMode, 'click', function(){
if (cssFile.getAttribute('href') === originalCssRef) {
cssFile.setAttribute('href', darkModeCssRef)
} else {
cssFile.setAttribute('href', originalCssRef)
}
})
</script>
## Specific visual customization
To customize your sites aesthetic, open `_sass/custom/custom.scss` in your editor to see if there is a variable that you can override. Most styles like fonts, colors, spacing, etc.. are derived from these variables. To override a specific variable, uncomment out its line and change its value. To customize your sites aesthetic, open `_sass/custom/custom.scss` in your editor to see if there is a variable that you can override. Most styles like fonts, colors, spacing, etc.. are derived from these variables. To override a specific variable, uncomment out its line and change its value.
For example, to change the link color from the purple default to blue, open `_sass/custom/custom.css` and find the link color variable on line `44`. Uncomment it out, and change it's value to our `$blue-000` variable, or another shade of your choosing. For example, to change the link color from the purple default to blue, open `_sass/custom/custom.css` and find the `$link-color` variable on line `50`. Uncomment it out, and change it's value to our `$blue-000` variable, or another shade of your choosing.
#### Example
{: no_toc }
```scss ```scss
// ... // ...
@ -35,10 +73,3 @@ _Note:_ Editing the variables directly in `_sass/support/variables.scss` is not
--- ---
## Themes
{: .d-inline-block :}
Coming soon
{: .label .label-yellow :}
Hard at work on a dark theme, and more.

View File

@ -34,6 +34,7 @@ All the colors used in Just the Docs have been systemsized into a series of vari
| <span class="d-inline-block p-2 mr-1 v-align-middle bg-grey-dk-000"></span> `grey-dk-000` | `.text-grey-dk-000` | `.bg-grey-dk-000` | | <span class="d-inline-block p-2 mr-1 v-align-middle bg-grey-dk-000"></span> `grey-dk-000` | `.text-grey-dk-000` | `.bg-grey-dk-000` |
| <span class="d-inline-block p-2 mr-1 v-align-middle bg-grey-dk-100"></span> `grey-dk-100` | `.text-grey-dk-100` | `.bg-grey-dk-100` | | <span class="d-inline-block p-2 mr-1 v-align-middle bg-grey-dk-100"></span> `grey-dk-100` | `.text-grey-dk-100` | `.bg-grey-dk-100` |
| <span class="d-inline-block p-2 mr-1 v-align-middle bg-grey-dk-200"></span> `grey-dk-200` | `.text-grey-dk-200` | `.bg-grey-dk-200` | | <span class="d-inline-block p-2 mr-1 v-align-middle bg-grey-dk-200"></span> `grey-dk-200` | `.text-grey-dk-200` | `.bg-grey-dk-200` |
| <span class="d-inline-block p-2 mr-1 v-align-middle bg-grey-dk-250"></span> `grey-dk-250` | `.text-grey-dk-250` | `.bg-grey-dk-250` |
| <span class="d-inline-block p-2 mr-1 v-align-middle bg-grey-dk-300"></span> `grey-dk-300` | `.text-grey-dk-300` | `.bg-grey-dk-300` | | <span class="d-inline-block p-2 mr-1 v-align-middle bg-grey-dk-300"></span> `grey-dk-300` | `.text-grey-dk-300` | `.bg-grey-dk-300` |
## Purples ## Purples