1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-12-23 12:54:53 +01:00
mkdocs-material/src/assets/stylesheets/layout/_source.scss

150 lines
3.5 KiB
SCSS
Raw Normal View History

////
2017-01-06 19:11:18 +01:00
/// Copyright (c) 2016-2017 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
// ----------------------------------------------------------------------------
2016-12-15 15:55:40 +01:00
// Show source facts
@keyframes md-source__facts--done {
0% {
height: 0;
}
100% {
height: 1.3rem;
}
}
// Show source fact
@keyframes md-source__fact--done {
0% {
transform: translateY(100%);
opacity: 0;
}
50% {
opacity: 0;
}
100% {
transform: translateY(0%);
opacity: 1;
}
}
// ----------------------------------------------------------------------------
// Rules
// ----------------------------------------------------------------------------
// Source container
.md-source {
display: block;
transition: opacity 0.25s;
font-size: 1.3rem;
2016-09-13 20:58:28 +02:00
line-height: 1.2;
white-space: nowrap;
// Hovered source information
&:hover {
opacity: 0.7;
}
// Necessary for vertical alignment
2016-12-28 14:47:53 +01:00
&::after {
display: inline-block;
height: 4.8rem;
content: "";
vertical-align: middle;
}
2016-12-28 14:47:53 +01:00
// Repository platform icon
&__icon {
display: inline-block;
width: 4.8rem;
height: 4.8rem;
content: "";
vertical-align: middle;
// Align SVG, do not scale, as this will incur strange formatting bugs
// in Internet Explorer and Edge
svg {
margin-top: 1.2rem;
margin-left: 1.2rem;
}
2016-12-28 14:47:53 +01:00
// Correct alignment, if icon is present
+ .md-source__repository {
margin-left: -4.4rem;
2017-01-01 15:59:44 +01:00
padding-left: 4rem;
}
}
// Repository name
&__repository {
display: inline-block;
max-width: 100%;
2016-12-28 14:47:53 +01:00
margin-left: 1.2rem;
font-weight: 700;
text-overflow: ellipsis;
overflow: hidden;
vertical-align: middle;
}
2016-09-13 20:58:28 +02:00
// Source facts (statistics etc.)
&__facts {
margin: 0;
padding: 0;
font-size: 1.1rem;
font-weight: 700;
2017-01-01 15:59:44 +01:00
list-style-type: none;
opacity: 0.75;
overflow: hidden;
2016-12-15 15:55:40 +01:00
// Show after the data was loaded
[data-md-state="done"] & {
animation: md-source__facts--done 0.25s ease-in;
}
2016-09-13 20:58:28 +02:00
}
// Fact
&__fact {
float: left;
2016-12-15 15:55:40 +01:00
// Show after the data was loaded
[data-md-state="done"] & {
animation: md-source__fact--done 0.4s ease-out;
2016-09-13 20:58:28 +02:00
}
2016-12-15 15:55:40 +01:00
// Middle dot before fact
2016-09-13 20:58:28 +02:00
&::before {
margin: 0 0.2rem;
content: "\00B7";
}
// Remove middle dot on first fact
&:first-child::before {
display: none;
2016-09-13 20:58:28 +02:00
}
}
}