1
0
mirror of https://github.com/thangisme/notes.git synced 2024-11-17 14:05:53 -05:00
notes/docs/customization.md

76 lines
2.1 KiB
Markdown
Raw Normal View History

2017-03-09 13:16:08 -05:00
---
layout: default
title: Customization
2018-11-16 11:47:14 -05:00
nav_order: 6
2017-03-09 13:16:08 -05:00
---
2017-03-26 21:09:19 -04:00
# Customization
2019-01-14 14:18:09 -05:00
{: .no_toc }
2017-03-26 21:09:19 -04:00
## Table of contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
2018-11-18 11:07:45 -05:00
## Color schemes
{: .d-inline-block }
2018-11-18 11:07:45 -05:00
New
{: .label .label-green }
2018-11-18 11:07:45 -05:00
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 }
2018-11-18 11:07:45 -05:00
2019-01-15 20:43:19 -05:00
```yaml
2018-11-18 11:07:45 -05:00
# 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 type="text/javascript" src="{{ "/assets/js/dark-mode-preview.js" | absolute_url }}"></script>
2018-11-18 11:07:45 -05:00
## Specific visual customization
2017-03-26 21:09:19 -04:00
2019-01-14 14:32:41 -05:00
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 its line and change its value.
2017-03-26 21:09:19 -04:00
2019-01-14 14:32:41 -05:00
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, and change its value to our `$blue-000` variable, or another shade of your choosing.
2018-11-18 11:07:45 -05:00
#### Example
{: .no_toc }
2017-03-26 21:09:19 -04:00
```scss
// ...
//
// $body-text-color: $grey-dk-100;
// $body-heading-color: $grey-dk-300;
$link-color: $blue-000;
//
// ...
```
2019-01-15 20:43:19 -05:00
_Note:_ Editing the variables directly in `_sass/support/variables.scss` is not recommended and can cause other dependencies to fail.
2017-03-26 21:09:19 -04:00
2019-09-04 09:04:10 -04:00
## Override styles
2019-09-10 11:36:48 -04:00
For styles that aren't defined as a variables, you may want to modify specific CSS classes. To add your own CSS overrides at the end of the cascade, edit `_sass/overrides.scss`. This will allow for all overrides to be kept in a single file, and for any upstream changes to still be applied.
2019-09-04 09:04:10 -04:00
For example, if you'd like to add your own styles for printing a page, you could add the following styles.
#### Example
{: .no_toc }
```scss
// Print-only styles.
@media print {
.side-bar, .page-header { display: none; }
.main-content { max-width: auto; margin: 1em;}
}
```