@nigelotoole/share-url
Version:
Share a URL with Web Share, copy to clipboard or to social media
65 lines (56 loc) • 1.11 kB
CSS
.share-url, share-url button {
display: inline-flex;
gap: .25em;
justify-content: center;
align-items: center;
padding: 8px 16px;
border: none;
background-color: #0157ff;
transition: all .25s;
color: #fff;
font-size: 1rem;
line-height: 1.5;
text-decoration: none;
text-align: center;
cursor: pointer;
&:is(:hover, :focus, .is-active) {
color: #fff;
background-color: #0034a3;
}
svg {
width: 1em;
height: 1em;
fill: currentColor;
stroke: currentColor;
}
&:not(.is-active) svg:last-of-type, &.is-active svg:first-of-type {
display: none;
}
}
/* Fallback - If JS is unavailable or action is not available */
.share-url, share-url button {
fallback {
a, a:hover {
color: #fff;
}
}
@media (scripting: enabled) {
&:not(.is-fallback) {
fallback {
display: none;
}
}
&:has(fallback).is-fallback {
> *:not(fallback) {
display: none;
}
}
}
@media (scripting: none) {
&:has(fallback) {
> *:not(fallback) {
display: none;
}
}
}
}