2017-05-15 18:31:10 -06:00
|
|
|
////
|
2019-01-01 18:42:00 +01:00
|
|
|
/// Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
|
2017-05-15 18:31:10 -06: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
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2017-05-31 15:22:59 +02:00
|
|
|
// Copy to clipboard
|
|
|
|
.md-clipboard {
|
|
|
|
position: absolute;
|
2019-02-12 19:13:08 +01:00
|
|
|
top: px2rem(6px);
|
|
|
|
right: px2rem(6px);
|
|
|
|
width: px2rem(28px);
|
|
|
|
height: px2rem(28px);
|
|
|
|
border-radius: px2rem(2px);
|
|
|
|
font-size: px2rem(16px);
|
2017-05-31 15:22:59 +02:00
|
|
|
cursor: pointer;
|
|
|
|
z-index: 1;
|
|
|
|
// Hack: put everything on the GPU to omit flickering
|
|
|
|
backface-visibility: hidden;
|
|
|
|
|
2017-10-15 21:54:59 -04:00
|
|
|
// Hide for print
|
|
|
|
@media print {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2017-05-31 15:22:59 +02:00
|
|
|
// Icon
|
|
|
|
&::before {
|
|
|
|
@extend %md-icon;
|
|
|
|
|
|
|
|
transition:
|
|
|
|
color 0.25s,
|
|
|
|
opacity 0.25s;
|
2018-01-11 18:25:10 +01:00
|
|
|
color: $md-color-black--lightest;
|
2017-08-29 22:23:30 +07:00
|
|
|
content: "\E14D"; // content_copy
|
2017-05-15 18:31:10 -06:00
|
|
|
|
2017-05-31 15:22:59 +02:00
|
|
|
// Show on container hover
|
2017-05-31 16:50:11 +02:00
|
|
|
pre:hover &,
|
|
|
|
.codehilite:hover & {
|
2018-01-11 18:25:10 +01:00
|
|
|
color: $md-color-black--light;
|
2017-05-15 18:31:10 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-11 18:25:10 +01:00
|
|
|
// Focused or hovered icon
|
|
|
|
&:focus::before,
|
|
|
|
&:hover::before {
|
2017-05-31 15:22:59 +02:00
|
|
|
color: $md-color-accent;
|
|
|
|
}
|
2017-05-15 18:31:10 -06:00
|
|
|
|
2017-05-31 15:22:59 +02:00
|
|
|
// Message
|
|
|
|
&__message {
|
|
|
|
display: block;
|
2017-05-15 18:31:10 -06:00
|
|
|
position: absolute;
|
2017-05-31 15:22:59 +02:00
|
|
|
top: 0;
|
2019-02-12 19:13:08 +01:00
|
|
|
right: px2rem(34px);
|
|
|
|
padding: px2rem(6px) px2rem(10px);
|
|
|
|
transform: translateX(px2rem(8px));
|
2017-05-31 16:22:00 +02:00
|
|
|
transition:
|
2017-05-31 17:06:02 +02:00
|
|
|
transform 0.25s cubic-bezier(0.9, 0.1, 0.9, 0),
|
2017-05-31 16:22:00 +02:00
|
|
|
opacity 0.175s;
|
2019-02-12 19:13:08 +01:00
|
|
|
border-radius: px2rem(2px);
|
2017-11-22 19:25:37 +01:00
|
|
|
background-color: $md-color-black--light;
|
2017-05-15 18:31:10 -06:00
|
|
|
color: $md-color-white;
|
2017-05-31 15:22:59 +02:00
|
|
|
font-size: ms(-1);
|
|
|
|
white-space: nowrap;
|
2017-05-31 16:22:00 +02:00
|
|
|
opacity: 0;
|
|
|
|
pointer-events: none;
|
|
|
|
|
|
|
|
// Active message
|
|
|
|
&--active {
|
|
|
|
transform: translateX(0);
|
|
|
|
transition:
|
|
|
|
transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
|
|
|
|
opacity 0.175s 0.075s;
|
|
|
|
opacity: 1;
|
|
|
|
pointer-events: initial;
|
|
|
|
}
|
2017-05-15 18:31:10 -06:00
|
|
|
|
2017-05-31 15:22:59 +02:00
|
|
|
// Inject content from ARIA label
|
|
|
|
&::before {
|
|
|
|
content: attr(aria-label);
|
2017-05-15 18:31:10 -06:00
|
|
|
}
|
|
|
|
|
2017-05-31 15:22:59 +02:00
|
|
|
// Paint a nice speech bubble
|
2017-05-15 18:31:10 -06:00
|
|
|
&::after {
|
2017-05-31 15:22:59 +02:00
|
|
|
display: block;
|
2017-05-15 18:31:10 -06:00
|
|
|
position: absolute;
|
2017-05-31 15:22:59 +02:00
|
|
|
top: 50%;
|
2019-02-12 19:13:08 +01:00
|
|
|
right: px2rem(-4px);
|
2017-05-31 15:22:59 +02:00
|
|
|
width: 0;
|
2019-02-12 19:13:08 +01:00
|
|
|
margin-top: px2rem(-4px);
|
|
|
|
border-width: px2rem(4px) 0 px2rem(4px) px2rem(4px);
|
2017-05-31 15:22:59 +02:00
|
|
|
border-style: solid;
|
|
|
|
border-color: transparent $md-color-black--light;
|
|
|
|
content: "";
|
2017-05-15 18:31:10 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|