1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2025-01-12 22:19:39 +01:00

123 lines
3.2 KiB
SCSS
Raw Normal View History

2018-06-10 17:23:06 +02: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
.tabbed-content {
2018-06-10 17:23:06 +02:00
display: none;
order: 99;
width: 100%;
background-color: $md-color-white;
// Actual content
pre {
2018-06-10 17:23:06 +02:00
margin: 0;
border-radius: 0
}
}
// Tabbed code block container
.tabbed-set {
2018-06-10 17:23:06 +02:00
display: flex;
position: relative;
flex-wrap: wrap;
margin: 1em 0;
border: px2rem(1px) solid $md-color-black--lightest;
2018-06-10 17:23:06 +02:00
border-radius: 0.2em;
// Hide radio buttons
> input {
2018-06-10 17:23:06 +02:00
display: none;
// Active tab label
&:checked + label {
font-weight: 700;
// Show code tab content
& + .tabbed-content {
2018-06-10 17:23:06 +02:00
display: block;
padding: 0 px2rem(12px);
// Adjust spacing on last element
> :last-child {
margin-bottom: px2rem(12px);
}
> {
div.highlight,
div.codehilite,
pre,
table.highlighttable,
table.codehilitetable {
&:only-child {
margin: 0 px2rem(-12px);
}
}
}
2018-06-10 17:23:06 +02:00
}
}
}
// Tab label
> label {
2018-06-10 17:23:06 +02:00
width: auto;
padding: px2rem(12px);
2018-06-10 17:23:06 +02:00
transition: color 0.125s;
font-size: ms(-1);
cursor: pointer;
// Hovered tab label
html &:hover {
color: $md-color-accent;
}
}
}
// Full-width container on top-level
> .tabbed-set {
2018-06-10 17:23:06 +02:00
// [mobile -]: Stretch to whole width
@include break-to-device(mobile) {
margin: 1em px2rem(-16px);
border: 0;
border-top: px2rem(1px) solid $md-color-black--lightest;
2018-06-10 17:23:06 +02:00
border-radius: 0;
// Actual container with code, overflowing
code {
padding: px2rem(10.5px) px2rem(16px);
2018-06-10 17:23:06 +02:00
}
// First tab label
input:first-child + label {
margin-left: px2rem(4px);
}
2018-06-10 17:23:06 +02:00
}
}
}