@@ -18,6 +18,11 @@ $body-bg: #fff !default;
1818$body-color : #222 !default ;
1919$text-muted : lighten ($body-color , 30% ) !default ;
2020
21+ // grey colors (like in bootstrap)
22+ $gray-200 : #e9ecef !default ;
23+ $gray-100 : #f8f9fa !default ;
24+ $gray-900 : #212529 !default ;
25+
2126// link colors
2227$primary : #2a76dd !default ;
2328$link-color : $primary !default ;
@@ -161,7 +166,7 @@ $kbd-padding-y: 0.4rem !default;
161166$kbd-padding-x : 0.4rem !default ;
162167$kbd-font-size : $presentation-font-size-root !default ;
163168$kbd-color : $body-color !default ;
164- $kbd-bg : $body-bg !default ;
169+ $kbd-bg : $gray-100 !default ; // like in bootstrap style
165170
166171/* -- scss:functions --*/
167172
@@ -170,8 +175,34 @@ $kbd-bg: $body-bg !default;
170175 " )" ;
171176}
172177
178+ @function tint-color ($color , $weight ) {
179+ @return mix (white , $color , $weight );
180+ }
181+
182+ @function shade-color ($color , $weight ) {
183+ @return mix (black , $color , $weight );
184+ }
185+
186+ @function shift-color ($color , $weight ) {
187+ @return if (
188+ $weight > 0 ,
189+ shade-color ($color , $weight ),
190+ tint-color ($color , - $weight )
191+ );
192+ }
193+
173194/* -- scss:mixins --*/
174195
196+ @mixin shift_to_dark ($property , $color ) {
197+ @if (
198+ sass-color .blackness ($backgroundColor ) > $code-block-theme-dark-threshhold
199+ ) {
200+ #{$property } : shift-color ($color , 70% );
201+ } @else {
202+ #{$property } : $color ;
203+ }
204+ }
205+
175206// -- START setting.scss --
176207
177208// Generates the presentation background, can be overridden
@@ -752,7 +783,7 @@ kbd {
752783 font-family : $font-family-monospace ;
753784 font-size : $kbd-font-size ;
754785 color : $kbd-color ;
755- background-color : $kbd-bg ;
786+ @include shift_to_dark ( " background-color" , $kbd-bg ) ;
756787 border : 1px solid ;
757788 border-color : $code-block-border-color ;
758789 border-radius : 5px ;
0 commit comments