2018-06-10 17:23:06 +02:00
|
|
|
////
|
2020-02-10 12:34:58 +01:00
|
|
|
/// Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>
|
2018-06-10 17:23:06 +02:00
|
|
|
///
|
|
|
|
/// 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
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// Scoped in typesetted content to match specificity of regular content
|
|
|
|
.md-typeset {
|
|
|
|
|
|
|
|
// Tabbed code block content
|
2020-02-14 00:16:04 -07:00
|
|
|
.tabbed-content {
|
2018-06-10 17:23:06 +02:00
|
|
|
display: none;
|
|
|
|
order: 99;
|
|
|
|
width: 100%;
|
2020-02-25 22:17:23 +01:00
|
|
|
background-color: var(--md-code-bg-color);
|
2018-06-10 17:23:06 +02:00
|
|
|
|
|
|
|
// Actual content
|
2020-02-10 12:34:58 +01:00
|
|
|
pre {
|
2018-06-10 17:23:06 +02:00
|
|
|
margin: 0;
|
|
|
|
border-radius: 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Tabbed code block container
|
2020-02-14 00:16:04 -07:00
|
|
|
.tabbed-set {
|
2018-06-10 17:23:06 +02:00
|
|
|
position: relative;
|
2020-03-06 15:21:08 +01:00
|
|
|
display: flex;
|
2018-06-10 17:23:06 +02:00
|
|
|
flex-wrap: wrap;
|
2018-06-13 09:51:04 +02:00
|
|
|
margin: 1em 0;
|
2020-02-25 20:25:05 +01:00
|
|
|
border: px2rem(1px) solid var(--md-default-fg-color--lightest);
|
2020-02-25 22:17:23 +01:00
|
|
|
border-radius: px2rem(2px);
|
2018-06-10 17:23:06 +02:00
|
|
|
|
|
|
|
// Hide radio buttons
|
2018-06-13 09:51:04 +02:00
|
|
|
> input {
|
2018-06-10 17:23:06 +02:00
|
|
|
display: none;
|
|
|
|
|
|
|
|
// Active tab label
|
|
|
|
&:checked + label {
|
2020-02-25 22:17:23 +01:00
|
|
|
color: var(--md-accent-fg-color);
|
2020-03-06 15:21:08 +01:00
|
|
|
border-color: var(--md-accent-fg-color);
|
2018-06-10 17:23:06 +02:00
|
|
|
|
|
|
|
// Show code tab content
|
2020-02-14 00:16:04 -07:00
|
|
|
& + .tabbed-content {
|
2018-06-10 17:23:06 +02:00
|
|
|
display: block;
|
2020-02-14 00:16:04 -07:00
|
|
|
padding: 0 px2rem(12px);
|
|
|
|
|
|
|
|
// Adjust spacing on last element
|
|
|
|
> :last-child {
|
|
|
|
margin-bottom: px2rem(12px);
|
|
|
|
}
|
|
|
|
|
2020-02-14 08:20:48 +01:00
|
|
|
// Emulate original pymdownx.superfences behavior and stretch to full
|
2020-02-25 22:17:23 +01:00
|
|
|
// width and height when a code block is the only child of a tab
|
2020-02-14 00:16:04 -07:00
|
|
|
> {
|
|
|
|
pre,
|
2020-02-14 08:20:48 +01:00
|
|
|
.highlight,
|
|
|
|
.highlighttable,
|
|
|
|
.codehilite,
|
|
|
|
.codehilitetable {
|
2020-02-14 00:16:04 -07:00
|
|
|
&:only-child {
|
|
|
|
margin: 0 px2rem(-12px);
|
2020-02-25 22:17:23 +01:00
|
|
|
|
|
|
|
// Remove double background
|
|
|
|
pre {
|
|
|
|
background: transparent;
|
|
|
|
}
|
2020-02-14 00:16:04 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-06-10 17:23:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Tab label
|
2018-06-13 09:51:04 +02:00
|
|
|
> label {
|
2018-06-10 17:23:06 +02:00
|
|
|
width: auto;
|
2019-02-12 19:13:08 +01:00
|
|
|
padding: px2rem(12px);
|
2020-02-25 22:17:23 +01:00
|
|
|
padding-bottom: px2rem(10px);
|
|
|
|
color: var(--md-default-fg-color--light);
|
|
|
|
font-weight: 700;
|
2020-03-06 15:21:08 +01:00
|
|
|
font-size: ms(-1);
|
|
|
|
border-bottom: px2rem(2px) solid transparent;
|
2018-06-10 17:23:06 +02:00
|
|
|
cursor: pointer;
|
2020-03-06 15:21:08 +01:00
|
|
|
transition:
|
|
|
|
color 125ms,
|
|
|
|
border 250ms;
|
2018-06-10 17:23:06 +02:00
|
|
|
|
|
|
|
// Hovered tab label
|
|
|
|
html &:hover {
|
2020-02-25 20:25:05 +01:00
|
|
|
color: var(--md-accent-fg-color);
|
2018-06-10 17:23:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Full-width container on top-level
|
2020-02-14 00:16:04 -07:00
|
|
|
> .tabbed-set {
|
2018-06-10 17:23:06 +02:00
|
|
|
|
|
|
|
// [mobile -]: Stretch to whole width
|
|
|
|
@include break-to-device(mobile) {
|
2019-02-12 19:13:08 +01:00
|
|
|
margin: 1em px2rem(-16px);
|
2018-06-13 09:51:04 +02:00
|
|
|
border: 0;
|
2020-02-25 20:25:05 +01:00
|
|
|
border-top: px2rem(1px) solid var(--md-default-fg-color--lightest);
|
2018-06-10 17:23:06 +02:00
|
|
|
border-radius: 0;
|
|
|
|
|
|
|
|
// Actual container with code, overflowing
|
|
|
|
code {
|
2019-02-12 19:13:08 +01:00
|
|
|
padding: px2rem(10.5px) px2rem(16px);
|
2018-06-10 17:23:06 +02:00
|
|
|
}
|
2020-02-10 12:34:58 +01:00
|
|
|
|
|
|
|
// First tab label
|
|
|
|
input:first-child + label {
|
|
|
|
margin-left: px2rem(4px);
|
|
|
|
}
|
2018-06-10 17:23:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|