mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Refactored palette stylesheets
This commit is contained in:
parent
24e35c9fce
commit
6f526d222a
@ -343,7 +343,7 @@ Click on a color name to change the primary color of the theme:
|
||||
</style>
|
||||
|
||||
<button data-md-color-scheme="light"><code>light</code></button>
|
||||
<button data-md-color-scheme="dark"><code>dark</code></button>
|
||||
<button data-md-color-scheme="slate"><code>slate</code></button>
|
||||
|
||||
<script>
|
||||
var buttons = document.querySelectorAll("button[data-md-color-scheme]")
|
||||
|
@ -5,8 +5,8 @@
|
||||
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.809e24aa.min.js.map",
|
||||
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.f6ebf1dc.min.js",
|
||||
"assets/javascripts/worker/search.js.map": "assets/javascripts/worker/search.f6ebf1dc.min.js.map",
|
||||
"assets/stylesheets/main.css": "assets/stylesheets/main.0e7a66a4.min.css",
|
||||
"assets/stylesheets/main.css.map": "assets/stylesheets/main.0e7a66a4.min.css.map",
|
||||
"assets/stylesheets/palette.css": "assets/stylesheets/palette.5c06cad9.min.css",
|
||||
"assets/stylesheets/palette.css.map": "assets/stylesheets/palette.5c06cad9.min.css.map"
|
||||
"assets/stylesheets/main.css": "assets/stylesheets/main.7ee248fe.min.css",
|
||||
"assets/stylesheets/main.css.map": "assets/stylesheets/main.7ee248fe.min.css.map",
|
||||
"assets/stylesheets/palette.css": "assets/stylesheets/palette.2d35e723.min.css",
|
||||
"assets/stylesheets/palette.css.map": "assets/stylesheets/palette.2d35e723.min.css.map"
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
3
material/assets/stylesheets/main.7ee248fe.min.css
vendored
Normal file
3
material/assets/stylesheets/main.7ee248fe.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
material/assets/stylesheets/main.7ee248fe.min.css.map
Normal file
1
material/assets/stylesheets/main.7ee248fe.min.css.map
Normal file
File diff suppressed because one or more lines are too long
3
material/assets/stylesheets/palette.2d35e723.min.css
vendored
Normal file
3
material/assets/stylesheets/palette.2d35e723.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
material/assets/stylesheets/palette.2d35e723.min.css.map
Normal file
1
material/assets/stylesheets/palette.2d35e723.min.css.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -41,9 +41,9 @@
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block styles %}
|
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.0e7a66a4.min.css' | url }}">
|
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.7ee248fe.min.css' | url }}">
|
||||
{% if palette.primary or palette.accent %}
|
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.5c06cad9.min.css' | url }}">
|
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.2d35e723.min.css' | url }}">
|
||||
{% endif %}
|
||||
{% if palette.primary %}
|
||||
{% import "partials/palette.html" as map %}
|
||||
|
@ -53,36 +53,18 @@
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Light mode
|
||||
// Light theme (default)
|
||||
body {
|
||||
|
||||
// Code block color shades
|
||||
// Code color shades
|
||||
--md-code-bg-color: hsla(0, 0%, 96%, 1);
|
||||
--md-code-fg-color: hsla(200, 18%, 26%, 1);
|
||||
|
||||
// Text color shades
|
||||
--md-text-color: var(--md-default-fg-color);
|
||||
--md-text-link-color: var(--md-primary-fg-color);
|
||||
}
|
||||
|
||||
// Dark mode
|
||||
body[data-md-color-scheme="dark"] {
|
||||
|
||||
// Default color shades
|
||||
--md-default-fg-color: hsla(0, 0%, 100%, 1);
|
||||
--md-default-fg-color--light: hsla(0, 0%, 100%, 0.87);
|
||||
--md-default-fg-color--lighter: hsla(0, 0%, 100%, 0.32);
|
||||
--md-default-fg-color--lightest: hsla(0, 0%, 100%, 0.12);
|
||||
--md-default-bg-color: hsla(232, 15%, 21%, 1);
|
||||
--md-default-bg-color--light: hsla(232, 15%, 21%, 0.54);
|
||||
--md-default-bg-color--lighter: hsla(232, 15%, 21%, 0.26);
|
||||
--md-default-bg-color--lightest: hsla(232, 15%, 21%, 0.07);
|
||||
|
||||
// Code block color shades
|
||||
--md-code-bg-color: hsla(232, 15%, 18%, 1);
|
||||
--md-code-fg-color: hsla(60, 30%, 96%, 1);
|
||||
|
||||
// Text color shades
|
||||
--md-text-color: var(--md-default-fg-color--light);
|
||||
--md-text-link-color: var(--md-primary-fg-color--light);
|
||||
|
||||
// Admonition shades
|
||||
--md-admonition-bg-color: var(--md-default-bg-color);
|
||||
--md-admonition-fg-color: var(--md-default-fg-color);
|
||||
}
|
||||
|
@ -67,14 +67,15 @@ $admonitions: (
|
||||
margin: 1.5625em 0;
|
||||
padding: 0 px2rem(12px);
|
||||
overflow: hidden;
|
||||
color: var(--md-admonition-fg-color);
|
||||
font-size: ms(-1);
|
||||
page-break-inside: avoid;
|
||||
background-color: var(--md-admonition-bg-color);
|
||||
border-left: px2rem(4px) solid $clr-blue-a200;
|
||||
border-radius: px2rem(2px);
|
||||
box-shadow:
|
||||
0 px2rem(4px) px2rem(10px) hsla(0, 0%, 0%, 0.1),
|
||||
0 0 px2rem(1px) hsla(0, 0%, 0%, 0.15),
|
||||
0 0 0 px2rem(1px) var(--md-default-bg-color--lighter) inset;
|
||||
0 px2rem(4px) px2rem(10px) hsla(0, 0%, 0%, 0.05),
|
||||
0 0 px2rem(1px) hsla(0, 0%, 0%, 0.1);
|
||||
|
||||
// Adjust for right-to-left languages
|
||||
[dir="rtl"] & {
|
||||
@ -170,7 +171,7 @@ $admonitions: (
|
||||
|
||||
// Define base class
|
||||
.md-typeset .#{$name} > .admonition-title {
|
||||
background-color: transparentize($tint, 0.85);
|
||||
background-color: transparentize($tint, 0.9);
|
||||
|
||||
// Icon
|
||||
&::before {
|
||||
|
@ -226,6 +226,7 @@ $md-toggle__search--checked:
|
||||
z-index: 2;
|
||||
padding: 0 px2rem(44px) 0 px2rem(72px);
|
||||
text-overflow: ellipsis;
|
||||
background-color: var(--primary-bg-color);
|
||||
|
||||
// Adjust for right-to-left languages
|
||||
[dir="rtl"] & {
|
||||
@ -442,7 +443,6 @@ $md-toggle__search--checked:
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
background-color: var(--md-default-bg-color);
|
||||
box-shadow: inset 0 px2rem(1px) 0 var(--md-default-fg-color--lightest);
|
||||
// Hack: reduce jitter
|
||||
backface-visibility: hidden;
|
||||
scroll-snap-type: y mandatory;
|
||||
@ -522,12 +522,16 @@ $md-toggle__search--checked:
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
border-top: px2rem(1px) solid var(--md-default-fg-color--lightest);
|
||||
}
|
||||
|
||||
// List item
|
||||
&__item {
|
||||
box-shadow: 0 px2rem(-1px) 0 var(--md-default-fg-color--lightest);
|
||||
|
||||
// No border for first item
|
||||
&:first-child {
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
// Link inside item
|
||||
|
@ -36,238 +36,6 @@
|
||||
|
||||
@import "config";
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Rules: primary colors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@each $name, $colors in (
|
||||
"red": $clr-red-400 $clr-red-300 $clr-red-600,
|
||||
"pink": $clr-pink-500 $clr-pink-400 $clr-pink-700,
|
||||
"purple": $clr-purple-400 $clr-purple-300 $clr-purple-600,
|
||||
"deep-purple": $clr-deep-purple-400 $clr-deep-purple-300 $clr-deep-purple-500,
|
||||
"indigo": $clr-indigo-500 $clr-indigo-400 $clr-indigo-700,
|
||||
"blue": $clr-blue-500 $clr-blue-400 $clr-blue-700,
|
||||
"light-blue": $clr-light-blue-500 $clr-light-blue-400 $clr-light-blue-700,
|
||||
"cyan": $clr-cyan-500 $clr-cyan-400 $clr-cyan-700,
|
||||
"teal": $clr-teal-500 $clr-teal-400 $clr-teal-700,
|
||||
"green": $clr-green-500 $clr-green-400 $clr-green-700,
|
||||
"light-green": $clr-light-green-500 $clr-light-green-400 $clr-light-green-700,
|
||||
"lime": $clr-lime-500 $clr-lime-400 $clr-lime-700,
|
||||
"yellow": $clr-yellow-500 $clr-yellow-400 $clr-yellow-700,
|
||||
"amber": $clr-amber-500 $clr-amber-400 $clr-amber-700,
|
||||
"orange": $clr-orange-400 $clr-orange-400 $clr-orange-600,
|
||||
"deep-orange": $clr-deep-orange-400 $clr-deep-orange-300 $clr-deep-orange-600,
|
||||
"brown": $clr-brown-500 $clr-brown-400 $clr-brown-700,
|
||||
"grey": $clr-grey-600 $clr-grey-500 $clr-grey-700,
|
||||
"blue-grey": $clr-blue-grey-600 $clr-blue-grey-500 $clr-blue-grey-700
|
||||
) {
|
||||
|
||||
// Color palette
|
||||
[data-md-color-primary="#{$name}"] {
|
||||
--md-primary-fg-color: hsla(#{hex2hsl(nth($colors, 1))}, 1);
|
||||
--md-primary-fg-color--light: hsla(#{hex2hsl(nth($colors, 2))}, 1);
|
||||
--md-primary-fg-color--dark: hsla(#{hex2hsl(nth($colors, 3))}, 1);
|
||||
|
||||
// Inverted text for lighter shades
|
||||
@if index("lime" "yellow" "amber" "orange", $name) {
|
||||
--md-primary-bg-color: hsla(0, 0%, 0%, 0.87);
|
||||
--md-primary-bg-color--light: hsla(0, 0%, 0%, 0.54);
|
||||
} @else {
|
||||
--md-primary-bg-color: hsla(0, 0%, 100%, 1);
|
||||
--md-primary-bg-color--light: hsla(0, 0%, 100%, 0.7);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Rules: white
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Color palette
|
||||
[data-md-color-primary="white"] {
|
||||
--md-primary-fg-color: hsla(#{hex2hsl($clr-indigo-500)}, 1);
|
||||
--md-primary-fg-color--light: hsla(#{hex2hsl($clr-indigo-300)}, 1);
|
||||
--md-primary-fg-color--dark: hsla(#{hex2hsl($clr-indigo-700)}, 1);
|
||||
--md-primary-bg-color: hsla(0, 0%, 100%, 1);
|
||||
--md-primary-bg-color--light: hsla(0, 0%, 100%, 0.7);
|
||||
|
||||
// Application header (stays always on top)
|
||||
.md-header {
|
||||
color: var(--md-default-fg-color);
|
||||
background-color: var(--md-default-bg-color);
|
||||
}
|
||||
|
||||
// Hero teaser
|
||||
.md-hero {
|
||||
color: var(--md-default-fg-color);
|
||||
background-color: var(--md-default-bg-color);
|
||||
|
||||
// Add a border if there are no tabs
|
||||
&--expand {
|
||||
border-bottom: px2rem(1px) solid var(--md-default-fg-color--lightest);
|
||||
}
|
||||
}
|
||||
|
||||
// [tablet portrait -]: Layered navigation
|
||||
@include break-to-device(tablet portrait) {
|
||||
|
||||
// Repository containing source
|
||||
.md-nav__source {
|
||||
color: var(--md-default-fg-color);
|
||||
background-color: var(--md-default-fg-color--lightest);
|
||||
}
|
||||
}
|
||||
|
||||
// [tablet portrait +]: Change color of search input
|
||||
@include break-from-device(tablet landscape) {
|
||||
|
||||
// Search input
|
||||
.md-search__input {
|
||||
background-color: var(--md-default-fg-color--lightest);
|
||||
|
||||
// Icon color
|
||||
+ .md-search__icon {
|
||||
color: var(--md-default-fg-color);
|
||||
}
|
||||
|
||||
// Placeholder color
|
||||
&::placeholder {
|
||||
color: var(--md-default-fg-color--light);
|
||||
}
|
||||
|
||||
// Hovered search field
|
||||
&:hover {
|
||||
background-color: var(--md-default-fg-color--lighter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// [tablet -]: Layered navigation
|
||||
@include break-to-device(tablet) {
|
||||
|
||||
// Site title in main navigation
|
||||
html & .md-nav--primary .md-nav__title[for="__drawer"] {
|
||||
color: var(--md-default-fg-color);
|
||||
background-color: var(--md-default-bg-color);
|
||||
}
|
||||
|
||||
// Hero teaser
|
||||
.md-hero {
|
||||
border-bottom: px2rem(1px) solid var(--md-default-fg-color--lightest);
|
||||
}
|
||||
}
|
||||
|
||||
// [screen +]: Set background color for tabs
|
||||
@include break-from-device(screen) {
|
||||
|
||||
// Tabs with outline
|
||||
.md-tabs {
|
||||
color: var(--md-default-fg-color);
|
||||
background-color: var(--md-default-bg-color);
|
||||
border-bottom: px2rem(1px) solid var(--md-default-fg-color--lightest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Rules: black
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Color palette
|
||||
[data-md-color-primary="black"] {
|
||||
--md-primary-fg-color: hsla(#{hex2hsl($clr-indigo-500)}, 1);
|
||||
--md-primary-fg-color--light: hsla(#{hex2hsl($clr-indigo-300)}, 1);
|
||||
--md-primary-fg-color--dark: hsla(#{hex2hsl($clr-indigo-700)}, 1);
|
||||
--md-primary-bg-color: hsla(0, 0%, 100%, 1);
|
||||
--md-primary-bg-color--light: hsla(0, 0%, 100%, 0.7);
|
||||
|
||||
// Application header (stays always on top)
|
||||
.md-header {
|
||||
background-color: hsla(0, 0%, 0%, 1);
|
||||
}
|
||||
|
||||
// Hero teaser
|
||||
.md-hero {
|
||||
background-color: hsla(0, 0%, 0%, 1);
|
||||
}
|
||||
|
||||
// [tablet portrait -]: Layered navigation
|
||||
@include break-to-device(tablet portrait) {
|
||||
|
||||
// Repository containing source
|
||||
.md-nav__source {
|
||||
background-color: var(--md-default-fg-color);
|
||||
}
|
||||
}
|
||||
|
||||
// [tablet landscape +]: Header-embedded search
|
||||
@include break-from-device(tablet landscape) {
|
||||
|
||||
// Search input
|
||||
.md-search__input {
|
||||
background-color: var(--md-default-bg-color--lighter);
|
||||
|
||||
// Hovered search field
|
||||
&:hover {
|
||||
background-color: var(--md-default-bg-color--lightest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// [tablet -]: Layered navigation
|
||||
@include break-to-device(tablet) {
|
||||
|
||||
// Site title in main navigation
|
||||
html & .md-nav--primary .md-nav__title[for="__drawer"] {
|
||||
background-color: hsla(0, 0%, 0%, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// [screen +]: Set background color for tabs
|
||||
@include break-from-device(screen) {
|
||||
|
||||
// Tabs with outline
|
||||
.md-tabs {
|
||||
background-color: hsla(0, 0%, 0%, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Rules: accent colors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@each $name, $color in (
|
||||
"red": $clr-red-a400,
|
||||
"pink": $clr-pink-a400,
|
||||
"purple": $clr-purple-a200,
|
||||
"deep-purple": $clr-deep-purple-a200,
|
||||
"indigo": $clr-indigo-a200,
|
||||
"blue": $clr-blue-a200,
|
||||
"light-blue": $clr-light-blue-a700,
|
||||
"cyan": $clr-cyan-a700,
|
||||
"teal": $clr-teal-a700,
|
||||
"green": $clr-green-a700,
|
||||
"light-green": $clr-light-green-a700,
|
||||
"lime": $clr-lime-a700,
|
||||
"yellow": $clr-yellow-a700,
|
||||
"amber": $clr-amber-a700,
|
||||
"orange": $clr-orange-a400,
|
||||
"deep-orange": $clr-deep-orange-a200
|
||||
) {
|
||||
|
||||
// Color palette
|
||||
[data-md-color-accent="#{$name}"] {
|
||||
--md-accent-fg-color: hsla(#{hex2hsl($color)}, 1);
|
||||
--md-accent-fg-color--transparent: hsla(#{hex2hsl($color)}, 0.1);
|
||||
|
||||
// Inverted text for lighter shades
|
||||
@if index("lime" "yellow" "amber" "orange", $name) {
|
||||
--md-accent-bg-color: hsla(0, 0%, 0%, 0.87);
|
||||
--md-accent-bg-color--light: hsla(0, 0%, 0%, 0.54);
|
||||
} @else {
|
||||
--md-accent-bg-color: hsla(0, 0%, 100%, 1);
|
||||
--md-accent-bg-color--light: hsla(0, 0%, 100%, 0.7);
|
||||
}
|
||||
}
|
||||
}
|
||||
@import "palette/accent";
|
||||
@import "palette/primary";
|
||||
@import "palette/scheme";
|
||||
|
60
src/assets/stylesheets/palette/_accent.scss
Normal file
60
src/assets/stylesheets/palette/_accent.scss
Normal file
@ -0,0 +1,60 @@
|
||||
////
|
||||
/// Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>
|
||||
///
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
/// copy of this software and associated documentation files (the "Software"),
|
||||
/// to deal in the Software without restriction, including without limitation
|
||||
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
/// and/or sell copies of the Software, and to permit persons to whom the
|
||||
/// Software is furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
/// DEALINGS
|
||||
////
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Rules
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@each $name, $color in (
|
||||
"red": $clr-red-a400,
|
||||
"pink": $clr-pink-a400,
|
||||
"purple": $clr-purple-a200,
|
||||
"deep-purple": $clr-deep-purple-a200,
|
||||
"indigo": $clr-indigo-a200,
|
||||
"blue": $clr-blue-a200,
|
||||
"light-blue": $clr-light-blue-a700,
|
||||
"cyan": $clr-cyan-a700,
|
||||
"teal": $clr-teal-a700,
|
||||
"green": $clr-green-a700,
|
||||
"light-green": $clr-light-green-a700,
|
||||
"lime": $clr-lime-a700,
|
||||
"yellow": $clr-yellow-a700,
|
||||
"amber": $clr-amber-a700,
|
||||
"orange": $clr-orange-a400,
|
||||
"deep-orange": $clr-deep-orange-a200
|
||||
) {
|
||||
|
||||
// Color palette
|
||||
[data-md-color-accent="#{$name}"] {
|
||||
--md-accent-fg-color: hsla(#{hex2hsl($color)}, 1);
|
||||
--md-accent-fg-color--transparent: hsla(#{hex2hsl($color)}, 0.1);
|
||||
|
||||
// Inverted text for lighter shades
|
||||
@if index("lime" "yellow" "amber" "orange", $name) {
|
||||
--md-accent-bg-color: hsla(0, 0%, 0%, 0.87);
|
||||
--md-accent-bg-color--light: hsla(0, 0%, 0%, 0.54);
|
||||
} @else {
|
||||
--md-accent-bg-color: hsla(0, 0%, 100%, 1);
|
||||
--md-accent-bg-color--light: hsla(0, 0%, 100%, 0.7);
|
||||
}
|
||||
}
|
||||
}
|
194
src/assets/stylesheets/palette/_primary.scss
Normal file
194
src/assets/stylesheets/palette/_primary.scss
Normal file
@ -0,0 +1,194 @@
|
||||
////
|
||||
/// Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>
|
||||
///
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
/// copy of this software and associated documentation files (the "Software"),
|
||||
/// to deal in the Software without restriction, including without limitation
|
||||
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
/// and/or sell copies of the Software, and to permit persons to whom the
|
||||
/// Software is furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
/// DEALINGS
|
||||
////
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Rules
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@each $name, $colors in (
|
||||
"red": $clr-red-400 $clr-red-300 $clr-red-600,
|
||||
"pink": $clr-pink-500 $clr-pink-400 $clr-pink-700,
|
||||
"purple": $clr-purple-400 $clr-purple-300 $clr-purple-600,
|
||||
"deep-purple": $clr-deep-purple-400 $clr-deep-purple-300 $clr-deep-purple-500,
|
||||
"indigo": $clr-indigo-500 $clr-indigo-400 $clr-indigo-700,
|
||||
"blue": $clr-blue-500 $clr-blue-400 $clr-blue-700,
|
||||
"light-blue": $clr-light-blue-500 $clr-light-blue-400 $clr-light-blue-700,
|
||||
"cyan": $clr-cyan-500 $clr-cyan-400 $clr-cyan-700,
|
||||
"teal": $clr-teal-500 $clr-teal-400 $clr-teal-700,
|
||||
"green": $clr-green-500 $clr-green-400 $clr-green-700,
|
||||
"light-green": $clr-light-green-500 $clr-light-green-400 $clr-light-green-700,
|
||||
"lime": $clr-lime-500 $clr-lime-400 $clr-lime-700,
|
||||
"yellow": $clr-yellow-500 $clr-yellow-400 $clr-yellow-700,
|
||||
"amber": $clr-amber-500 $clr-amber-400 $clr-amber-700,
|
||||
"orange": $clr-orange-400 $clr-orange-400 $clr-orange-600,
|
||||
"deep-orange": $clr-deep-orange-400 $clr-deep-orange-300 $clr-deep-orange-600,
|
||||
"brown": $clr-brown-500 $clr-brown-400 $clr-brown-700,
|
||||
"grey": $clr-grey-600 $clr-grey-500 $clr-grey-700,
|
||||
"blue-grey": $clr-blue-grey-600 $clr-blue-grey-500 $clr-blue-grey-700
|
||||
) {
|
||||
|
||||
// Color palette
|
||||
[data-md-color-primary="#{$name}"] {
|
||||
--md-primary-fg-color: hsla(#{hex2hsl(nth($colors, 1))}, 1);
|
||||
--md-primary-fg-color--light: hsla(#{hex2hsl(nth($colors, 2))}, 1);
|
||||
--md-primary-fg-color--dark: hsla(#{hex2hsl(nth($colors, 3))}, 1);
|
||||
|
||||
// Inverted text for lighter shades
|
||||
@if index("lime" "yellow" "amber" "orange", $name) {
|
||||
--md-primary-bg-color: hsla(0, 0%, 0%, 0.87);
|
||||
--md-primary-bg-color--light: hsla(0, 0%, 0%, 0.54);
|
||||
} @else {
|
||||
--md-primary-bg-color: hsla(0, 0%, 100%, 1);
|
||||
--md-primary-bg-color--light: hsla(0, 0%, 100%, 0.7);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Rules: white
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Color palette
|
||||
[data-md-color-primary="white"] {
|
||||
--md-primary-fg-color: hsla(0, 0%, 100%, 1);
|
||||
--md-primary-fg-color--light: hsla(0, 0%, 100%, 0.7);
|
||||
--md-primary-fg-color--dark: hsla(0, 0%, 0%, 0.07);
|
||||
--md-primary-bg-color: hsla(0, 0%, 0%, 0.87);
|
||||
--md-primary-bg-color--light: hsla(0, 0%, 0%, 0.54);
|
||||
|
||||
// Text color shades
|
||||
--md-text-link-color: hsla(#{hex2hsl($clr-indigo-500)}, 1);
|
||||
|
||||
// Add a border if there are no tabs
|
||||
.md-hero--expand {
|
||||
border-bottom: px2rem(1px) solid hsla(0, 0%, 0%, 0.07);
|
||||
}
|
||||
|
||||
// [tablet -]: Set bottom border for hero
|
||||
@include break-to-device(tablet) {
|
||||
|
||||
// Hero teaser
|
||||
.md-hero {
|
||||
border-bottom: px2rem(1px) solid hsla(0, 0%, 0%, 0.07);
|
||||
}
|
||||
}
|
||||
|
||||
// [tablet portrait +]: Change color of search input
|
||||
@include break-from-device(tablet landscape) {
|
||||
|
||||
// Search input
|
||||
.md-search__input {
|
||||
background-color: hsla(0, 0%, 0%, 0.07);
|
||||
|
||||
// Icon color
|
||||
+ .md-search__icon {
|
||||
color: hsla(0, 0%, 0%, 0.87);
|
||||
}
|
||||
|
||||
// Placeholder color
|
||||
&::placeholder {
|
||||
color: hsla(0, 0%, 0%, 0.54);
|
||||
}
|
||||
|
||||
// Hovered search field
|
||||
&:hover {
|
||||
background-color: hsla(0, 0%, 0%, 0.32);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// [screen +]: Set bottom border for tabs
|
||||
@include break-from-device(screen) {
|
||||
|
||||
// Tabs with outline
|
||||
.md-tabs {
|
||||
border-bottom: px2rem(1px) solid hsla(0, 0%, 0%, 0.07);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Rules: black
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Color palette
|
||||
[data-md-color-primary="black"] {
|
||||
--md-primary-fg-color: hsla(0, 0%, 0%, 1);
|
||||
--md-primary-fg-color--light: hsla(0, 0%, 0%, 0.54);
|
||||
--md-primary-fg-color--dark: hsla(0, 0%, 0%, 1);
|
||||
--md-primary-bg-color: hsla(0, 0%, 100%, 1);
|
||||
--md-primary-bg-color--light: hsla(0, 0%, 100%, 0.7);
|
||||
|
||||
// Text color shades
|
||||
--md-text-link-color: hsla(#{hex2hsl($clr-indigo-500)}, 1);
|
||||
|
||||
// Application header (stays always on top)
|
||||
.md-header {
|
||||
background-color: hsla(0, 0%, 0%, 1);
|
||||
}
|
||||
|
||||
// Hero teaser
|
||||
.md-hero {
|
||||
background-color: hsla(0, 0%, 0%, 1);
|
||||
}
|
||||
|
||||
// [tablet portrait -]: Layered navigation
|
||||
@include break-to-device(tablet portrait) {
|
||||
|
||||
// Repository containing source
|
||||
.md-nav__source {
|
||||
background-color: hsla(0, 0%, 0%, 0.87);
|
||||
}
|
||||
}
|
||||
|
||||
// [tablet landscape +]: Header-embedded search
|
||||
@include break-from-device(tablet landscape) {
|
||||
|
||||
// Search input
|
||||
.md-search__input {
|
||||
background-color: hsla(0, 0%, 100%, 0.12);
|
||||
|
||||
// Hovered search field
|
||||
&:hover {
|
||||
background-color: hsla(0, 0%, 100%, 0.3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// [tablet -]: Layered navigation
|
||||
@include break-to-device(tablet) {
|
||||
|
||||
// Site title in main navigation
|
||||
html & .md-nav--primary .md-nav__title[for="__drawer"] {
|
||||
background-color: hsla(0, 0%, 0%, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// [screen +]: Set background color for tabs
|
||||
@include break-from-device(screen) {
|
||||
|
||||
// Tabs with outline
|
||||
.md-tabs {
|
||||
background-color: hsla(0, 0%, 0%, 1);
|
||||
}
|
||||
}
|
||||
}
|
51
src/assets/stylesheets/palette/_scheme.scss
Normal file
51
src/assets/stylesheets/palette/_scheme.scss
Normal file
@ -0,0 +1,51 @@
|
||||
////
|
||||
/// Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>
|
||||
///
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
/// copy of this software and associated documentation files (the "Software"),
|
||||
/// to deal in the Software without restriction, including without limitation
|
||||
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
/// and/or sell copies of the Software, and to permit persons to whom the
|
||||
/// Software is furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
/// DEALINGS
|
||||
////
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Rules
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Slate theme, i.e. dark mode
|
||||
[data-md-color-scheme="slate"] {
|
||||
|
||||
// Default color shades
|
||||
--md-default-fg-color: hsla(0, 0%, 100%, 1);
|
||||
--md-default-fg-color--light: hsla(0, 0%, 100%, 0.87);
|
||||
--md-default-fg-color--lighter: hsla(0, 0%, 100%, 0.32);
|
||||
--md-default-fg-color--lightest: hsla(0, 0%, 100%, 0.12);
|
||||
--md-default-bg-color: hsla(232, 15%, 21%, 1);
|
||||
--md-default-bg-color--light: hsla(232, 15%, 21%, 0.54);
|
||||
--md-default-bg-color--lighter: hsla(232, 15%, 21%, 0.26);
|
||||
--md-default-bg-color--lightest: hsla(232, 15%, 21%, 0.07);
|
||||
|
||||
// Code color shades
|
||||
--md-code-bg-color: hsla(232, 15%, 18%, 1);
|
||||
--md-code-fg-color: hsla(60, 30%, 96%, 1);
|
||||
|
||||
// Text color shades
|
||||
--md-text-color: var(--md-default-fg-color--light);
|
||||
--md-text-link-color: var(--md-primary-fg-color--light);
|
||||
|
||||
// Admonition shades
|
||||
--md-admonition-bg-color: hsla(0, 0%, 100%, 0.025);
|
||||
--md-admonition-fg-color: var(--md-default-fg-color);
|
||||
}
|
Loading…
Reference in New Issue
Block a user