UNPKG

highlight-share

Version:

Medium-like text selection sharing without dependencies

109 lines (98 loc) 2.92 kB
@import "vars"; @import "mixins"; .highlight-share-popover { max-width: @highlight-share-border-distance * 2; pointer-events: none; .highlight-share-filter(drop-shadow(0 1px 3px rgba(0, 0, 0, .35))); .highlight-share-animation(highlight-share-intro @highlight-share-animation-length); &::before { content: ""; position: absolute; bottom: 100%; left: 50%; width: 0; height: 0; margin: (@highlight-share-vertical-offset + @highlight-share-arrow-size) -@highlight-share-arrow-size; border-width: @highlight-share-arrow-size @highlight-share-arrow-size 0; border-style: solid; border-color: @highlight-share-background transparent; } > ul { pointer-events: auto; list-style: none; padding: 0; margin: @highlight-share-vertical-offset - @highlight-share-arrow-size 0 0; white-space: nowrap; background: @highlight-share-background; color: @highlight-share-foreground; border-radius: @highlight-share-border-radius; position: absolute; left: 50%; .highlight-share-transform(translate(-50%, -100%)); > li { display: inline-block; width: @highlight-share-sharer-width; height: @highlight-share-sharer-height; line-height: @highlight-share-sharer-height; text-align: center; > a { display: inline-block; width: 100%; height: 100%; color: inherit; box-sizing: border-box; padding: @highlight-share-sharer-padding; &:hover, &:focus { background: @highlight-share-highlight-link; } polyline { stroke: @highlight-share-foreground; } } } } @media (pointer: coarse) { font-size: 150%; .highlight-share-on-bottom(); } @media (max-width: @highlight-share-small-devices-max) { left: 0 !important; right: 0 !important; width: auto !important; max-width: none; .highlight-share-on-bottom(); > ul { left: 0; width: 100%; transform: none; border-radius: 0; text-align: center; } } } @-webkit-keyframes highlight-share-intro { 0% { -webkit-transform: translateY(-3em); opacity: 0; } 80% { -webkit-transform: translateY(.5em); opacity: 1; } 100% { -webkit-transform: translateY(0); } } @keyframes highlight-share-intro { 0% { transform: translateY(-3em); opacity: 0; } 80% { transform: translateY(.5em); opacity: 1; } 100% { transform: translateY(0); } }